1
#include <Atlas/Objects/Root.h>
2
#include <Atlas/Objects/SmartPtr.h>
3
#include <Atlas/Objects/Encoder.h>
4
#include <Atlas/Message/DecoderBase.h>
5
#include <Atlas/Objects/loadDefaults.h>
10
class RootDecoder : public Atlas::Message::DecoderBase
13
virtual void messageArrived(const Atlas::Message::MapType& o)
15
assert(o.find(std::string("parents")) != o.end());
16
assert((*o.find("parents")).second.asList().size() == 1);
17
assert(*(*o.find("parents")).second.asList().begin() ==
22
int main(int argc, char** argv)
25
Atlas::Objects::loadDefaults("../../../../protocols/atlas/spec/atlas.xml");
26
} catch(Atlas::Objects::DefaultLoadingException e) {
27
std::cout << "DefaultLoadingException: "
28
<< e.getDescription() << std::endl;
31
Atlas::Objects::ObjectsEncoder re(rd);
33
rd.streamBegin(); // important, otherwise we'll segfault!
34
Atlas::Objects::Root root_inst;
35
root_inst->setAttr("id", std::string("root_instantiation"));
36
re.streamObjectsMessage(root_inst);