FIX: fixed some issues with the enumaration and updated the Message class
This commit is contained in:
@@ -29,13 +29,19 @@ namespace WHISPER {
|
|||||||
/// owntrack informaton
|
/// owntrack informaton
|
||||||
OWN_TRACK,
|
OWN_TRACK,
|
||||||
/// raw track message
|
/// raw track message
|
||||||
RAW_TRACK,
|
GROUND_TRUTH_TRACK,
|
||||||
|
/// radar track
|
||||||
|
RADAR_TRACK,
|
||||||
|
/// esm track
|
||||||
|
ESM_TRACK,
|
||||||
/// SENSOR Track message
|
/// SENSOR Track message
|
||||||
SENSOR_TRACK,
|
SENSOR_TRACK,
|
||||||
/// simple data
|
/// simple data
|
||||||
SIMPLE,
|
SIMPLE,
|
||||||
///
|
///dummy string Data
|
||||||
STRINGDATA
|
STRINGDATA,
|
||||||
|
/// Command messages
|
||||||
|
COMMAND
|
||||||
}; // enum class EventType
|
}; // enum class EventType
|
||||||
|
|
||||||
|
|
||||||
@@ -56,7 +62,7 @@ namespace WHISPER {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SourceType : int32_t
|
enum SourceType : uint32_t
|
||||||
{
|
{
|
||||||
SIMCOMTROLER,
|
SIMCOMTROLER,
|
||||||
///
|
///
|
||||||
@@ -115,12 +121,15 @@ namespace WHISPER {
|
|||||||
std::string serialize();
|
std::string serialize();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
/**
|
||||||
* @brief adds the payload with type of shared_prt of protbuf::any
|
* @brief adds the payload with type of shared_prt of protbuf::any
|
||||||
* @param std::shared_ptr<google::protobuf::Any>
|
* @param std::shared_ptr<google::protobuf::Any>
|
||||||
*/
|
*/
|
||||||
void addPayLoad(std::shared_ptr<google::protobuf::Any> any);
|
void addPayLoad(std::shared_ptr<google::protobuf::Any> any);
|
||||||
|
|
||||||
|
messages::header::Message getProtoMessage();
|
||||||
|
|
||||||
|
protected:
|
||||||
// void addPayLoad(std::string any);
|
// void addPayLoad(std::string any);
|
||||||
|
|
||||||
/// protobuf message; our header message
|
/// protobuf message; our header message
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ namespace WHISPER {
|
|||||||
|
|
||||||
|
|
||||||
Message::Message(std::uint32_t parentId,std::uint32_t deviceId, MsgTopics topic, MsgType Type,SourceType src):
|
Message::Message(std::uint32_t parentId,std::uint32_t deviceId, MsgTopics topic, MsgType Type,SourceType src):
|
||||||
parentId_(parentId),deviceId_(deviceId),topic_(topic),sourceType_(src),msgType_(Type){
|
parentId_(parentId),deviceId_(deviceId),topic_(topic),sourceType_(src),msgType_(Type)
|
||||||
|
{
|
||||||
msg = messages::header::Message();
|
msg = messages::header::Message();
|
||||||
|
|
||||||
if(msg.IsInitialized())
|
if(msg.IsInitialized())
|
||||||
@@ -46,12 +47,19 @@ namespace WHISPER {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string Message::getPayloadString(){
|
std::string Message::getPayloadString()
|
||||||
|
{
|
||||||
return payloadString_;
|
return payloadString_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
messages::header::Message Message::getProtoMessage()
|
||||||
|
{
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
void Message::addPayLoad(std::shared_ptr<google::protobuf::Any> payload){
|
|
||||||
|
void Message::addPayLoad(std::shared_ptr<google::protobuf::Any> payload)
|
||||||
|
{
|
||||||
payload_ = payload;
|
payload_ = payload;
|
||||||
payloadString_ = payload->SerializeAsString();
|
payloadString_ = payload->SerializeAsString();
|
||||||
|
|
||||||
@@ -63,14 +71,16 @@ namespace WHISPER {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string Message::serialize(){
|
|
||||||
|
std::string Message::serialize()
|
||||||
|
{
|
||||||
|
|
||||||
std::string serializedMessage;
|
std::string serializedMessage;
|
||||||
if (msg.IsInitialized()) {
|
if (msg.IsInitialized()) {
|
||||||
serializedMessage = msg.SerializeAsString();
|
serializedMessage = msg.SerializeAsString();
|
||||||
}
|
}
|
||||||
return serializedMessage;
|
return serializedMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user