#include <ScopedSerialize.h>
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).
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. |