Neuralyzer::Entity::Lineage::LineageResolver
Neuralyzer::Entity::Lineage::LineageResolver
#include <LineageResolver.hpp>
Public Functions
| Name | |
|---|---|
| LineageResolver(IEntityDataSource const * data_source, LineageRegistry const * registry) Construct resolver with data source and registry. |
|
| ~LineageResolver() =default Default destructor. |
|
| LineageResolver(LineageResolver const & ) =delete | |
| LineageResolver & | operator=(LineageResolver const & ) =delete |
| LineageResolver(LineageResolver && ) =default | |
| LineageResolver & | operator=(LineageResolver && ) =default |
| 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< std::string > | getLineageChain(std::string const & data_key) const Get lineage chain (data keys from derived to sources). |
| std::unordered_set< EntityId > | getAllSourceEntities(std::string const & data_key) const Get all source EntityIds for a derived container. |
| 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 LineageResolver
LineageResolver(
IEntityDataSource const * data_source,
LineageRegistry const * registry
)Construct resolver with data source and registry.
Parameters:
- data_source Provides entity lookup (caller owns, must outlive resolver)
- registry Lineage metadata (caller owns, must outlive resolver)
function ~LineageResolver
~LineageResolver() =defaultDefault destructor.
function LineageResolver
LineageResolver(
LineageResolver const &
) =deletefunction operator=
LineageResolver & operator=(
LineageResolver const &
) =deletefunction LineageResolver
LineageResolver(
LineageResolver &&
) =defaultfunction operator=
LineageResolver & operator=(
LineageResolver &&
) =defaultfunction resolveToSource
std::vector< EntityId > resolveToSource(
std::string const & data_key,
TimeFrameIndex time,
std::size_t local_index =0
) constResolve 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/index
- 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
) constResolve 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
) constResolve 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 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 getLineageChain
std::vector< std::string > getLineageChain(
std::string const & data_key
) constGet lineage chain (data keys from derived to sources).
Parameters:
- data_key Key to start from
Return: Vector of data keys from derived to source(s)
Returns the sequence of data keys from the derived container back to its source(s). Useful for debugging and visualization.
function getAllSourceEntities
std::unordered_set< EntityId > getAllSourceEntities(
std::string const & data_key
) constGet 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 hasLineage
bool hasLineage(
std::string const & data_key
) constCheck 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
) constCheck 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