Skip to main content

Neuralyzer::Entity::Lineage::EntityResolver

Neuralyzer::Entity::Lineage::EntityResolver

#include <EntityResolver.hpp>

Public Functions

Name
EntityResolver(DataManager * dm)
Construct an EntityResolver.
~EntityResolver()
Destructor (defined in .cpp to allow forward-declared unique_ptr members).
std::vector< EntityId > resolveToSource(std::string const & data_key, TimeFrameIndex time, std::size_t local_index =0) const
Resolve derived element to source EntityIds (single step).
std::vector< EntityId > resolveToRoot(std::string const & data_key, TimeFrameIndex time, std::size_t local_index =0) const
Resolve all the way to root source containers.
std::vector< EntityId > resolveByEntityId(std::string const & data_key, EntityId derived_entity_id) const
Resolve by this container’s EntityId to parent EntityIds.
std::vector< EntityId > resolveByEntityIdToRoot(std::string const & data_key, EntityId derived_entity_id) const
Resolve by EntityId all the way to root.
std::unordered_set< EntityId > getAllSourceEntities(std::string const & data_key) const
Get all source EntityIds for a derived container.
std::vector< std::string > getLineageChain(std::string const & data_key) const
bool hasLineage(std::string const & data_key) const
Check if a data key has any lineage registered.
bool isSource(std::string const & data_key) const
Check if a data key represents source data (no parent).

Public Functions Documentation

function EntityResolver

explicit EntityResolver(
    DataManager * dm
)

Construct an EntityResolver.

Parameters:

  • dm Pointer to the DataManager (must outlive this resolver)

function ~EntityResolver

~EntityResolver()

Destructor (defined in .cpp to allow forward-declared unique_ptr members).

function resolveToSource

std::vector< EntityId > resolveToSource(
    std::string const & data_key,
    TimeFrameIndex time,
    std::size_t local_index =0
) const

Resolve derived element to source EntityIds (single step).

Parameters:

  • data_key Key of the (possibly derived) container
  • time TimeFrameIndex of element
  • local_index For ragged containers, which element at that time (0-indexed)

Return: Vector of source EntityIds (empty if no lineage or not found)

Note:

  • For Source lineage, returns EntityIds from the container itself
  • For OneToOneByTime, returns EntityIds from source at same time
  • For AllToOneByTime, returns ALL EntityIds from source at that time

Looks up the lineage for the given data key and returns the EntityIds from the immediate source container that correspond to the given time and local index.

function resolveToRoot

std::vector< EntityId > resolveToRoot(
    std::string const & data_key,
    TimeFrameIndex time,
    std::size_t local_index =0
) const

Resolve all the way to root source containers.

Parameters:

  • data_key Key of the derived container
  • time TimeFrameIndex of element
  • local_index For ragged containers, which element at that time

Return: Vector of root source EntityIds

Traverses the lineage chain until reaching containers with Source lineage. This handles multi-level derivations like: MaskData → AnalogTimeSeries (areas) → DigitalEventSeries (peaks)

function resolveByEntityId

std::vector< EntityId > resolveByEntityId(
    std::string const & data_key,
    EntityId derived_entity_id
) const

Resolve by this container’s EntityId to parent EntityIds.

Parameters:

  • data_key Key of the derived container
  • derived_entity_id EntityId of element in this container

Return: Vector of parent EntityIds (empty if no mapping found)

Note: Requires EntityMappedLineage or ImplicitEntityMapping lineage type

For containers that have their own EntityIds (like LineData from MaskData), this maps from the derived entity’s ID to its parent entity’s ID(s).

function resolveByEntityIdToRoot

std::vector< EntityId > resolveByEntityIdToRoot(
    std::string const & data_key,
    EntityId derived_entity_id
) const

Resolve by EntityId all the way to root.

Parameters:

  • data_key Key of the derived container
  • derived_entity_id EntityId of element in this container

Return: Vector of root source EntityIds

For entity-bearing derived containers, traces the full lineage chain from derived EntityId to root source EntityIds.

function getAllSourceEntities

std::unordered_set< EntityId > getAllSourceEntities(
    std::string const & data_key
) const

Get all source EntityIds for a derived container.

Parameters:

  • data_key Key of the derived container

Return: Set of all contributing source EntityIds

Returns all EntityIds from the source container(s) that contributed to any element in the derived container.

function getLineageChain

std::vector< std::string > getLineageChain(
    std::string const & data_key
) const

function hasLineage

bool hasLineage(
    std::string const & data_key
) const

Check if a data key has any lineage registered.

Parameters:

  • data_key Key to check

Return: true if lineage is registered for this key

function isSource

bool isSource(
    std::string const & data_key
) const

Check if a data key represents source data (no parent).

Parameters:

  • data_key Key to check

Return: true if this is a source container or has no registered lineage


Updated on 2026-11-13 at 20:25:41 +0000