Difference between revisions of "Serializing and deserializing root objects"
From GlueXWiki
m |
|||
Line 1: | Line 1: | ||
===Introduction=== | ===Introduction=== | ||
+ | ROOT objects can be serialized to a byte array or reconstructed from the byte array quite easily. One reason to do this might | ||
+ | be to store or transport ROOT objects in a way not supported by ROOT itself. An example is transport of a ROOT histogram from a producer to a | ||
+ | consumer program via the cMsg package, a publish/subscribe messaging system that will be used extensively in the Hall D online monitoring system (see section on Example Programs below). | ||
===Serialize=== | ===Serialize=== | ||
+ | |||
+ | ROOT TMessage objects can hold serialized ROOT objects. They are filled via the write() method: | ||
+ | |||
+ | |||
Revision as of 14:18, 30 June 2009
Introduction
ROOT objects can be serialized to a byte array or reconstructed from the byte array quite easily. One reason to do this might be to store or transport ROOT objects in a way not supported by ROOT itself. An example is transport of a ROOT histogram from a producer to a consumer program via the cMsg package, a publish/subscribe messaging system that will be used extensively in the Hall D online monitoring system (see section on Example Programs below).
Serialize
ROOT TMessage objects can hold serialized ROOT objects. They are filled via the write() method:
Deserialize
Example Programs
cMsgRootProducer.cc,cMsgRootConsumer.cc,Makefile Examples demonstrate transport via cMsg package.