class TransceiverDataPackInterface

Overview

Base of TF Decorators. More…

#include <transceiver_datapack_interface.h>

class TransceiverDataPackInterface: public PtrTemplates {
public:
    // methods

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

    virtual const std::string& linkedEngineName() const;
    virtual bool isPreprocessing() const;

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

    virtual datapack_identifiers_set_t updateRequestedDataPackIDs(datapack_identifiers_set_t&& datapackIDs = datapack_identifiers_set_t()) const;
    virtual datapack_identifiers_set_t getRequestedDataPackIDs() const;
    static void setTFInterpreter(FunctionManager* interpreter);
    static const FunctionManager* getFunctionManager();
};

// direct descendants

class EngineDataPack;
class EngineDataPacks;
class SimulationIterationDecorator;
class SimulationTimeDecorator;
class StatusFunction;
class TransceiverFunction;

Inherited Members

public:
    // typedefs

    typedef std::shared_ptr<T> shared_ptr;
    typedef std::shared_ptr<const T> const_shared_ptr;
    typedef std::unique_ptr<T> unique_ptr;
    typedef std::unique_ptr<const T> const_unique_ptr;

Detailed Documentation

Base of TF Decorators.

Methods

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.

Parameters:

tfDataPack

Lower Decorator

Returns:

shared_ptr referencing data from this object

virtual const std::string& linkedEngineName() const

Get name of engine this transceiver is linked to.

virtual bool isPreprocessing() const

Indicates if this is a preprocessing function.

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.

Parameters:

args

Arguments for execution. Can be altered by any TransceiverDataPackInterfaces. Base class will only pass them along

kwargs

Keyword arguments for execution. Can be altered by any TransceiverDataPackInterfaces. Base class will only pass them along

Returns:

Returns result of TransceiverFunction execution.

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.

Parameters:

datapackIDs

Container with datapack IDs that gets expanded

Returns:

Returns datapackIDs, with own datapackIDs appended

virtual datapack_identifiers_set_t getRequestedDataPackIDs() const

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

static void setTFInterpreter(FunctionManager* interpreter)

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

Parameters:

interpreter

Interpreter to use