ComputerRegistry
ComputerRegistry
Registry for TableView column computers and data adapters. More…
#include <ComputerRegistry.hpp>
Public Functions
| Name | |
|---|---|
| ComputerRegistry() | |
| ComputerRegistry(ComputerRegistry const & ) =delete | |
| ComputerRegistry & | operator=(ComputerRegistry const & ) =delete |
| ComputerRegistry(ComputerRegistry && ) =delete | |
| ComputerRegistry & | operator=(ComputerRegistry && ) =delete |
| std::vector< ComputerInfo > | getAvailableComputers(RowSelectorType rowSelectorType, DataSourceVariant const & dataSource) const Gets available computers for a specific row selector and data source combination. |
| std::vector< AdapterInfo > | getAvailableAdapters(std::type_index dataType) const Gets available adapters for a specific data type. |
| std::unique_ptr< IComputerBase > | createComputer(std::string const & computerName, DataSourceVariant const & dataSource, std::map< std::string, std::string > const & parameters ={}) const Creates a computer instance by name. |
| std::unique_ptr< IComputerBase > | createMultiComputer(std::string const & computerName, DataSourceVariant const & dataSource, std::map< std::string, std::string > const & parameters ={}) const |
| DataSourceVariant | createAdapter(std::string const & adapterName, std::shared_ptr< void > const & sourceData, std::shared_ptr< TimeFrame > const & timeFrame, std::string const & name, std::map< std::string, std::string > const & parameters ={}) const Creates an adapter instance by name. |
| ComputerInfo const * | findComputerInfo(std::string const & computerName) const Finds computer info by name. |
| AdapterInfo const * | findAdapterInfo(std::string const & adapterName) const Finds adapter info by name. |
| std::vector< std::string > | getAllComputerNames() const Gets all registered computer names. |
| std::vector< std::string > | getAllAdapterNames() const Gets all registered adapter names. |
| std::vector< std::type_index > | getAvailableOutputTypes() const Gets all available output types that computers can produce. |
| std::map< std::type_index, std::string > | getOutputTypeNames() const Gets human-readable names for available output types. |
| std::vector< ComputerInfo > | getComputersByOutputType(std::type_index outputType, std::optional< RowSelectorType > rowSelectorType =std::nullopt, std::optional< std::type_index > sourceType =std::nullopt) const Gets computers that can produce a specific output type. |
| bool | isVectorComputer(std::string const & computerName) const Checks if a computer supports vector output types. |
| std::type_index | getElementType(std::string const & computerName) const Gets the element type for vector-output computers. |
| template <typename T > std::unique_ptr< IColumnComputer< T > > |
createTypedComputer(std::string const & computerName, DataSourceVariant const & dataSource, std::map< std::string, std::string > const & parameters ={}) const Creates a type-safe computer with known output type. |
| template <typename T > std::unique_ptr< IMultiColumnComputer< T > > |
createTypedMultiComputer(std::string const & computerName, DataSourceVariant const & dataSource, std::map< std::string, std::string > const & parameters ={}) const |
Detailed Description
class ComputerRegistry;Registry for TableView column computers and data adapters.
This registry manages the available computers that can generate table columns from different data source types and row selector combinations. It also manages adapters that can convert raw data types into interface types suitable for use with computers.
Public Functions Documentation
function ComputerRegistry
ComputerRegistry()function ComputerRegistry
ComputerRegistry(
ComputerRegistry const &
) =deletefunction operator=
ComputerRegistry & operator=(
ComputerRegistry const &
) =deletefunction ComputerRegistry
ComputerRegistry(
ComputerRegistry &&
) =deletefunction operator=
ComputerRegistry & operator=(
ComputerRegistry &&
) =deletefunction getAvailableComputers
std::vector< ComputerInfo > getAvailableComputers(
RowSelectorType rowSelectorType,
DataSourceVariant const & dataSource
) constGets available computers for a specific row selector and data source combination.
Parameters:
- rowSelectorType The type of row selector being used.
- dataSource The data source variant.
Return: Vector of ComputerInfo describing available computers.
function getAvailableAdapters
std::vector< AdapterInfo > getAvailableAdapters(
std::type_index dataType
) constGets available adapters for a specific data type.
Parameters:
- dataType The type index of the raw data type.
Return: Vector of AdapterInfo describing available adapters.
function createComputer
std::unique_ptr< IComputerBase > createComputer(
std::string const & computerName,
DataSourceVariant const & dataSource,
std::map< std::string, std::string > const & parameters ={}
) constCreates a computer instance by name.
Parameters:
- computerName The name of the computer to create.
- dataSource The data source to use.
- parameters Map of parameter name -> string value.
Return: Type-erased unique_ptr to the computer instance, or nullptr if creation failed.
function createMultiComputer
std::unique_ptr< IComputerBase > createMultiComputer(
std::string const & computerName,
DataSourceVariant const & dataSource,
std::map< std::string, std::string > const & parameters ={}
) constfunction createAdapter
DataSourceVariant createAdapter(
std::string const & adapterName,
std::shared_ptr< void > const & sourceData,
std::shared_ptr< TimeFrame > const & timeFrame,
std::string const & name,
std::map< std::string, std::string > const & parameters ={}
) constCreates an adapter instance by name.
Parameters:
- adapterName The name of the adapter to create.
- sourceData The raw data to adapt.
- timeFrame The time frame for the adapted data.
- name The name for the adapted data source.
- parameters Map of parameter name -> string value.
Return: DataSourceVariant containing the adapted interface, or empty variant if creation failed.
function findComputerInfo
ComputerInfo const * findComputerInfo(
std::string const & computerName
) constFinds computer info by name.
Parameters:
- computerName The name of the computer.
Return: Pointer to ComputerInfo, or nullptr if not found.
function findAdapterInfo
AdapterInfo const * findAdapterInfo(
std::string const & adapterName
) constFinds adapter info by name.
Parameters:
- adapterName The name of the adapter.
Return: Pointer to AdapterInfo, or nullptr if not found.
function getAllComputerNames
std::vector< std::string > getAllComputerNames() constGets all registered computer names.
Return: Vector of all computer names.
function getAllAdapterNames
std::vector< std::string > getAllAdapterNames() constGets all registered adapter names.
Return: Vector of all adapter names.
function getAvailableOutputTypes
std::vector< std::type_index > getAvailableOutputTypes() constGets all available output types that computers can produce.
Return: Vector of type_index values representing all possible output types.
function getOutputTypeNames
std::map< std::type_index, std::string > getOutputTypeNames() constGets human-readable names for available output types.
Return: Map from type_index to human-readable type name.
function getComputersByOutputType
std::vector< ComputerInfo > getComputersByOutputType(
std::type_index outputType,
std::optional< RowSelectorType > rowSelectorType =std::nullopt,
std::optional< std::type_index > sourceType =std::nullopt
) constGets computers that can produce a specific output type.
Parameters:
- outputType The desired output type.
- rowSelectorType Optional filter by row selector type.
- sourceType Optional filter by required source type.
Return: Vector of ComputerInfo for computers matching the criteria.
function isVectorComputer
bool isVectorComputer(
std::string const & computerName
) constChecks if a computer supports vector output types.
Parameters:
- computerName The name of the computer to check.
Return: True if the computer outputs vector types, false otherwise.
function getElementType
std::type_index getElementType(
std::string const & computerName
) constGets the element type for vector-output computers.
Parameters:
- computerName The name of the computer.
Return: type_index of the element type, or typeid(void) if not a vector computer.
function createTypedComputer
template <typename T >
inline std::unique_ptr< IColumnComputer< T > > createTypedComputer(
std::string const & computerName,
DataSourceVariant const & dataSource,
std::map< std::string, std::string > const & parameters ={}
) constCreates a type-safe computer with known output type.
Parameters:
- computerName The name of the computer to create.
- dataSource The data source to use.
- parameters Map of parameter name -> string value.
Template Parameters:
- T The expected output type of the computer.
Return: Unique pointer to IColumnComputer
This template method provides compile-time type safety when the caller knows the expected output type. It returns a properly typed computer interface rather than a type-erased one.
function createTypedMultiComputer
template <typename T >
inline std::unique_ptr< IMultiColumnComputer< T > > createTypedMultiComputer(
std::string const & computerName,
DataSourceVariant const & dataSource,
std::map< std::string, std::string > const & parameters ={}
) constUpdated on 2026-11-13 at 20:25:41 +0000