ores.ore.core

Table of Contents

1. Diagram

ores.ore.core component diagram

Figure 1: ores.ore.core

2. Summary

ores.ore.core is the engine that moves ORE documents in and out of the ORES domain model. It holds the codec that reads and writes ORE's XML vocabulary, the projections and mappers between the codec's records and the ores.trading, ores.refdata and ores.analytics domain types, the importer, the exporter and the directory round trip, readers for ORE's market data text formats, the import planner and directory scanner, and the generated series key shape entity with its repository.

The record tables are generated from the vendored schemas by projects/ores.ore/scripts/regenerate_xml_bindings.sh, and a drift check fails when the committed tables differ from what the schemas produce.

3. Inputs

  • ORE XML documents read from disk: portfolios, currency configurations, calendar adjustments and conventions.
  • ORE market data text files (-market*.txt, fixings*.txt) and the oresmd series keys they carry.
  • ORES trading and reference data objects to serialise back to ORE XML.

4. Outputs

  • Trading domain objects: trades with their instruments and envelopes, plus mapped conventions and FX conventions.
  • Reference data objects: currencies, calendar adjustments, portfolios and books.
  • Regenerated ORE XML documents, mirrored by the round trip.

5. Entry points

  • include/ores.ore.core/domain/ — the projections and the mappers.
  • include/ores.ore.core/xml/ — the importer, the exporter and the round trip.
  • include/ores.ore.core/market/ — the ORE market data readers and the FX quote convention checker.
  • include/ores.ore.core/scanner/ — the directory walk that classifies ORE files by root element.
  • include/ores.ore.core/planner/ — the import plan and its choices.
  • include/ores.ore.core/hierarchy/ — the portfolio and book node builder.
  • include/ores.ore.core/log/ — the ORE engine log line parser.
  • include/ores.ore.core/xml/run_package.hpp — where an ORE input directory's files sit in the directory the engine reads.

6. Dependencies

  • ores.ore.api — the shared contract, linked publicly.
  • ores.refdata.api, ores.trading.api, ores.analytics.api and ores.reporting.api — the domain types the mappers and projections target, linked publicly.
  • ores.dq.api, ores.logging, ores.platform, ores.utility and Boost — linked privately.

The component holds no database session. It converts documents and returns types; the store that once wrote reporting, refdata and analytics rows lived here and was removed, because a format codec that opens a session is a codec that writes another component's tables.

XML parsing is the generated binding code. The component links pugixml for the documents it writes and does not link nats.c.

7. Build dependencies

What the shared profile cannot know, declared here rather than hand-edited into the generated build file. Each block is spliced into its generated file after the profile's baseline.

8. See also

9. CMake

The generated record tables and the larger projections are big translation units, and MSVC needs /bigobj for them. The flag predates the codec and stays until a Windows build shows it is not needed.

if(MSVC)
    target_compile_options(${lib_target_name} PUBLIC /bigobj)
endif()

10. Test dependencies

The suites link what the profile cannot know about.

target_link_libraries(${lib_target_name}
    PUBLIC
        ores.analytics.api.lib
        ores.marketdata.api.lib
        ores.ore.api.lib
        ores.refdata.api.lib
        ores.reporting.api.lib
        ores.trading.api.lib
    PRIVATE
        ores.dq.api.lib
        ores.logging.lib
        ores.platform.lib
        ores.utility.lib
        pugixml::pugixml
        Boost::boost)
target_link_libraries(${tests_target_name}
    PRIVATE
        ${lib_target_name}
        ores.utility.lib
        ores.platform.lib
        ores.testing.lib
        ores.analytics.api.lib
        ores.analytics.core.lib
        ores.reporting.api.lib
        ores.reporting.core.lib
        ores.refdata.api.lib
        ores.refdata.core.lib
        ores.logging.lib
        ores.eventing.api.lib
        ores.eventing.core.lib
        ores.nats.lib
        ores.openssl_cleanup
        Catch2::Catch2
        faker-cxx::faker-cxx
        Threads::Threads)

# The corpus tests read the ORE examples from the checkout and write their
# output where a validator can reach it. Both paths are compile-time constants
# so a test run needs no environment beyond the tree it was built from.
target_compile_definitions(${tests_target_name} PRIVATE
    ORES_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
    ORES_XML_ROUNDTRIP_DIR="${CMAKE_BINARY_DIR}/xml-roundtrip")

Emacs 29.3 (Org mode 9.6.15)