Last active
January 3, 2016 05:39
-
-
Save aozturk/8417754 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestMsg : public AMS::IMsgObj { | |
public: | |
// give unique id to each message | |
TestMsg() : IMsgObj(/*msg id*/1) {} | |
// primitive types and string can be used | |
std::string name; | |
double value; | |
// other class objects can be composed | |
AdditionalInfo info; | |
// standard vector and map containers can be used | |
std::vector<int> members; | |
std::map<int, int> mappings; | |
// allows serialization of selected members only | |
MSGPACK_DEFINE(name, value, info, members, mappings); | |
}; | |
class AdditionalInfo { | |
public: | |
std::string address; | |
double offset; | |
MSGPACK_DEFINE(address); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment