Skip to content

Instantly share code, notes, and snippets.

std::string serialize(map)
{
std::stringstream output;
// for each key/value pair in map
// "{key,value}{key,value}"
output << "{" << serialize(pair.first) << "." << serialize(pair.second) << "}"
return output.str();
}
// in your utilities classheader
template<typename T>
osal::uint32_t toUnsigned32(const T& t)
{
return t;
}
// you can put this in the utilities class header but probably belongs in datamodelenumerant header
template<>
osal::uint32_t toUnsigned32(const DataModelEnumerant& t)
interface WTF
{
Type type;
}
enum Type
{
A,
B
}