hosted by CEDAR HepForge

Object Reading and Writing

Are there possibilities to automagically map C++ objects to dataharvester tuples?

up until now:

  • manually written method for mapping object X to harvest::Tuple

Example:

 VertexWriter::save ( const Vertex & vtx )
  {
    Tuple d("vertex");
    d["x"]=vtx.x();
    d["y"]=vtx.y();
    d["z"]=vtx.z();
    for trk in tracks
    {
      d["trk:weight"]=trk.weight();
      d["trk:id"]=trk.id();
      d.fill("trk");
    }
    dataharvester::Writer::file(myFileName) << d;
  }
  • future development: : gccxml (or maybe root's genreflex?) conversion for mapping between any object and Tuple.

A GenericObjectWritter would check if an xml description of a class exists. If it does not exist, it should be generated on-the-fly via 'gccxml'. The GenericObjectWriter takes e.g. (void *) pointers to the objects, reads the xml description of the object, and creates a Tuple that includes all data members.

Object Reading: