class DataPackInterface

Overview

Interface to datapacks. More…

#include <datapack_interface.h>

class DataPackInterface: public PtrTemplates {
public:
    // construction

    DataPackInterface();
    DataPackInterface(const DataPackInterface&);
    DataPackInterface(DataPackInterface&& obj);

    template <class DEV_ID_T>
    DataPackInterface(DEV_ID_T&& id);

    DataPackInterface(
        const std::string& name,
        const std::string& engineName,
        const std::string& type
    );

    // methods

    DataPackInterface& operator = (const DataPackInterface&);
    DataPackInterface& operator = (DataPackInterface&&);
    const std::string& name() const;
    void setName(const std::string& name);
    const std::string& type() const;
    void setType(const std::string& type);
    const std::string& engineName() const;
    void setEngineName(const std::string& engineName);
    const DataPackIdentifier& id() const;
    void setID(const DataPackIdentifier& id);
    virtual DataPackInterface* clone() const;
    bool isEmpty() const;
    bool isUpdated() const;
    void resetIsUpdated() const;
};

// direct descendants

template <class DATA_TYPE>
class DataPack;

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

Interface to datapacks.

Methods

virtual DataPackInterface* clone() const

Virtual clone method to support polymorphic copy.

bool isEmpty() const

Indicates if the datapack contains any data aside from datapack ID.

The function will return true, if the datapack is of DataPackInterface type, which contains only datapack ID. For any concrete implementation of DataPack class, it should return false.

bool isUpdated() const

Indicates if the DataPack was created or received on the current simulation iteration.

Parameters:

true

When the DataPack was created or received on the current simulation iteration

false

When the DataPack is ‘stale’ - it was created or received on one of the earlier simulation iterations

void resetIsUpdated() const

Sets the isUpdated flag to false TODO This method is obviously non-const, it will be changed in NRRPLT-8589.