FIX: fixed some issues with the enumaration and updated the Message class
This commit is contained in:
@@ -29,7 +29,8 @@ namespace WHISPER {
|
||||
|
||||
|
||||
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();
|
||||
|
||||
if(msg.IsInitialized())
|
||||
@@ -46,12 +47,19 @@ namespace WHISPER {
|
||||
|
||||
|
||||
|
||||
std::string Message::getPayloadString(){
|
||||
std::string Message::getPayloadString()
|
||||
{
|
||||
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;
|
||||
payloadString_ = payload->SerializeAsString();
|
||||
|
||||
@@ -63,14 +71,16 @@ namespace WHISPER {
|
||||
|
||||
|
||||
|
||||
std::string Message::serialize(){
|
||||
|
||||
std::string Message::serialize()
|
||||
{
|
||||
|
||||
std::string serializedMessage;
|
||||
if (msg.IsInitialized()) {
|
||||
serializedMessage = msg.SerializeAsString();
|
||||
}
|
||||
return serializedMessage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user