Implement serialization of opaque types.

This means that, conceptually, incremental hash computations now can start at
one node and finish at another one.
This commit is contained in:
Matthias Vallentin 2012-12-12 14:44:28 -08:00
parent 97e3ea1efe
commit 238cffaac4
2 changed files with 148 additions and 20 deletions

View file

@ -3131,19 +3131,15 @@ IMPLEMENT_SERIAL(OpaqueVal, SER_OPAQUE_VAL);
bool OpaqueVal::DoSerialize(SerialInfo* info) const
{
DO_SERIALIZE(SER_OPAQUE_VAL, Val);
assert(opaque_type);
// TODO: how to serialize a serializable class?
//return SERIALIZE(*opaque_type);
return false;
assert(opaque_type);
return opaque_type->Serialize(info);
}
bool OpaqueVal::DoUnserialize(UnserialInfo* info)
{
DO_UNSERIALIZE(Val);
// TODO: how to deserialize a serializable class?
//opaque_type = new OpaqueType();
//return UNSERIALIZE(opaque_type);
return false;
opaque_type = static_cast<OpaqueType*>(BroType::Unserialize(info));
return opaque_type != 0;
}