TimestampValueComputer
TimestampValueComputer
Computer for extracting values from analog sources at specific timestamps. More…
#include <TimestampValueComputer.h>
Inherits from IColumnComputer< double >
Public Functions
| Name | |
|---|---|
| TimestampValueComputer(std::shared_ptr< IAnalogSource > source) Constructor for TimestampValueComputer. |
|
| TimestampValueComputer(std::shared_ptr< IAnalogSource > source, std::string sourceName) Constructor with custom source name. |
|
| virtual std::pair< std::vector< double >, ColumnEntityIds > | compute(const ExecutionPlan & plan) const override Computes values at specific timestamps. |
| std::string | getSourceDependency() const override Returns the source dependency name. |
| virtual EntityIdStructure | getEntityIdStructure() const override Gets the EntityID structure type for this computer. |
Additional inherited members
Public Functions inherited from IColumnComputer< double >
| Name | |
|---|---|
| virtual | ~IColumnComputer() =default |
| IColumnComputer(IColumnComputer const & ) =delete | |
| IColumnComputer & | operator=(IColumnComputer const & ) =delete |
| IColumnComputer(IColumnComputer && ) =delete | |
| IColumnComputer & | operator=(IColumnComputer && ) =delete |
| virtual std::vector< std::string > | getDependencies() const Declares dependencies on other columns. |
| virtual ColumnEntityIds | computeColumnEntityIds(ExecutionPlan const & plan) const Computes all EntityIDs for the column using the high-level variant approach. |
| virtual std::vector< EntityId > | computeCellEntityIds(ExecutionPlan const & plan, size_t row_index) const Computes EntityIDs for a specific row. |
| virtual bool | hasEntityIds() const Checks if this computer can provide EntityID information. |
Protected Functions inherited from IColumnComputer< double >
| Name | |
|---|---|
| IColumnComputer() =default |
Detailed Description
class TimestampValueComputer;Computer for extracting values from analog sources at specific timestamps.
Source type: IAnalogSource Selector type: Timestamp Output type: double
This computer works with timestamp-based row selectors (TimestampSelector) and extracts single values from an analog source at each specified timestamp. It’s designed for cases where you want to sample analog data at specific time points rather than computing statistics over intervals.
The computer takes an analog source and returns a vector of values corresponding to the timestamps defined by the row selector. Each value represents the analog signal value at that specific timestamp.
Public Functions Documentation
function TimestampValueComputer
explicit TimestampValueComputer(
std::shared_ptr< IAnalogSource > source
)Constructor for TimestampValueComputer.
Parameters:
- source Shared pointer to the analog source to extract values from.
function TimestampValueComputer
TimestampValueComputer(
std::shared_ptr< IAnalogSource > source,
std::string sourceName
)Constructor with custom source name.
Parameters:
- source Shared pointer to the analog source to extract values from.
- sourceName Custom name for the source dependency.
function compute
virtual std::pair< std::vector< double >, ColumnEntityIds > compute(
const ExecutionPlan & plan
) const overrideComputes values at specific timestamps.
Parameters:
- plan The execution plan containing timestamp indices.
Exceptions:
- std::runtime_error if the execution plan doesn’t contain indices
- std::runtime_error if the time frame is null
Return: Vector of analog values at each timestamp.
Precondition:
- plan.hasIndices() returns true
- plan.getTimeFrame() is not null
Postcondition: Result vector size equals plan.getIndices().size()
Reimplements: IColumnComputer::compute
This method extracts values from the analog source at each timestamp specified in the execution plan. The execution plan must contain indices (not intervals) for timestamp-based operations.
function getSourceDependency
std::string getSourceDependency() const overrideReturns the source dependency name.
Return: The name of the analog source this computer depends on.
function getEntityIdStructure
inline virtual EntityIdStructure getEntityIdStructure() const overrideGets the EntityID structure type for this computer.
Return: The EntityID structure type for this computer.
Reimplements: IColumnComputer::getEntityIdStructure
This indicates whether the computer provides no EntityIDs, simple EntityIDs (one per row), or complex EntityIDs (multiple per row).
Updated on 2026-11-13 at 20:25:39 +0000