NRP Core  1.4.1
protobuf_ops Namespace Reference

Classes

class  NRPProtobufOps
 
class  NRPProtobufOpsIface
 

Functions

template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
std::unique_ptr< gpb::Message > unpackProtoAnySubset (const gpb::Any &from)
 Attempts to unpack an Any protobuf msg to any of the template parameter classes. More...
 
template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
void setDataPackMessageDataSubset (const gpb::Message &from, EngineGrpc::DataPackMessage *to)
 Set a protobuf datapack msg data field from a protobuf message. More...
 
template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
DataPackInterfaceConstSharedPtr getDataPackInterfaceFromMessageSubset (const std::string &engineName, const EngineGrpc::DataPackMessage &from)
 Finds the type of protobuf msg contained in 'from' data field and creates a datapack from it. More...
 
template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
void setDataPackMessageFromInterfaceSubset (const DataPackInterface &from, EngineGrpc::DataPackMessage *to)
 Sets the data field of a datapack protobuf message from a datapack interface. More...
 
template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
void setTrajectoryMessageFromInterfaceSubset (const DataPackInterface &from, NrpCore::TrajectoryMessage *to)
 Sets the data field of a datapack protobuf message from a datapack interface. More...
 

Function Documentation

◆ getDataPackInterfaceFromMessageSubset()

template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
DataPackInterfaceConstSharedPtr protobuf_ops::getDataPackInterfaceFromMessageSubset ( const std::string &  engineName,
const EngineGrpc::DataPackMessage &  from 
)

Finds the type of protobuf msg contained in 'from' data field and creates a datapack from it.

Template Parameters
MSG_TYPEtemplate param containing the list of protobuf types that will be check in the conversion
REMAINING_MSG_TYPES
Parameters
engineNameowner of 'from'
fromdatapack protobuf msg
Returns
the instantiated datapack

◆ setDataPackMessageDataSubset()

template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
void protobuf_ops::setDataPackMessageDataSubset ( const gpb::Message &  from,
EngineGrpc::DataPackMessage *  to 
)

Set a protobuf datapack msg data field from a protobuf message.

Template Parameters
MSG_TYPEtemplate param containing the list of protobuf types that will be check in the conversion
REMAINING_MSG_TYPES
Parameters
fromProtobuf message
toProtobuf datapack message which data will be set

◆ setDataPackMessageFromInterfaceSubset()

template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
void protobuf_ops::setDataPackMessageFromInterfaceSubset ( const DataPackInterface from,
EngineGrpc::DataPackMessage *  to 
)

Sets the data field of a datapack protobuf message from a datapack interface.

Template Parameters
MSG_TYPEtemplate param containing the list of protobuf types that will be check in the conversion
REMAINING_MSG_TYPES
Parameters
frominput datapack containing data
toprotobuf msg pointer which data field will be set to 'from'

◆ setTrajectoryMessageFromInterfaceSubset()

template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
void protobuf_ops::setTrajectoryMessageFromInterfaceSubset ( const DataPackInterface from,
NrpCore::TrajectoryMessage *  to 
)

Sets the data field of a datapack protobuf message from a datapack interface.

Template Parameters
MSG_TYPEtemplate param containing the list of protobuf types that will be check in the conversion
REMAINING_MSG_TYPES
Parameters
frominput datapack containing data
toprotobuf msg pointer which data field will be set to 'from'

◆ unpackProtoAnySubset()

template<class MSG_TYPE , class ... REMAINING_MSG_TYPES>
std::unique_ptr<gpb::Message> protobuf_ops::unpackProtoAnySubset ( const gpb::Any &  from)

Attempts to unpack an Any protobuf msg to any of the template parameter classes.

Template Parameters
MSG_TYPEtemplate param containing the list of protobuf types that will be check in the conversion
REMAINING_MSG_TYPES
Parameters
fromAny protobuf msg
Returns
protobuf msg unpacked from 'from'