1 #ifndef HOOKFUNC__HPP
2 #define HOOKFUNC__HPP
3 
4 /*  $Id: hookfunc.hpp 103491 2007-05-04 17:18:18Z kazimird $
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 *   !!! PUT YOUR DESCRIPTION HERE !!!
33 */
34 
35 #include <corelib/ncbistd.hpp>
36 #include <serial/serialdef.hpp>
37 
38 
39 /** @addtogroup HookSupport
40  *
41  * @{
42  */
43 
44 
45 BEGIN_NCBI_SCOPE
46 
47 class CObjectIStream;
48 class CObjectOStream;
49 class CObjectStreamCopier;
50 class CTypeInfo;
51 class CMemberInfo;
52 class CVariantInfo;
53 
54 typedef void (*TTypeReadFunction)(CObjectIStream& in,
55                                   const CTypeInfo* objectType,
56                                   TObjectPtr objectPtr);
57 typedef void (*TTypeWriteFunction)(CObjectOStream& out,
58                                    const CTypeInfo* objectType,
59                                    TConstObjectPtr objectPtr);
60 typedef void (*TTypeCopyFunction)(CObjectStreamCopier& copier,
61                                   const CTypeInfo* objectType);
62 typedef void (*TTypeSkipFunction)(CObjectIStream& in,
63                                   const CTypeInfo* objectType);
64 
65 typedef void (*TMemberReadFunction)(CObjectIStream& in,
66                                     const CMemberInfo* memberInfo,
67                                     TObjectPtr classPtr);
68 typedef void (*TMemberWriteFunction)(CObjectOStream& out,
69                                      const CMemberInfo* memberInfo,
70                                      TConstObjectPtr classPtr);
71 typedef void (*TMemberCopyFunction)(CObjectStreamCopier& copier,
72                                     const CMemberInfo* memberInfo);
73 typedef void (*TMemberSkipFunction)(CObjectIStream& in,
74                                     const CMemberInfo* memberInfo);
75 
76 struct SMemberReadFunctions
77 {
SMemberReadFunctionsSMemberReadFunctions78     SMemberReadFunctions(TMemberReadFunction main = 0,
79                          TMemberReadFunction missing = 0)
80         : m_Main(main), m_Missing(missing)
81         {
82         }
83     TMemberReadFunction m_Main, m_Missing;
84 };
85 
86 struct SMemberSkipFunctions
87 {
SMemberSkipFunctionsSMemberSkipFunctions88     SMemberSkipFunctions(TMemberSkipFunction main = 0,
89                          TMemberSkipFunction missing = 0)
90         : m_Main(main), m_Missing(missing)
91         {
92         }
93     TMemberSkipFunction m_Main, m_Missing;
94 };
95 
96 struct SMemberCopyFunctions
97 {
SMemberCopyFunctionsSMemberCopyFunctions98     SMemberCopyFunctions(TMemberCopyFunction main = 0,
99                          TMemberCopyFunction missing = 0)
100         : m_Main(main), m_Missing(missing)
101         {
102         }
103     TMemberCopyFunction m_Main, m_Missing;
104 };
105 
106 typedef void (*TVariantReadFunction)(CObjectIStream& in,
107                                      const CVariantInfo* variantInfo,
108                                      TObjectPtr classPtr);
109 typedef void (*TVariantWriteFunction)(CObjectOStream& out,
110                                       const CVariantInfo* variantInfo,
111                                       TConstObjectPtr classPtr);
112 typedef void (*TVariantCopyFunction)(CObjectStreamCopier& copier,
113                                      const CVariantInfo* variantInfo);
114 typedef void (*TVariantSkipFunction)(CObjectIStream& in,
115                                      const CVariantInfo* variantInfo);
116 
117 /* @} */
118 
119 
120 END_NCBI_SCOPE
121 
122 #endif  /* HOOKFUNC__HPP */
123