NCBI C++ ToolKit
objhook.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef OBJHOOK__HPP
2 #define OBJHOOK__HPP
3 
4 /* $Id: objhook.hpp 99235 2023-03-01 16:29:47Z ucko $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Author: Eugene Vasilchenko
30 *
31 * File Description:
32 * Read and write hooks
33 */
34 
35 #include <util/util_exception.hpp>
36 #include <serial/serialdef.hpp>
38 #include <serial/impl/objstack.hpp>
39 #include <serial/objectiter.hpp>
40 
41 
42 /** @addtogroup ObjStreamSupport
43  *
44  * @{
45  */
46 
47 
49 
50 class CObjectIStream;
51 class CObjectOStream;
53 class CObjectInfo;
54 class CConstObjectInfo;
55 class CObjectTypeInfo;
56 
57 /// Read hook for a standalone object
59 {
60 public:
61  virtual ~CReadObjectHook(void);
62 
63  /// This method will be called at approriate time
64  /// when the object of requested type is to be read
65  virtual void ReadObject(CObjectIStream& in,
66  const CObjectInfo& object) = 0;
67  // Default actions
68  /// Default read
69  void DefaultRead(CObjectIStream& in,
70  const CObjectInfo& object);
71  /// Default skip
72  void DefaultSkip(CObjectIStream& in,
73  const CObjectTypeInfo& object);
74 };
75 
76 /// Read hook for data member of a containing object (eg, SEQUENCE)
78 {
79 public:
80  virtual ~CReadClassMemberHook(void);
81 
82  /// This method will be called at approriate time
83  /// when the object of requested type is to be read
85  const CObjectInfoMI& member) = 0;
86  virtual void ReadMissingClassMember(CObjectIStream& in,
87  const CObjectInfoMI& member);
88  void DefaultRead(CObjectIStream& in,
89  const CObjectInfoMI& object);
90  void DefaultSkip(CObjectIStream& in,
91  const CObjectTypeInfoMI& object);
92  void ResetMember(const CObjectInfoMI& object,
95 };
96 
97 /// Read hook for data member of a containing object (eg, SEQUENCE)
99  : public CReadClassMemberHook
100 {
101 public:
102  virtual ~CPreReadClassMemberHook(void);
103 
104  /// This method will be called at approriate time
105  /// when the object of requested type is to be read
106  virtual void ReadClassMember(CObjectIStream& in,
107  const CObjectInfoMI& member) override;
108 
109  /// Return true to invoke default reading method afterwards.
110  /// Return false if no firther reading needs to be done.
112  const CObjectInfoMI& member) = 0;
113 };
114 
115 /// Read hook for a choice variant (CHOICE)
117 {
118 public:
119  virtual ~CReadChoiceVariantHook(void);
120 
121  /// This method will be called at approriate time
122  /// when the object of requested type is to be read
124  const CObjectInfoCV& variant) = 0;
125  void DefaultRead(CObjectIStream& in,
126  const CObjectInfoCV& object);
127  void DefaultSkip(CObjectIStream& in,
128  const CObjectTypeInfoCV& object);
129 };
130 
131 /// Read hook for a choice variant (CHOICE)
133  : public CReadChoiceVariantHook
134 {
135 public:
136  virtual ~CPreReadChoiceVariantHook(void);
137 
138  /// This method will be called at approriate time
139  /// when the object of requested type is to be read
140  virtual void ReadChoiceVariant(CObjectIStream& in,
141  const CObjectInfoCV& variant) override;
142 
143  /// Return true to invoke default reading method afterwards.
144  /// Return false if no firther reading needs to be done.
146  const CObjectInfoCV& object) = 0;
147 };
148 
149 /// Read hook for a container element (SEQUENCE OF)
151 {
152 public:
153  virtual ~CReadContainerElementHook(void);
154 
156  const CObjectInfo& container) = 0;
157 };
158 
159 /// Write hook for a standalone object
161 {
162 public:
163  virtual ~CWriteObjectHook(void);
164 
165  /// This method will be called at approriate time
166  /// when the object of requested type is to be written
168  const CConstObjectInfo& object) = 0;
169  void DefaultWrite(CObjectOStream& out,
170  const CConstObjectInfo& object);
171 };
172 
173 /// Write hook for data member of a containing object (eg, SEQUENCE)
175 {
176 public:
177  virtual ~CWriteClassMemberHook(void);
178 
180  const CConstObjectInfoMI& member) = 0;
181  void DefaultWrite(CObjectOStream& out,
182  const CConstObjectInfoMI& member);
183  void CustomWrite(CObjectOStream& out,
184  const CConstObjectInfoMI& member,
185  const CConstObjectInfo& custom_object);
186 };
187 
188 /// Write hook for a choice variant (CHOICE)
190 {
191 public:
192  virtual ~CWriteChoiceVariantHook(void);
193 
195  const CConstObjectInfoCV& variant) = 0;
196  void DefaultWrite(CObjectOStream& out,
197  const CConstObjectInfoCV& variant);
198  void CustomWrite(CObjectOStream& out,
199  const CConstObjectInfoCV& variant,
200  const CConstObjectInfo& custom_object);
201 };
202 
203 /// Skip hook for a standalone object
205 {
206 public:
207  virtual ~CSkipObjectHook(void);
208 
209  virtual void SkipObject(CObjectIStream& stream,
210  const CObjectTypeInfo& type) = 0;
211 
212  // Default actions
213  /// Default read
214  void DefaultRead(CObjectIStream& in,
215  const CObjectInfo& object);
216  /// Default skip
217  void DefaultSkip(CObjectIStream& in,
218  const CObjectTypeInfo& type);
219 };
220 
221 /// Skip hook for data member of a containing object (eg, SEQUENCE)
223 {
224 public:
225  virtual ~CSkipClassMemberHook(void);
226 
227  virtual void SkipClassMember(CObjectIStream& stream,
228  const CObjectTypeInfoMI& member) = 0;
229  virtual void SkipMissingClassMember(CObjectIStream& stream,
230  const CObjectTypeInfoMI& member);
231  void DefaultRead(CObjectIStream& in,
232  const CObjectInfo& object);
233  void DefaultSkip(CObjectIStream& stream,
234  const CObjectTypeInfoMI& member);
235 };
236 
237 /// Skip hook for a choice variant (CHOICE)
239 {
240 public:
241  virtual ~CSkipChoiceVariantHook(void);
242 
243  virtual void SkipChoiceVariant(CObjectIStream& stream,
244  const CObjectTypeInfoCV& variant) = 0;
245  void DefaultRead(CObjectIStream& in,
246  const CObjectInfo& object);
247  void DefaultSkip(CObjectIStream& stream,
248  const CObjectTypeInfoCV& variant);
249 };
250 
251 
252 /// Copy hook for a standalone object
254 {
255 public:
256  virtual ~CCopyObjectHook(void);
257 
258  virtual void CopyObject(CObjectStreamCopier& copier,
259  const CObjectTypeInfo& type) = 0;
260  void DefaultCopy(CObjectStreamCopier& copier,
261  const CObjectTypeInfo& type);
262 };
263 
264 /// Copy hook for data member of a containing object (eg, SEQUENCE)
266 {
267 public:
268  virtual ~CCopyClassMemberHook(void);
269 
270  virtual void CopyClassMember(CObjectStreamCopier& copier,
271  const CObjectTypeInfoMI& member) = 0;
272  virtual void CopyMissingClassMember(CObjectStreamCopier& copier,
273  const CObjectTypeInfoMI& member);
274  void DefaultCopy(CObjectStreamCopier& copier,
275  const CObjectTypeInfoMI& member);
276 };
277 
278 /// Copy hook for a choice variant (CHOICE)
280 {
281 public:
282  virtual ~CCopyChoiceVariantHook(void);
283 
285  const CObjectTypeInfoCV& variant) = 0;
286  void DefaultCopy(CObjectStreamCopier& copier,
287  const CObjectTypeInfoCV& variant);
288 };
289 
290 
292  eDefault_Normal, // read or write data
293  eDefault_Skip // skip data
294 };
295 
296 
298 {
299 protected:
300  // object read hook
302  CReadObjectHook& hook,
303  CObjectIStream* stream = 0);
304  // object write hook
306  CWriteObjectHook& hook,
307  CObjectOStream* stream = 0);
308  // object skip hook
310  CSkipObjectHook& hook,
311  CObjectIStream* stream = 0);
312  // object copy hook
314  CCopyObjectHook& hook,
315  CObjectStreamCopier* stream = 0);
316 
317  // member read hook
319  const string& id,
320  CReadClassMemberHook& hook,
321  CObjectIStream* stream = 0);
322  // member write hook
324  const string& id,
325  CWriteClassMemberHook& hook,
326  CObjectOStream* stream = 0);
327  // member skip hook
329  const string& id,
330  CSkipClassMemberHook& hook,
331  CObjectIStream* stream = 0);
332  // member copy hook
334  const string& id,
335  CCopyClassMemberHook& hook,
336  CObjectStreamCopier* stream = 0);
337 
338  // choice variant read hook
340  const string& id,
342  CObjectIStream* stream = 0);
343  // choice variant write hook
345  const string& id,
347  CObjectOStream* stream = 0);
348  // choice variant skip hook
350  const string& id,
352  CObjectIStream* stream = 0);
353  // choice variant copy hook
355  const string& id,
357  CObjectStreamCopier* stream = 0);
358 
359  ~CObjectHookGuardBase(void);
360 
361  void ResetHook(const CObjectTypeInfo& info);
362 
363 private:
366 
367  enum EHookMode {
372  eHook_Copy
373  };
374  enum EHookType {
375  eHook_Null, // object hook
376  eHook_Object, // object hook
377  eHook_Member, // class member hook
378  eHook_Variant, // choice variant hook
379  eHook_Element // container element hook
380  };
381 
382  union {
386  } m_Stream;
390  string m_Id; // member or variant id
391 };
392 
393 
394 /// Helper class: installs hooks in constructor, and uninstalls in destructor
395 template <class T>
397 {
399 public:
400  /// Install object read hook
401  ///
402  /// @param hook
403  /// Hook object
404  /// @param stream
405  /// Data stream: if 0, the global hook is installed,
406  /// otherwise - local one
408  CObjectIStream* stream = 0)
409  : CParent(CType<T>(), hook, stream)
410  {
411  }
412  /// Install object write hook
413  ///
414  /// @param hook
415  /// Hook object
416  /// @param stream
417  /// Data stream: if 0, the global hook is installed,
418  /// otherwise - local one
420  CObjectOStream* stream = 0)
421  : CParent(CType<T>(), hook, stream)
422  {
423  }
424  /// Install object skip hook
425  ///
426  /// @param hook
427  /// Hook object
428  /// @param stream
429  /// Data stream: if 0, the global hook is installed,
430  /// otherwise - local one
432  CObjectIStream* stream = 0)
433  : CParent(CType<T>(), hook, stream)
434  {
435  }
436  /// Install object copy hook
437  ///
438  /// @param hook
439  /// Hook object
440  /// @param stream
441  /// Data stream: if 0, the global hook is installed,
442  /// otherwise - local one
444  CObjectStreamCopier* stream = 0)
445  : CParent(CType<T>(), hook, stream)
446  {
447  }
448 
449  /// Install member read hook
450  ///
451  /// @param id
452  /// Member id
453  /// @param hook
454  /// Hook object
455  /// @param stream
456  /// Data stream: if 0, the global hook is installed,
457  /// otherwise - local one
458  CObjectHookGuard(const string& id,
459  CReadClassMemberHook& hook,
460  CObjectIStream* stream = 0)
461  : CParent(CType<T>(), id, hook, stream)
462  {
463  }
464 
465  /// Install member write hook
466  ///
467  /// @param id
468  /// Member id
469  /// @param hook
470  /// Hook object
471  /// @param stream
472  /// Data stream: if 0, the global hook is installed,
473  /// otherwise - local one
474  CObjectHookGuard(const string& id,
475  CWriteClassMemberHook& hook,
476  CObjectOStream* stream = 0)
477  : CParent(CType<T>(), id, hook, stream)
478  {
479  }
480 
481  /// Install member skip hook
482  ///
483  /// @param id
484  /// Member id
485  /// @param hook
486  /// Hook object
487  /// @param stream
488  /// Data stream: if 0, the global hook is installed,
489  /// otherwise - local one
490  CObjectHookGuard(const string& id,
491  CSkipClassMemberHook& hook,
492  CObjectIStream* stream = 0)
493  : CParent(CType<T>(), id, hook, stream)
494  {
495  }
496 
497  /// Install member copy hook
498  ///
499  /// @param id
500  /// Member id
501  /// @param hook
502  /// Hook object
503  /// @param stream
504  /// Data stream: if 0, the global hook is installed,
505  /// otherwise - local one
506  CObjectHookGuard(const string& id,
507  CCopyClassMemberHook& hook,
508  CObjectStreamCopier* stream = 0)
509  : CParent(CType<T>(), id, hook, stream)
510  {
511  }
512 
513  /// Install choice variant read hook
514  ///
515  /// @param id
516  /// Variant id
517  /// @param hook
518  /// Hook object
519  /// @param stream
520  /// Data stream: if 0, the global hook is installed,
521  /// otherwise - local one
522  CObjectHookGuard(const string& id,
524  CObjectIStream* stream = 0)
525  : CParent(CType<T>(), id, hook, stream)
526  {
527  }
528 
529  /// Install choice variant write hook
530  ///
531  /// @param id
532  /// Variant id
533  /// @param hook
534  /// Hook object
535  /// @param stream
536  /// Data stream: if 0, the global hook is installed,
537  /// otherwise - local one
538  CObjectHookGuard(const string& id,
540  CObjectOStream* stream = 0)
541  : CParent(CType<T>(), id, hook, stream)
542  {
543  }
544 
545  /// Install choice variant skip hook
546  ///
547  /// @param id
548  /// Variant id
549  /// @param hook
550  /// Hook object
551  /// @param stream
552  /// Data stream: if 0, the global hook is installed,
553  /// otherwise - local one
554  CObjectHookGuard(const string& id,
556  CObjectIStream* stream = 0)
557  : CParent(CType<T>(), id, hook, stream)
558  {
559  }
560 
561  /// Install choice variant copy hook
562  ///
563  /// @param id
564  /// Variant id
565  /// @param hook
566  /// Hook object
567  /// @param stream
568  /// Data stream: if 0, the global hook is installed,
569  /// otherwise - local one
570  CObjectHookGuard(const string& id,
572  CObjectStreamCopier* stream = 0)
573  : CParent(CType<T>(), id, hook, stream)
574  {
575  }
576 
578  {
580  }
581 };
582 
583 
584 /// Helper hook for Serial_FilterObjects function template;
585 /// User hook class should be derived from this base class
586 template<typename TObject>
588 {
589 public:
590  virtual void SkipObject(CObjectIStream& in, const CObjectTypeInfo& type) override
591  {
592  if (type.GetTypeInfo()->IsCObject()) {
593  TObjectPtr objectPtr = type.GetTypeInfo()->Create(/*in.GetMemoryPool()*/);
594  CRef<CObject> ref;
595  ref.Reset(static_cast<CObject*>(objectPtr));
596  type.GetTypeInfo()->DefaultReadData(in, objectPtr);
597  Process(*static_cast<TObject*>(objectPtr));
598  } else {
599  TObject obj;
600  type.GetTypeInfo()->DefaultReadData(in, &obj);
601  Process(obj);
602  }
603  }
604  /// This method will be called when the object of the
605  /// requested class is read
606  virtual void Process(const TObject& obj) = 0;
607 };
608 
609 template<typename TObject>
611 {
612 public:
615  : m_processor(processor)
616  {
617  }
618  virtual void ReadObject(CObjectIStream& in,const CObjectInfo& object) override
619  {
620  DefaultRead(in,object);
621  TObject* obj = (TObject*)(object.GetObjectPtr());
622  m_processor->Process(*obj);
623  }
624 private:
626 };
627 
630 
631 /// Scan input stream, finding objects of requested type (TObject) only
632 template<typename TRoot, typename TObject>
634  bool readall=true)
635 {
636  CObjectTypeInfo root = CType<TRoot>();
637  CObjectTypeInfo request = CType<TObject>();
638  request.SetLocalSkipHook(in, hook);
640  while (Serial_FilterSkip(in,root) && readall)
641  ;
642 }
643 
644 /// Scan input stream, finding objects that are not derived from CSerialObject
645 template<typename TRoot, typename TObject>
647  bool readall=true)
648 {
649  CObjectTypeInfo root = CType<TRoot>();
651  request.SetLocalSkipHook(in, hook);
652  while (Serial_FilterSkip(in,root) && readall)
653  ;
654 }
655 
656 
657 
658 
659 /* @} */
660 
661 
663 
664 #endif /* OBJHOOK__HPP */
CConstObjectInfoCV –.
Definition: objectiter.hpp:557
CConstObjectInfoMI –.
Definition: objectiter.hpp:397
CConstObjectInfo –.
Definition: objectinfo.hpp:421
Copy hook for a choice variant (CHOICE)
Definition: objhook.hpp:280
Copy hook for data member of a containing object (eg, SEQUENCE)
Definition: objhook.hpp:266
Copy hook for a standalone object.
Definition: objhook.hpp:254
Helper class: installs hooks in constructor, and uninstalls in destructor.
Definition: objhook.hpp:397
CObjectIStream –.
Definition: objistr.hpp:93
CObjectInfoCV –.
Definition: objectiter.hpp:588
CObjectInfoMI –.
Definition: objectiter.hpp:432
CObjectInfo –.
Definition: objectinfo.hpp:597
CObjectOStream –.
Definition: objostr.hpp:83
CObjectStreamCopier –.
Definition: objcopy.hpp:71
CObjectTypeInfoCV –.
Definition: objectiter.hpp:477
CObjectTypeInfoMI –.
Definition: objectiter.hpp:246
CObjectTypeInfo –.
Definition: objectinfo.hpp:94
CObject –.
Definition: ncbiobj.hpp:180
Read hook for a choice variant (CHOICE)
Definition: objhook.hpp:134
Read hook for data member of a containing object (eg, SEQUENCE)
Definition: objhook.hpp:100
Read hook for a choice variant (CHOICE)
Definition: objhook.hpp:117
Read hook for data member of a containing object (eg, SEQUENCE)
Definition: objhook.hpp:78
Read hook for a container element (SEQUENCE OF)
Definition: objhook.hpp:151
Read hook for a standalone object.
Definition: objhook.hpp:59
Helper hook for Serial_FilterObjects function template; User hook class should be derived from this b...
Definition: objhook.hpp:588
Skip hook for a choice variant (CHOICE)
Definition: objhook.hpp:239
Skip hook for data member of a containing object (eg, SEQUENCE)
Definition: objhook.hpp:223
Skip hook for a standalone object.
Definition: objhook.hpp:205
Write hook for a choice variant (CHOICE)
Definition: objhook.hpp:190
Write hook for data member of a containing object (eg, SEQUENCE)
Definition: objhook.hpp:175
Write hook for a standalone object.
Definition: objhook.hpp:161
#define T(s)
Definition: common.h:230
std::ofstream out("events_result.xml")
main entry point for tests
void * TObjectPtr
Definition: serialdef.hpp:55
CObjectHookGuard(const string &id, CReadClassMemberHook &hook, CObjectIStream *stream=0)
Install member read hook.
Definition: objhook.hpp:458
virtual void SkipObject(CObjectIStream &stream, const CObjectTypeInfo &type)=0
CSerial_FilterObjectsHook< TObject > * m_processor
Definition: objhook.hpp:625
CObjectHookGuard(CWriteObjectHook &hook, CObjectOStream *stream=0)
Install object write hook.
Definition: objhook.hpp:419
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.
Definition: objhook.hpp:538
CObjectHookGuard(CCopyObjectHook &hook, CObjectStreamCopier *stream=0)
Install object copy hook.
Definition: objhook.hpp:443
void DefaultRead(CObjectIStream &in, const CObjectInfo &object)
Default read.
Definition: objhook.cpp:171
void SetLocalReadHook(CObjectIStream &stream, CReadObjectHook *hook) const
Set local (for the specified stream) read hook.
Definition: objectinfo.cpp:366
void SetLocalSkipHook(CObjectIStream &stream, CSkipObjectHook *hook) const
Set local (for the specified stream) skip hook.
Definition: objectinfo.cpp:420
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
Definition: objhook.hpp:383
CObjectHookGuard(const string &id, CCopyClassMemberHook &hook, CObjectStreamCopier *stream=0)
Install member copy hook.
Definition: objhook.hpp:506
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.
Definition: objhook.hpp:646
CObjectHookGuard(CSkipObjectHook &hook, CObjectIStream *stream=0)
Install object skip hook.
Definition: objhook.hpp:431
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.
Definition: objhook.hpp:522
CObjectHookGuard(CReadObjectHook &hook, CObjectIStream *stream=0)
Install object read hook.
Definition: objhook.hpp:407
EDefaultHookAction
Definition: objhook.hpp:291
CObjectHookGuard(const string &id, CSkipClassMemberHook &hook, CObjectIStream *stream=0)
Install member skip hook.
Definition: objhook.hpp:490
void ResetHook(const CObjectTypeInfo &info)
Definition: objhook.cpp:488
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.
Definition: objhook.hpp:554
const CObjectHookGuardBase & operator=(const CObjectHookGuardBase &)
CSerial_FilterReadObjectsHook(CSerial_FilterObjectsHook< TObject > *processor)
Definition: objhook.hpp:613
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.
~CObjectHookGuard(void)
Definition: objhook.hpp:577
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.
Definition: objhook.hpp:570
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.
Definition: objhook.hpp:618
EHookMode m_HookMode
Definition: objhook.hpp:388
CObjectOStream * m_OStream
Definition: objhook.hpp:384
CRef< CObject > m_Hook
Definition: objhook.hpp:387
EHookType m_HookType
Definition: objhook.hpp:389
CObjectHookGuardBase(const CObjectHookGuardBase &)
CObjectStreamCopier * m_Copier
Definition: objhook.hpp:385
EEraseFlag
Erase types.
Definition: objectiter.hpp:453
void Serial_FilterObjects(CObjectIStream &in, CSerial_FilterObjectsHook< TObject > *hook, bool readall=true)
Scan input stream, finding objects of requested type (TObject) only.
Definition: objhook.hpp:633
CObjectHookGuard(const string &id, CWriteClassMemberHook &hook, CObjectOStream *stream=0)
Install member write hook.
Definition: objhook.hpp:474
CObjectHookGuardBase CParent
Definition: objhook.hpp:398
bool Serial_FilterSkip(CObjectIStream &in, const CObjectTypeInfo &ctype)
Definition: serial.cpp:76
virtual void SkipObject(CObjectIStream &in, const CObjectTypeInfo &type) override
Definition: objhook.hpp:590
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.
@ eDefault_Skip
Definition: objhook.hpp:293
@ eDefault_Normal
Definition: objhook.hpp:292
@ eErase_Optional
default - erase optional member only
Definition: objectiter.hpp:454
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_XSERIAL_EXPORT
Definition: ncbi_export.h:1435
static MDB_envinfo info
Definition: mdb_load.c:37
std::istream & in(std::istream &in_, double &x_)
Definition: type.c:6
Modified on Fri Sep 20 14:57:50 2024 by modify_doxy.py rev. 669887