#include <iostream>
#include <fstream>

#include "addressbook.hh"
#include "MessageBuffer.hh"

using namespace std;

int main() {

  MsgTutorial::Person p;
  MsgTutorial::nmsg*  p2;
  libhla::MessageBuffer msgBuf;
  MsgTutorial::PhoneNumber phonenumber;
  phonenumber.setNumber("0608050304");
  phonenumber.setType(MsgTutorial::addressbook::MOBILE);
  p.setPhoneSize(1);
  p.setPhone(phonenumber,0);
  p.setName("lucas");
  p.show(cout);

  p.serialize(msgBuf);
  //FIXME envoi sur le réseau
  p2 = MsgTutorial::M_Factory::create(p.getType());
  p2->deserialize(msgBuf);
  p2->show(cout);
  delete p2;

}
