mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
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:
parent
97e3ea1efe
commit
238cffaac4
2 changed files with 148 additions and 20 deletions
12
src/Val.cc
12
src/Val.cc
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue