586 template<
typename TObject>
592 if (
type.GetTypeInfo()->IsCObject()) {
596 type.GetTypeInfo()->DefaultReadData(
in, objectPtr);
597 Process(*
static_cast<TObject*
>(objectPtr));
600 type.GetTypeInfo()->DefaultReadData(
in, &obj);
609 template<
typename TObject>
621 TObject* obj = (TObject*)(
object.GetObjectPtr());
632 template<
typename TRoot,
typename TObject>
645 template<
typename TRoot,
typename TObject>
Copy hook for a choice variant (CHOICE)
Copy hook for data member of a containing object (eg, SEQUENCE)
Copy hook for a standalone object.
Helper class: installs hooks in constructor, and uninstalls in destructor.
Read hook for a choice variant (CHOICE)
Read hook for data member of a containing object (eg, SEQUENCE)
Read hook for a choice variant (CHOICE)
Read hook for data member of a containing object (eg, SEQUENCE)
Read hook for a container element (SEQUENCE OF)
Read hook for a standalone object.
Helper hook for Serial_FilterObjects function template; User hook class should be derived from this b...
Skip hook for a choice variant (CHOICE)
Skip hook for data member of a containing object (eg, SEQUENCE)
Skip hook for a standalone object.
Write hook for a choice variant (CHOICE)
Write hook for data member of a containing object (eg, SEQUENCE)
Write hook for a standalone object.
std::ofstream out("events_result.xml")
main entry point for tests
CObjectHookGuard(const string &id, CReadClassMemberHook &hook, CObjectIStream *stream=0)
Install member read hook.
virtual void SkipObject(CObjectIStream &stream, const CObjectTypeInfo &type)=0
CSerial_FilterObjectsHook< TObject > * m_processor
CObjectHookGuard(CWriteObjectHook &hook, CObjectOStream *stream=0)
Install object write hook.
virtual void PreReadChoiceVariant(CObjectIStream &in, const CObjectInfoCV &object)=0
Return true to invoke default reading method afterwards.
CObjectHookGuard(const string &id, CWriteChoiceVariantHook &hook, CObjectOStream *stream=0)
Install choice variant write hook.
CObjectHookGuard(CCopyObjectHook &hook, CObjectStreamCopier *stream=0)
Install object copy hook.
void DefaultRead(CObjectIStream &in, const CObjectInfo &object)
Default read.
void SetLocalReadHook(CObjectIStream &stream, CReadObjectHook *hook) const
Set local (for the specified stream) read hook.
void SetLocalSkipHook(CObjectIStream &stream, CSkipObjectHook *hook) const
Set local (for the specified stream) skip hook.
virtual void SkipChoiceVariant(CObjectIStream &stream, const CObjectTypeInfoCV &variant)=0
virtual void ReadObject(CObjectIStream &in, const CObjectInfo &object)=0
This method will be called at approriate time when the object of requested type is to be read.
CObjectIStream * m_IStream
CObjectHookGuard(const string &id, CCopyClassMemberHook &hook, CObjectStreamCopier *stream=0)
Install member copy hook.
virtual void SkipClassMember(CObjectIStream &stream, const CObjectTypeInfoMI &member)=0
void Serial_FilterStdObjects(CObjectIStream &in, CSerial_FilterObjectsHook< TObject > *hook, bool readall=true)
Scan input stream, finding objects that are not derived from CSerialObject.
CObjectHookGuard(CSkipObjectHook &hook, CObjectIStream *stream=0)
Install object skip hook.
virtual void WriteObject(CObjectOStream &out, const CConstObjectInfo &object)=0
This method will be called at approriate time when the object of requested type is to be written.
CObjectHookGuard(const string &id, CReadChoiceVariantHook &hook, CObjectIStream *stream=0)
Install choice variant read hook.
CObjectHookGuard(CReadObjectHook &hook, CObjectIStream *stream=0)
Install object read hook.
CObjectHookGuard(const string &id, CSkipClassMemberHook &hook, CObjectIStream *stream=0)
Install member skip hook.
void ResetHook(const CObjectTypeInfo &info)
virtual void WriteChoiceVariant(CObjectOStream &out, const CConstObjectInfoCV &variant)=0
virtual void CopyClassMember(CObjectStreamCopier &copier, const CObjectTypeInfoMI &member)=0
virtual void PreReadClassMember(CObjectIStream &in, const CObjectInfoMI &member)=0
Return true to invoke default reading method afterwards.
CObjectHookGuard(const string &id, CSkipChoiceVariantHook &hook, CObjectIStream *stream=0)
Install choice variant skip hook.
const CObjectHookGuardBase & operator=(const CObjectHookGuardBase &)
CSerial_FilterReadObjectsHook(CSerial_FilterObjectsHook< TObject > *processor)
virtual void ReadContainerElement(CObjectIStream &in, const CObjectInfo &container)=0
virtual void Process(const TObject &obj)=0
This method will be called when the object of the requested class is read.
virtual void ReadChoiceVariant(CObjectIStream &in, const CObjectInfoCV &variant)=0
This method will be called at approriate time when the object of requested type is to be read.
virtual void CopyChoiceVariant(CObjectStreamCopier &copier, const CObjectTypeInfoCV &variant)=0
virtual void WriteClassMember(CObjectOStream &out, const CConstObjectInfoMI &member)=0
CObjectHookGuard(const string &id, CCopyChoiceVariantHook &hook, CObjectStreamCopier *stream=0)
Install choice variant copy hook.
virtual void CopyObject(CObjectStreamCopier &copier, const CObjectTypeInfo &type)=0
virtual void ReadObject(CObjectIStream &in, const CObjectInfo &object) override
This method will be called at approriate time when the object of requested type is to be read.
CObjectOStream * m_OStream
CObjectHookGuardBase(const CObjectHookGuardBase &)
CObjectStreamCopier * m_Copier
void Serial_FilterObjects(CObjectIStream &in, CSerial_FilterObjectsHook< TObject > *hook, bool readall=true)
Scan input stream, finding objects of requested type (TObject) only.
CObjectHookGuard(const string &id, CWriteClassMemberHook &hook, CObjectOStream *stream=0)
Install member write hook.
CObjectHookGuardBase CParent
bool Serial_FilterSkip(CObjectIStream &in, const CObjectTypeInfo &ctype)
virtual void SkipObject(CObjectIStream &in, const CObjectTypeInfo &type) override
virtual void ReadClassMember(CObjectIStream &in, const CObjectInfoMI &member)=0
This method will be called at approriate time when the object of requested type is to be read.
@ eErase_Optional
default - erase optional member only
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_XSERIAL_EXPORT
std::istream & in(std::istream &in_, double &x_)