class StatusFunction

Overview

Holds a single Python function created with StatusFunction decorator. More…

#include <status_function.h>

class StatusFunction:
    public TransceiverDataPackInterface,
    public PtrTemplates {
public:
    // methods

    virtual const std::string& linkedEngineName() const;
    virtual bool isPreprocessing() const;
    TransceiverDataPackInterface::shared_ptr pySetup(boost::python::object statusFunction);

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

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;

    // 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();

Detailed Documentation

Holds a single Python function created with StatusFunction decorator.

Methods

virtual const std::string& linkedEngineName() const

Returns an empty string.

Status functions are not linked to any engine, so the string returned by this method should always be empty. The method is implemented in order to conform to the base interface.

virtual bool isPreprocessing() const

Returns false.

Status functions don’t have the concept of pre-processing. The method is implemented in order to conform to the base interface.

TransceiverDataPackInterface::shared_ptr pySetup(boost::python::object statusFunction)

Performs actual initialization of the object.

This method is linked to the call () method of Python StatusFunction decorator. It links the user-defined python function to this C++ object. It also registers the C++ object in the function manager.

Parameters:

statusFunction

User-defined python function. It will be linked to this C++ object.

Returns:

shared_ptr referencing data from this object

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

Runs the status function.

Parameters:

args

Python args

kwargs

Python keywords

Returns:

Result of status function execution