Go to the documentation of this file.
22 #ifndef FUNCTION_MANAGER_H
23 #define FUNCTION_MANAGER_H
33 #include <boost/python.hpp>
78 using linked_functions_t = std::pair<FunctionManager::function_datas_t::iterator, FunctionManager::function_datas_t::iterator>;
127 void loadDataPackFunction(
const std::string & dataPackFunctionName,
const std::string & dataPackFunctionFilename);
138 void loadStatusFunction(
const std::string & statusFunctionName,
const std::string & statusFunctionFilename);
173 unsigned long _simulationIteration = 0;
187 boost::python::dict _globalDict;
197 std::unique_ptr<FunctionData> _statusFunction =
nullptr;
209 function_datas_t::iterator _newDataPackFunctionIt = this->_dataPackFunctions.end();
216 function_datas_t::const_iterator findDataPackFunction(
const std::string &name)
const;
223 std::vector<std::shared_ptr<DataPackInterface>> runDataPackFunction(
const std::string &tfName,
datapacks_set_t dataPacks);
241 const bool preprocessing);
254 #endif // FUNCTION_MANAGER_H
std::vector< std::shared_ptr< const DataPackInterface > > datapacks_vector_t
Definition: datapack_interface.h:220
std::set< std::shared_ptr< const DataPackInterface >, DataPackPointerComparator > datapacks_set_t
Definition: datapack_interface.h:219
status_function_results_t executeStatusFunction(datapacks_set_t dataPacks)
Executes Status Function registered loaded by the manager.
Definition: function_manager.cpp:144
TransceiverDataPackInterface::shared_ptr Function
Pointer to the Function.
Definition: function_manager.h:48
FunctionManager()
Definition: function_manager.cpp:39
Holds a single transfer function decorator.
Definition: transceiver_function.h:36
DataPackPassingPolicy
Definition: from_engine_datapack.h:28
void setDataPackPassingPolicy(DataPackPassingPolicy method)
Definition: function_manager.cpp:411
std::tuple< bool, datapacks_vector_t > status_function_results_t
Definition: function_manager.h:79
datapacks_vector_t executeTransceiverFunctions(const std::string &engineName, datapacks_set_t dataPacks)
Executes all Transceiver Functions linked to an engine.
Definition: function_manager.cpp:381
std::set< DataPackIdentifier > datapack_identifiers_set_t
Definition: datapack_interface.h:221
DataPackPassingPolicy getDataPackPassingPolicy() const
Definition: function_manager.cpp:406
datapacks_vector_t executePreprocessingFunctions(const std::string &engineName, datapacks_set_t dataPacks)
Executes all Preprocessing Functions linked to an engine.
Definition: function_manager.cpp:376
Dummy alias class for TransceiverFunction, mapped to PreprocessingFunction python decorator.
Definition: python_module.cpp:68
std::shared_ptr< const FunctionManager > FunctionManagerConstSharedPtr
Definition: function_manager.h:252
std::string Name
Name of the Function.
Definition: function_manager.h:43
std::pair< FunctionManager::function_datas_t::iterator, FunctionManager::function_datas_t::iterator > linked_functions_t
Definition: function_manager.h:78
std::shared_ptr< FunctionManager > FunctionManagerSharedPtr
Definition: function_manager.h:251
void loadDataPackFunction(const std::string &dataPackFunctionName, const std::string &dataPackFunctionFilename)
Loads given DataPack Processing Function.
Definition: function_manager.cpp:271
const SimulationTime & getSimulationTime() const
Returns simulation time stored by the manager.
Definition: function_manager.cpp:391
std::shared_ptr< TransceiverDataPackInterface > shared_ptr
Definition: ptr_templates.h:31
void loadStatusFunction(const std::string &statusFunctionName, const std::string &statusFunctionFilename)
Loads given status funtion.
Definition: function_manager.cpp:226
TransceiverDataPackInterface::shared_ptr TransceiverDataPackInterfaceSharedPtr
Definition: transceiver_datapack_interface.h:134
std::multimap< std::string, FunctionData > function_datas_t
Definition: function_manager.h:77
Data associated with a single function.
Definition: function_manager.h:38
void setSimulationTime(SimulationTime simulationTime)
Sets simulation time that will be accessible by all Python Functions.
Definition: function_manager.cpp:386
void setSimulationIteration(unsigned long simulationIteration)
Sets simulation iteration that will be accessible by all Python Functions.
Definition: function_manager.cpp:396
Holds a single Python function created with StatusFunction decorator.
Definition: status_function.h:36
unsigned long getSimulationIteration() const
Returns simulation iteration number stored by the manager.
Definition: function_manager.cpp:401
datapack_identifiers_set_t getRequestedDataPackIDs() const
Get DataPack IDs requested by TFs.
Definition: function_manager.cpp:61
datapack_identifiers_set_t DataPackIDs
DataPacks requested by the Function.
Definition: function_manager.h:53
std::chrono::nanoseconds SimulationTime
Definition: time_utils.h:31
Manages all types of Python functions that can be run as part of NRP Core.
Definition: function_manager.h:73