A DataPackageMapping can be used by a Receiver to more conveniently retrieve values from a DataPackage.
More...
#include <DataPackageMapping.h>
A DataPackageMapping can be used by a Receiver to more conveniently retrieve values from a DataPackage.
The DataPackageMapping is used to map certain DataItem::names to variables. This is done by calling add and giving the DataItem::name and a pointer to a variable of the appropriate type. The user is responsible for making sure the pointer is valid during the lifetime of the DataPackageMapping object. When a new DataPackage is received it can be passed to the DataPackageMapping's update method and it will retrieve the values from the DataPackage and write them to the variables.
Definition at line 100 of file DataPackageMapping.h.
◆ DataPackageMapping() [1/2]
mars::data_broker::DataPackageMapping::DataPackageMapping |
( |
const DataPackageMapping & |
dpm | ) |
|
|
private |
◆ DataPackageMapping() [2/2]
mars::data_broker::DataPackageMapping::DataPackageMapping |
( |
| ) |
|
◆ ~DataPackageMapping()
mars::data_broker::DataPackageMapping::~DataPackageMapping |
( |
| ) |
|
◆ add()
template<typename T >
void mars::data_broker::DataPackageMapping::add |
( |
const std::string & |
itemName, |
|
|
T * |
var |
|
) |
| |
|
inline |
◆ clear()
void mars::data_broker::DataPackageMapping::clear |
( |
| ) |
|
◆ operator=()
◆ readPackage()
bool mars::data_broker::DataPackageMapping::readPackage |
( |
const DataPackage & |
package | ) |
|
Writes the values from the package to the mapped variables.
- Parameters
-
package | The DataPackage whose DataItems should be retrieved. This will retrieve all DataItems for which there is a mapping and write the value to the corresponding variable. |
Definition at line 35 of file DataPackageMapping.cpp.
◆ writePackage()
bool mars::data_broker::DataPackageMapping::writePackage |
( |
DataPackage * |
package | ) |
|
◆ accessors
std::vector<DataItemAccessorBase*> mars::data_broker::DataPackageMapping::accessors |
|
private |
◆ first
bool mars::data_broker::DataPackageMapping::first |
|
private |
The documentation for this class was generated from the following files: