NRP Core  1.4.1
TransceiverDataPackInterface Class Reference

Base of TF Decorators. More...

#include <transceiver_datapack_interface.h>

Inheritance diagram for TransceiverDataPackInterface:
PtrTemplates< TransceiverDataPackInterface > EngineDataPack EngineDataPacks SimulationIterationDecorator SimulationTimeDecorator StatusFunction TransceiverFunction PreprocessedDataPack PreprocessingFunction

Public Member Functions

 TransceiverDataPackInterface ()=default
 
virtual ~TransceiverDataPackInterface ()=default
 
template<class TRANSCEIVER_DATAPACK >
TransceiverDataPackInterface::shared_ptr pySetup (const TransceiverDataPackInterface::shared_ptr &tfDataPack)
 Decorator call() function. Takes the lower decorator as a parameter. Moves the given class into a shared_ptr, which will be managed by the next decorator. More...
 
virtual const std::string & linkedEngineName () const
 Get name of engine this transceiver is linked to. More...
 
virtual bool isPreprocessing () const
 Indicates if this is a preprocessing function. More...
 
virtual boost::python::object runTf (boost::python::tuple &args, boost::python::dict &kwargs, datapacks_set_t dataPacks)
 Execute Transceiver Function. Base class will simply call runTf on _function. More...
 
virtual datapack_identifiers_set_t updateRequestedDataPackIDs (datapack_identifiers_set_t &&datapackIDs=datapack_identifiers_set_t()) const
 Appends its own datapack requests onto datapackIDs. Uses getRequestedDataPackIDs to check which IDs are requested by this datapack. More...
 
virtual datapack_identifiers_set_t getRequestedDataPackIDs () const
 Returns datapack IDs of this DataPack that should be requested from the engines. TODO: Make protected. More...
 

Static Public Member Functions

static void setTFInterpreter (FunctionManager *interpreter)
 Set global TF Interpreter. All Transceiver Functions will register themselves with it upon creation. More...
 
static const FunctionManagergetFunctionManager ()
 

Protected Member Functions

template<class TRANSCEIVER_DATAPACK >
PtrTemplates< TRANSCEIVER_DATAPACK >::shared_ptr moveToSharedPtr ()
 
virtual TransceiverDataPackInterface::shared_ptrgetTFInterpreterRegistry ()
 Gets address of ptr under which the _functionManager has registered this TF. Mainly used during setup. More...
 

Static Protected Attributes

static FunctionManager_functionManager = nullptr
 Pointer to TF Interpreter. Will be used to register a new TF function. More...
 

Additional Inherited Members

- Public Types inherited from PtrTemplates< TransceiverDataPackInterface >
using shared_ptr = std::shared_ptr< TransceiverDataPackInterface >
 
using const_shared_ptr = std::shared_ptr< const TransceiverDataPackInterface >
 
using unique_ptr = std::unique_ptr< TransceiverDataPackInterface >
 
using const_unique_ptr = std::unique_ptr< const TransceiverDataPackInterface >
 

Detailed Description

Base of TF Decorators.

Constructor & Destructor Documentation

◆ TransceiverDataPackInterface()

TransceiverDataPackInterface::TransceiverDataPackInterface ( )
default

◆ ~TransceiverDataPackInterface()

virtual TransceiverDataPackInterface::~TransceiverDataPackInterface ( )
virtualdefault

Member Function Documentation

◆ getFunctionManager()

static const FunctionManager* TransceiverDataPackInterface::getFunctionManager ( )
inlinestatic

◆ getRequestedDataPackIDs()

datapack_identifiers_set_t TransceiverDataPackInterface::getRequestedDataPackIDs ( ) const
virtual

Returns datapack IDs of this DataPack that should be requested from the engines. TODO: Make protected.

Reimplemented in StatusFunction, TransceiverFunction, EngineDataPacks, and EngineDataPack.

◆ getTFInterpreterRegistry()

TransceiverDataPackInterface::shared_ptr * TransceiverDataPackInterface::getTFInterpreterRegistry ( )
protectedvirtual

Gets address of ptr under which the _functionManager has registered this TF. Mainly used during setup.

Returns
Returns address of ptr under which the _functionManager has registered this TF

◆ isPreprocessing()

bool TransceiverDataPackInterface::isPreprocessing ( ) const
virtual

Indicates if this is a preprocessing function.

Reimplemented in StatusFunction, and TransceiverFunction.

◆ linkedEngineName()

const std::string & TransceiverDataPackInterface::linkedEngineName ( ) const
virtual

Get name of engine this transceiver is linked to.

Reimplemented in StatusFunction, and TransceiverFunction.

◆ moveToSharedPtr()

template<class TRANSCEIVER_DATAPACK >
PtrTemplates<TRANSCEIVER_DATAPACK>::shared_ptr TransceiverDataPackInterface::moveToSharedPtr ( )
inlineprotected

◆ pySetup()

template<class TRANSCEIVER_DATAPACK >
TransceiverDataPackInterface::shared_ptr TransceiverDataPackInterface::pySetup ( const TransceiverDataPackInterface::shared_ptr tfDataPack)
inline

Decorator call() function. Takes the lower decorator as a parameter. Moves the given class into a shared_ptr, which will be managed by the next decorator.

Parameters
tfDataPackLower Decorator
Returns
shared_ptr referencing data from this object

◆ runTf()

boost::python::object TransceiverDataPackInterface::runTf ( boost::python::tuple &  args,
boost::python::dict &  kwargs,
datapacks_set_t  dataPacks 
)
virtual

Execute Transceiver Function. Base class will simply call runTf on _function.

Parameters
argsArguments for execution. Can be altered by any TransceiverDataPackInterfaces. Base class will only pass them along
kwargsKeyword arguments for execution. Can be altered by any TransceiverDataPackInterfaces. Base class will only pass them along
Returns
Returns result of TransceiverFunction execution.

Reimplemented in StatusFunction, EngineDataPacks, TransceiverFunction, EngineDataPack, SimulationIterationDecorator, and SimulationTimeDecorator.

◆ setTFInterpreter()

void TransceiverDataPackInterface::setTFInterpreter ( FunctionManager interpreter)
static

Set global TF Interpreter. All Transceiver Functions will register themselves with it upon creation.

Parameters
interpreterInterpreter to use

◆ updateRequestedDataPackIDs()

datapack_identifiers_set_t TransceiverDataPackInterface::updateRequestedDataPackIDs ( datapack_identifiers_set_t &&  datapackIDs = datapack_identifiers_set_t()) const
virtual

Appends its own datapack requests onto datapackIDs. Uses getRequestedDataPackIDs to check which IDs are requested by this datapack.

Parameters
datapackIDsContainer with datapack IDs that gets expanded
Returns
Returns datapackIDs, with own datapackIDs appended

Reimplemented in StatusFunction, and TransceiverFunction.

Member Data Documentation

◆ _functionManager

FunctionManager * TransceiverDataPackInterface::_functionManager = nullptr
staticprotected

Pointer to TF Interpreter. Will be used to register a new TF function.


The documentation for this class was generated from the following files: