class DataPackProcessor

Overview

Helper class for FTILoop encapsulating the datapack operations between Engines in a simulation loop. More…

#include <datapack_handle.h>

class DataPackProcessor {
public:
    // typedefs

    typedef std::vector<EngineClientInterfaceSharedPtr> engine_interfaces_t;

    // construction

    DataPackProcessor();
    DataPackProcessor(SimulationDataManager* simulationDataManager);

    // methods

    virtual void init(
        const jsonSharedPtr& simConfig,
        const engine_interfaces_t& engines
    ) = 0;

    virtual void updateDataPacksFromEngines(const std::vector<EngineClientInterfaceSharedPtr>& engines) = 0;
    virtual void compute(const std::vector<EngineClientInterfaceSharedPtr>& engines) = 0;
    virtual void sendDataPacksToEngines(const std::vector<EngineClientInterfaceSharedPtr>& engines) = 0;
    virtual void postEngineInit(const std::vector<EngineClientInterfaceSharedPtr>&);
    virtual void preEngineReset(const std::vector<EngineClientInterfaceSharedPtr>&);
    virtual void postEngineReset(const std::vector<EngineClientInterfaceSharedPtr>&);
    void datapackCycle(const std::vector<EngineClientInterfaceSharedPtr>& engines);
    void setSimulationTime(SimulationTime simulationTime);
    void setSimulationIteration(unsigned long simulationIteration);
};

// direct descendants

struct ComputationalGraphHandle;
class TFManagerHandle;

Detailed Documentation

Helper class for FTILoop encapsulating the datapack operations between Engines in a simulation loop.

Methods

virtual void init(
    const jsonSharedPtr& simConfig,
    const engine_interfaces_t& engines
) = 0

Initializes the handler.

Parameters:

simConfig

json object containing configuration information to initialize the handler

engines

list of Engine clients participating in the simulation

virtual void updateDataPacksFromEngines(const std::vector<EngineClientInterfaceSharedPtr>& engines) = 0

Request datapacks from engines.

Parameters:

engines

Engines that are been synchronize in the current loop

virtual void compute(const std::vector<EngineClientInterfaceSharedPtr>& engines) = 0

Perform computations on datapacks.

Parameters:

engines

Engines that are been synchronize in the current loop

virtual void sendDataPacksToEngines(const std::vector<EngineClientInterfaceSharedPtr>& engines) = 0

Send datapacks to engines.

Parameters:

engines

Engines that are been synchronize in the current loop

virtual void postEngineInit(const std::vector<EngineClientInterfaceSharedPtr>&)

Performs post-engine-initialization DataPack operations.

Parameters:

engines

Vector of engines for which the post-init step should be performed

virtual void preEngineReset(const std::vector<EngineClientInterfaceSharedPtr>&)

Performs pre-engine-reset DataPack operations.

Parameters:

engines

Vector of engines for which the pre-init step should be performed

virtual void postEngineReset(const std::vector<EngineClientInterfaceSharedPtr>&)

Performs post-engine-reset DataPack operations.

Parameters:

engines

Vector of engines for which the post-reset step should be performed

void datapackCycle(const std::vector<EngineClientInterfaceSharedPtr>& engines)

Execute sequentially the update, compute and send operations.

Parameters:

engines

Engines that are been synchronize in the current loop

clientData

Extra data coming from the NRP Client, will be passed to the status function