ScopedSerialize< STRING, ORIGIN > Class Template Reference
[Scoped]

#include <ScopedSerialize.h>

List of all members.


Detailed Description

template<typename STRING, typename ORIGIN>
class ScopedSerialize< STRING, ORIGIN >

connects a string and object for serialization and re-deserialization.

Note, this only works right now for downcalls. The equivalent upcall tool does not exist that I am aware of. What this class does is in its constructor serialize an object into a string. If the object passed in is constant, that's all that happens. But if the object is non-const, then on destruction of this object, the string is deserialized back into the object. This is to allow a higher level mace service to pass an object down, it automatically be converted into a string, and then for the lower layer to modify the string reference (replacing it with a new value for example), and then deserializing the string on return.

A reverse case would be to upcall a string, have it deserialize into an object, then re-serialize it once the upcall returns. That isn't written yet (though one-way serialization works just fine).

Todo:
move to mace namespace?

Definition at line 69 of file ScopedSerialize.h.


Public Member Functions

 ScopedSerialize (STRING &s, const ORIGIN &obj)
 this constructor is used if the object is const. This does a one-time serialization.
 ScopedSerialize (STRING &s, ORIGIN &obj)
 this constructor is used if the object is non-const. This serializes in constructor, and deserializes on the destructor.

The documentation for this class was generated from the following file:

Generated on Sat Oct 4 21:30:30 2008 for Mace Library by  doxygen 1.5.5