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

Go to the SVN repository for this file.

1 #ifndef SERIALIMPL__HPP
2 #define SERIALIMPL__HPP
3 
4 /* $Id: serialimpl.hpp 99789 2023-05-10 17:56:44Z vasilche $
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 * File to be included in modules implementing GetTypeInfo methods.
33 *
34 */
35 
36 #include <corelib/ncbistd.hpp>
37 #include <corelib/ncbiobj.hpp>
38 #include <corelib/ncbimtx.hpp>
39 #include <serial/impl/stltypes.hpp>
46 
47 
48 /** @addtogroup GenClassSupport
49  *
50  * @{
51  */
52 
53 
54 struct valnode;
55 
57 
58 // forward declaration
59 class CMemberInfo;
60 class CClassTypeInfoBase;
61 class CClassTypeInfo;
62 class CChoiceTypeInfo;
63 class CDelayBufferData;
64 
65 //
66 // define type info getter for standard classes
67 template<typename T>
68 inline
70 {
72 }
73 
74 // some compilers cannot resolve overloading by
75 // (char* const*) and (const char* const*) in template
76 // so we'll add explicit implementations:
77 
78 inline
80 {
82 }
83 
84 inline
86 {
88 }
89 
90 
91 // macros used in ADD_*_MEMBER macros to specify complex type
92 // example: ADD_MEMBER(member, STL_set, (STD, (string)))
93 #define SERIAL_TYPE(TypeMacro) NCBI_NAME2(SERIAL_TYPE_,TypeMacro)
94 #define SERIAL_REF(TypeMacro) NCBI_NAME2(SERIAL_REF_,TypeMacro)
95 
96 #define SERIAL_TYPE_CLASS(ClassName) ClassName
97 #define SERIAL_REF_CLASS(ClassName) &ClassName::GetTypeInfo
98 
99 #define SERIAL_TYPE_STD(CType) CType
100 #define SERIAL_REF_STD(CType) &NCBI_NS_NCBI::CStdTypeInfo<CType>::GetTypeInfo
101 
102 #define SERIAL_TYPE_StringStore() NCBI_NS_STD::string
103 #define SERIAL_REF_StringStore() \
104  &NCBI_NS_NCBI::CStdTypeInfo<string>::GetTypeInfoStringStore
105 
106 #define SERIAL_TYPE_null() bool
107 #define SERIAL_REF_null() \
108  &NCBI_NS_NCBI::CStdTypeInfo<bool>::GetTypeInfoNullBool
109 
110 #define SERIAL_TYPE_CStringUTF8() NCBI_NS_NCBI::CStringUTF8
111 #define SERIAL_REF_CStringUTF8() \
112  &NCBI_NS_NCBI::CStdTypeInfo<NCBI_NS_NCBI::utf8_string_type>::GetTypeInfo
113 
114 #define SERIAL_TYPE_BigInt() Int8
115 #define SERIAL_REF_BigInt() \
116  &NCBI_NS_NCBI::CStdTypeInfo<NCBI_NS_NCBI::bigint_type>::GetTypeInfo
117 
118 #define SERIAL_TYPE_ENUM(CType, EnumName) CType
119 #define SERIAL_REF_ENUM(CType, EnumName) \
120  NCBI_NS_NCBI::CreateEnumeratedTypeInfo(CType(0), ENUM_METHOD_NAME(EnumName)())
121 
122 #define SERIAL_TYPE_ENUM_IN(CType, CppContext, EnumName) CppContext CType
123 #define SERIAL_REF_ENUM_IN(CType, CppContext, EnumName) \
124  NCBI_NS_NCBI::CreateEnumeratedTypeInfo(CppContext CType(0), CppContext ENUM_METHOD_NAME(EnumName)())
125 
126 #define SERIAL_TYPE_POINTER(TypeMacro,TypeMacroArgs) \
127  SERIAL_TYPE(TypeMacro)TypeMacroArgs*
128 #define SERIAL_REF_POINTER(TypeMacro,TypeMacroArgs) \
129  &NCBI_NS_NCBI::CPointerTypeInfo::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
130 
131 #define SERIAL_TYPE_STL_multiset(TypeMacro,TypeMacroArgs) \
132  NCBI_NS_STD::multiset<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
133 #define SERIAL_REF_STL_multiset(TypeMacro,TypeMacroArgs) \
134  &NCBI_NS_NCBI::CStlClassInfo_multiset<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
135 
136 #define SERIAL_TYPE_STL_set(TypeMacro,TypeMacroArgs) \
137  NCBI_NS_STD::set<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
138 #define SERIAL_REF_STL_set(TypeMacro,TypeMacroArgs) \
139  &NCBI_NS_NCBI::CStlClassInfo_set<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
140 
141 #define SERIAL_TYPE_STL_multiset2(TypeMacro,TypeMacroArgs,ComparatorType) \
142  NCBI_NS_STD::multiset<SERIAL_TYPE(TypeMacro)TypeMacroArgs, ComparatorType >
143 #define SERIAL_REF_STL_multiset2(TypeMacro,TypeMacroArgs,ComparatorType) \
144  &NCBI_NS_NCBI::CStlClassInfo_multiset2<SERIAL_TYPE(TypeMacro)TypeMacroArgs,ComparatorType >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
145 
146 #define SERIAL_TYPE_STL_set2(TypeMacro,TypeMacroArgs,ComparatorType) \
147  NCBI_NS_STD::set<SERIAL_TYPE(TypeMacro)TypeMacroArgs,ComparatorType >
148 #define SERIAL_REF_STL_set2(TypeMacro,TypeMacroArgs,ComparatorType) \
149  &NCBI_NS_NCBI::CStlClassInfo_set2<SERIAL_TYPE(TypeMacro)TypeMacroArgs,ComparatorType >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
150 
151 #define SERIAL_TYPE_STL_multimap(KeyTypeMacro,KeyTypeMacroArgs,ValueTypeMacro,ValueTypeMacroArgs) \
152  NCBI_NS_STD::multimap<SERIAL_TYPE(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_TYPE(ValueTypeMacro)ValueTypeMacroArgs >
153 #define SERIAL_REF_STL_multimap(KeyTypeMacro,KeyTypeMacroArgs,ValueTypeMacro,ValueTypeMacroArgs) \
154  CTypeRef(&NCBI_NS_NCBI::CStlClassInfo_multimap<SERIAL_TYPE(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_TYPE(ValueTypeMacro)ValueTypeMacroArgs >::GetTypeInfo, SERIAL_REF(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_REF(ValueTypeMacro)ValueTypeMacroArgs)
155 
156 #define SERIAL_TYPE_STL_map(KeyTypeMacro,KeyTypeMacroArgs,ValueTypeMacro,ValueTypeMacroArgs) \
157  NCBI_NS_STD::map<SERIAL_TYPE(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_TYPE(ValueTypeMacro)ValueTypeMacroArgs >
158 #define SERIAL_REF_STL_map(KeyTypeMacro,KeyTypeMacroArgs,ValueTypeMacro,ValueTypeMacroArgs) \
159  CTypeRef(&NCBI_NS_NCBI::CStlClassInfo_map<SERIAL_TYPE(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_TYPE(ValueTypeMacro)ValueTypeMacroArgs >::GetTypeInfo, SERIAL_REF(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_REF(ValueTypeMacro)ValueTypeMacroArgs)
160 
161 #define SERIAL_TYPE_STL_multimap3(KeyTypeMacro,KeyTypeMacroArgs,ValueTypeMacro,ValueTypeMacroArgs,ComparatorType) \
162  NCBI_NS_STD::multimap<SERIAL_TYPE(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_TYPE(ValueTypeMacro)ValueTypeMacroArgs, ComparatorType >
163 #define SERIAL_REF_STL_multimap3(KeyTypeMacro,KeyTypeMacroArgs,ValueTypeMacro,ValueTypeMacroArgs,ComparatorType) \
164  CTypeRef(NCBI_NS_NCBI::CStlClassInfo_multimap3<SERIAL_TYPE(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_TYPE(ValueTypeMacro)ValueTypeMacroArgs,ComparatorType >::GetTypeInfo, SERIAL_REF(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_REF(ValueTypeMacro)ValueTypeMacroArgs)
165 
166 #define SERIAL_TYPE_STL_map3(KeyTypeMacro,KeyTypeMacroArgs,ValueTypeMacro,ValueTypeMacroArgs,ComparatorType) \
167  NCBI_NS_STD::map<SERIAL_TYPE(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_TYPE(ValueTypeMacro)ValueTypeMacroArgs, ComparatorType >
168 #define SERIAL_REF_STL_map3(KeyTypeMacro,KeyTypeMacroArgs,ValueTypeMacro,ValueTypeMacroArgs,ComparatorType) \
169  CTypeRef(NCBI_NS_NCBI::CStlClassInfo_map3<SERIAL_TYPE(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_TYPE(ValueTypeMacro)ValueTypeMacroArgs,ComparatorType >::GetTypeInfo, SERIAL_REF(KeyTypeMacro)KeyTypeMacroArgs,SERIAL_REF(ValueTypeMacro)ValueTypeMacroArgs)
170 
171 #define SERIAL_TYPE_STL_list(TypeMacro,TypeMacroArgs) \
172  NCBI_NS_STD::list<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
173 #define SERIAL_REF_STL_list(TypeMacro,TypeMacroArgs) \
174  &NCBI_NS_NCBI::CStlClassInfo_list<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
175 
176 #define SERIAL_TYPE_STL_list_set(TypeMacro,TypeMacroArgs) \
177  NCBI_NS_STD::list<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
178 #define SERIAL_REF_STL_list_set(TypeMacro,TypeMacroArgs) \
179  &NCBI_NS_NCBI::CStlClassInfo_list<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetSetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
180 
181 #define SERIAL_TYPE_STL_vector(TypeMacro,TypeMacroArgs) \
182  NCBI_NS_STD::vector<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
183 #define SERIAL_REF_STL_vector(TypeMacro,TypeMacroArgs) \
184  &NCBI_NS_NCBI::CStlClassInfo_vector<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
185 
186 #define SERIAL_TYPE_STL_vector_set(TypeMacro,TypeMacroArgs) \
187  NCBI_NS_STD::vector<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
188 #define SERIAL_REF_STL_vector_set(TypeMacro,TypeMacroArgs) \
189  &NCBI_NS_NCBI::CStlClassInfo_vector<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetSetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
190 
191 #define SERIAL_TYPE_STL_CHAR_vector(CharType) NCBI_NS_STD::vector<CharType>
192 #define SERIAL_REF_STL_CHAR_vector(CharType) \
193  &NCBI_NS_NCBI::CStdTypeInfo< SERIAL_TYPE(STL_CHAR_vector)(CharType) >::GetTypeInfo
194 
195 #define SERIAL_TYPE_STL_auto_ptr(TypeMacro,TypeMacroArgs) \
196  NCBI_NS_STD::shared_ptr<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
197 #define SERIAL_REF_STL_auto_ptr(TypeMacro,TypeMacroArgs) \
198  &NCBI_NS_NCBI::CStlClassInfo_auto_ptr<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
199 
200 #define SERIAL_TYPE_STL_AutoPtr(TypeMacro,TypeMacroArgs) \
201  NCBI_NS_NCBI::AutoPtr<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
202 #define SERIAL_REF_STL_AutoPtr(TypeMacro,TypeMacroArgs) \
203  &NCBI_NS_NCBI::CAutoPtrTypeInfo<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
204 
205 #define SERIAL_TYPE_STL_CRef(TypeMacro,TypeMacroArgs) \
206  NCBI_NS_NCBI::CRef<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
207 #define SERIAL_REF_STL_CRef(TypeMacro,TypeMacroArgs) \
208  &NCBI_NS_NCBI::CRefTypeInfo<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
209 
210 #define SERIAL_TYPE_STL_CConstRef(TypeMacro,TypeMacroArgs) \
211  NCBI_NS_NCBI::CConstRef<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
212 #define SERIAL_REF_STL_CConstRef(TypeMacro,TypeMacroArgs) \
213  &NCBI_NS_NCBI::CConstRefTypeInfo<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::GetTypeInfo, SERIAL_REF(TypeMacro)TypeMacroArgs
214 
215 #define SERIAL_TYPE_CHOICE(TypeMacro,TypeMacroArgs) \
216  SERIAL_TYPE(TypeMacro)TypeMacroArgs
217 #define SERIAL_REF_CHOICE(TypeMacro,TypeMacroArgs) \
218  &NCBI_NS_NCBI::CChoicePointerTypeInfo::GetTypeInfo, \
219  SERIAL_REF(TypeMacro)TypeMacroArgs
220 
221 //#define SERIAL_TYPE_CHOICERef(ClassName) NCBI_NS_NCBI::CRef<ClassName>
222 //#define SERIAL_REF_CHOICERef(ClassName) &ClassName::GetChoiceRefTypeInfo
223 #define SERIAL_TYPE_CHOICERef(TypeMacro,TypeMacroArgs) \
224  NCBI_NS_NCBI::CRef<SERIAL_TYPE(TypeMacro)TypeMacroArgs >
225 #define SERIAL_REF_CHOICERef(TypeMacro,TypeMacroArgs) \
226  &NCBI_NS_NCBI::CChoicePointerTypeInfo::GetTypeInfo, \
227  SERIAL_REF(TypeMacro)TypeMacroArgs
228 
229 
230 template<typename T>
231 struct Check
232 {
233  static const void* Ptr(const T* member)
234  {
235  return member;
236  }
237  static const void* PtrPtr(T*const* member)
238  {
239  return member;
240  }
241  static const void* ObjectPtrPtr(T*const* member)
242  {
243  return member;
244  }
245  static const void* ObjectPtrPtr(CSerialObject*const* member)
246  {
247  return member;
248  }
249 private:
250  Check(void);
251  ~Check(void);
252  Check(const Check<T>&);
254 };
255 
256 
257 // Functions preventing memory leaks due to undestroyed type info objects
260 
262 void RegisterTypeInfoObject(CTypeInfo* object);
263 
264 template<typename T>
265 inline
266 TTypeInfo EnumTypeInfo(const T* member, const CEnumeratedTypeValues* enumInfo)
267 {
268  return CreateEnumeratedTypeInfo(*member, enumInfo);
269 }
270 
271 NCBI_XSERIAL_EXPORT SSystemMutex& GetTypeInfoMutex(void);
273 #if 0
274 #define XSERIAL_TYPEINFO_WRITELOCK NCBI_NS_NCBI::CWriteLockGuard GUARD(NCBI_NS_NCBI::GetTypeInfoLock())
275 #define XSERIAL_TYPEINFO_READLOCK NCBI_NS_NCBI::CReadLockGuard GUARD(NCBI_NS_NCBI::GetTypeInfoLock())
276 #else
277 #define XSERIAL_TYPEINFO_WRITELOCK NCBI_NS_NCBI::CMutexGuard GUARD(NCBI_NS_NCBI::GetTypeInfoMutex())
278 #define XSERIAL_TYPEINFO_READLOCK NCBI_NS_NCBI::CMutexGuard GUARD(NCBI_NS_NCBI::GetTypeInfoMutex())
279 #endif
280 
281 // internal macros for implementing BEGIN_*_INFO and ADD_*_MEMBER
282 #define DECLARE_BASE_OBJECT(ClassName) ClassName* base = 0
283 #define BASE_OBJECT() static_cast<const CClass_Base*>(base)
284 #define MEMBER_PTR(MemberName) &BASE_OBJECT()->MemberName
285 #define CLASS_PTR(ClassName) static_cast<const ClassName*>(BASE_OBJECT())
286 
287 #define BEGIN_BASE_TYPE_INFO(ClassName,BaseClassName,Method,InfoType,Code) \
288 const NCBI_NS_NCBI::CTypeInfo* Method(void) \
289 { \
290  typedef ClassName CClass; \
291  typedef BaseClassName CClass_Base; \
292  static std::atomic<InfoType*> s_info; \
293  InfoType* info = s_info.load(std::memory_order_acquire); \
294  if ( !info ) { \
295  XSERIAL_TYPEINFO_WRITELOCK; \
296  info = s_info.load(std::memory_order_acquire); \
297  if ( !info ) { \
298  DECLARE_BASE_OBJECT(CClass); \
299  info = Code; \
300  NCBI_NS_NCBI::RegisterTypeInfoObject(info);
301 #define BEGIN_TYPE_INFO(ClassName, Method, InfoType, Code) \
302  BEGIN_BASE_TYPE_INFO(ClassName, ClassName, Method, InfoType, Code)
303 
304 #define END_TYPE_INFO \
305  s_info.store(info, std::memory_order_release); \
306  } \
307  } \
308  return info; \
309 }
310 
311 #define END_STRUCT_INFO \
312  info->AssignItemsTags(); \
313  END_TYPE_INFO
314 
315 
316 // macros for specifying differents members
317 #define SERIAL_MEMBER(MemberName,TypeMacro,TypeMacroArgs) \
318  NCBI_NS_NCBI::Check<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::Ptr(MEMBER_PTR(MemberName)), SERIAL_REF(TypeMacro)TypeMacroArgs
319 #define SERIAL_BUF_MEMBER(MemberName,TypeMacro,TypeMacroArgs) \
320  NCBI_NS_NCBI::Check<NCBI_NS_NCBI::CUnionBuffer<SERIAL_TYPE(TypeMacro)TypeMacroArgs > >::Ptr(MEMBER_PTR(MemberName)), SERIAL_REF(TypeMacro)TypeMacroArgs
321 #define SERIAL_STD_MEMBER(MemberName) \
322  MEMBER_PTR(MemberName),NCBI_NS_NCBI::GetStdTypeInfoGetter(MEMBER_PTR(MemberName))
323 #define SERIAL_CLASS_MEMBER(MemberName) \
324  MEMBER_PTR(MemberName),&MEMBER_PTR(MemberName).GetTypeInfo
325 #define SERIAL_ENUM_MEMBER(MemberName,EnumName) \
326  MEMBER_PTR(MemberName), NCBI_NS_NCBI::EnumTypeInfo(MEMBER_PTR(MemberName), ENUM_METHOD_NAME(EnumName)())
327 #define SERIAL_ENUM_IN_MEMBER(MemberName,CppContext,EnumName) \
328  MEMBER_PTR(MemberName), NCBI_NS_NCBI::EnumTypeInfo(MEMBER_PTR(MemberName),CppContext ENUM_METHOD_NAME(EnumName)())
329 #define SERIAL_REF_MEMBER(MemberName,ClassName) \
330  SERIAL_MEMBER(MemberName,STL_CRef,(CLASS,(ClassName)))
331 #define SERIAL_PTR_CHOICE_VARIANT(MemberName,TypeMacro,TypeMacroArgs) \
332  NCBI_NS_NCBI::Check<SERIAL_TYPE(TypeMacro)TypeMacroArgs >::PtrPtr(MEMBER_PTR(MemberName)), SERIAL_REF(TypeMacro)TypeMacroArgs
333 #define SERIAL_REF_CHOICE_VARIANT(MemberName,ClassName) \
334  NCBI_NS_NCBI::Check<SERIAL_TYPE(CLASS)(ClassName)>::ObjectPtrPtr(MEMBER_PTR(MemberName)), SERIAL_REF(CLASS)(ClassName)
335 #define SERIAL_BASE_CLASS(ClassName) \
336  CLASS_PTR(ClassName),&(CLASS_PTR(ClassName)->GetTypeInfo)
337 
338 // ADD_NAMED_*_MEMBER macros
339 #define ADD_NAMED_NULL_MEMBER(MemberAlias,TypeMacro,TypeMacroArgs) \
340  NCBI_NS_NCBI::AddMember(info,MemberAlias, \
341  BASE_OBJECT(),SERIAL_REF(TypeMacro)TypeMacroArgs)
342 #define ADD_NAMED_MEMBER(MemberAlias,MemberName,TypeMacro,TypeMacroArgs) \
343  NCBI_NS_NCBI::AddMember(info,MemberAlias, \
344  SERIAL_MEMBER(MemberName,TypeMacro,TypeMacroArgs))
345 #define ADD_NAMED_STD_MEMBER(MemberAlias,MemberName) \
346  NCBI_NS_NCBI::AddMember(info,MemberAlias, \
347  SERIAL_STD_MEMBER(MemberName))
348 #define ADD_NAMED_CLASS_MEMBER(MemberAlias,MemberName) \
349  NCBI_NS_NCBI::AddMember(info,MemberAlias, \
350  SERIAL_CLASS_MEMBER(MemberName))
351 #define ADD_NAMED_ENUM_MEMBER(MemberAlias,MemberName,EnumName) \
352  NCBI_NS_NCBI::AddMember(info,MemberAlias, \
353  SERIAL_ENUM_MEMBER(MemberName,EnumName))
354 #define ADD_NAMED_ENUM_IN_MEMBER(MemberAlias,MemberName,CppContext,EnumName) \
355  NCBI_NS_NCBI::AddMember(info,MemberAlias, \
356  SERIAL_ENUM_IN_MEMBER(MemberName,CppContext,EnumName))
357 #define ADD_NAMED_REF_MEMBER(MemberAlias,MemberName,ClassName) \
358  NCBI_NS_NCBI::AddMember(info,MemberAlias, \
359  SERIAL_REF_MEMBER(MemberName,ClassName))
360 #define ADD_NAMED_BASE_CLASS(MemberAlias,ClassName) \
361  NCBI_NS_NCBI::AddMember(info,MemberAlias, \
362  SERIAL_BASE_CLASS(ClassName))
363 
364 // ADD_*_MEMBER macros
365 #define ADD_MEMBER(MemberName,TypeMacro,TypeMacroArgs) \
366  ADD_NAMED_MEMBER(#MemberName,MemberName,TypeMacro,TypeMacroArgs)
367 #define ADD_STD_MEMBER(MemberName) \
368  ADD_NAMED_STD_MEMBER(#MemberName,MemberName)
369 #define ADD_CLASS_MEMBER(MemberName) \
370  ADD_NAMED_CLASS_MEMBER(#MemberName,MemberName)
371 #define ADD_ENUM_MEMBER(MemberName,EnumName) \
372  ADD_NAMED_ENUM_MEMBER(#MemberName,MemberName,EnumName)
373 #define ADD_ENUM_IN_MEMBER(MemberName,CppContext,EnumName) \
374  ADD_NAMED_ENUM_MEMBER(#MemberName,MemberName,CppContext,EnumName)
375 #define ADD_REF_MEMBER(MemberName,ClassName) \
376  ADD_NAMED_REF_MEMBER(#MemberName,MemberName,ClassName)
377 
378 // ADD_NAMED_*_CHOICE_VARIANT macros
379 #define ADD_NAMED_NULL_CHOICE_VARIANT(MemberAlias,TypeMacro,TypeMacroArgs) \
380  NCBI_NS_NCBI::AddVariant(info,MemberAlias, \
381  BASE_OBJECT(),SERIAL_REF(TypeMacro)TypeMacroArgs)
382 #define ADD_NAMED_CHOICE_VARIANT(MemberAlias,MemberName,TypeMacro,TypeMacroArgs) \
383  NCBI_NS_NCBI::AddVariant(info,MemberAlias, \
384  SERIAL_MEMBER(MemberName,TypeMacro,TypeMacroArgs))
385 #define ADD_NAMED_BUF_CHOICE_VARIANT(MemberAlias,MemberName,TypeMacro,TypeMacroArgs) \
386  NCBI_NS_NCBI::AddVariant(info,MemberAlias, \
387  SERIAL_BUF_MEMBER(MemberName,TypeMacro,TypeMacroArgs))
388 #define ADD_NAMED_STD_CHOICE_VARIANT(MemberAlias,MemberName) \
389  NCBI_NS_NCBI::AddVariant(info,MemberAlias, \
390  SERIAL_STD_MEMBER(MemberName))
391 #define ADD_NAMED_ENUM_CHOICE_VARIANT(MemberAlias,MemberName,EnumName) \
392  NCBI_NS_NCBI::AddVariant(info,MemberAlias, \
393  SERIAL_ENUM_MEMBER(MemberName,EnumName))
394 #define ADD_NAMED_ENUM_IN_CHOICE_VARIANT(MemberAlias,MemberName,CppContext,EnumName) \
395  NCBI_NS_NCBI::AddVariant(info,MemberAlias, \
396  SERIAL_ENUM_IN_MEMBER(MemberName,CppContext,EnumName))
397 #define ADD_NAMED_PTR_CHOICE_VARIANT(MemberAlias,MemberName,TypeMacro,TypeMacroArgs) \
398  NCBI_NS_NCBI::AddVariant(info,MemberAlias, \
399  SERIAL_PTR_CHOICE_VARIANT(MemberName,TypeMacro,TypeMacroArgs))->SetPointer()
400 #define ADD_NAMED_REF_CHOICE_VARIANT(MemberAlias,MemberName,ClassName) \
401  NCBI_NS_NCBI::AddVariant(info,MemberAlias, \
402  SERIAL_REF_CHOICE_VARIANT(MemberName,ClassName))->SetObjectPointer()
403 
404 // ADD_*_CHOICE_VARIANT macros
405 #define ADD_CHOICE_VARIANT(MemberName,TypeMacro,TypeMacroArgs) \
406  ADD_NAMED_CHOICE_VARIANT(#MemberName,MemberName,TypeMacro,TypeMacroArgs)
407 #define ADD_STD_CHOICE_VARIANT(MemberName) \
408  ADD_NAMED_STD_CHOICE_VARIANT(#MemberName,MemberName)
409 #define ADD_ENUM_CHOICE_VARIANT(MemberName,EnumName) \
410  ADD_NAMED_ENUM_CHOICE_VARIANT(#MemberName,MemberName,EnumName)
411 #define ADD_ENUM_IN_CHOICE_VARIANT(MemberName,CppContext,EnumName) \
412  ADD_NAMED_ENUM_IN_CHOICE_VARIANT(#MemberName,MemberName,CppContext,EnumName)
413 #define ADD_PTR_CHOICE_VARIANT(MemberName,TypeMacro,TypeMacroArgs) \
414  ADD_NAMED_PTR_CHOICE_VARIANT(#MemberName,MemberName,TypeMacro,TypeMacroArgs)
415 #define ADD_REF_CHOICE_VARIANT(MemberName,ClassName) \
416  ADD_NAMED_REF_CHOICE_VARIANT(#MemberName,MemberName,ClassName)
417 
418 // type info definition macros
419 #define BEGIN_NAMED_CLASS_INFO(ClassAlias,ClassName) \
420  BEGIN_TYPE_INFO(ClassName, \
421  ClassName::GetTypeInfo, \
422  NCBI_NS_NCBI::CClassTypeInfo, \
423  NCBI_NS_NCBI::CClassInfoHelper<CClass>::CreateClassInfo(ClassAlias))
424 #define BEGIN_CLASS_INFO(ClassName) \
425  BEGIN_NAMED_CLASS_INFO(#ClassName, ClassName)
426 #define BEGIN_NAMED_BASE_CLASS_INFO(ClassAlias,ClassName) \
427  BEGIN_BASE_TYPE_INFO(ClassName, NCBI_NAME2(ClassName,_Base), \
428  NCBI_NAME2(ClassName,_Base)::GetTypeInfo, \
429  NCBI_NS_NCBI::CClassTypeInfo, \
430  NCBI_NS_NCBI::CClassInfoHelper<CClass>::CreateClassInfo(ClassAlias))
431 #define BEGIN_BASE_CLASS_INFO(ClassName) \
432  BEGIN_NAMED_BASE_CLASS_INFO(#ClassName, ClassName)
433 
434 #define SET_CLASS_IMPLICIT() info->SetImplicit()
435 #define BEGIN_NAMED_IMPLICIT_CLASS_INFO(ClassAlias,ClassName) \
436  BEGIN_NAMED_CLASS_INFO(ClassAlias,ClassName); SET_CLASS_IMPLICIT();
437 #define BEGIN_IMPLICIT_CLASS_INFO(ClassName) \
438  BEGIN_CLASS_INFO(ClassName); SET_CLASS_IMPLICIT();
439 #define BEGIN_NAMED_BASE_IMPLICIT_CLASS_INFO(ClassAlias,ClassName) \
440  BEGIN_NAMED_BASE_CLASS_INFO(ClassAlias,ClassName); SET_CLASS_IMPLICIT();
441 #define BEGIN_BASE_IMPLICIT_CLASS_INFO(ClassName) \
442  BEGIN_BASE_CLASS_INFO(ClassName); SET_CLASS_IMPLICIT();
443 
444 #define SET_CLASS_MODULE(ModuleName) \
445  NCBI_NS_NCBI::SetModuleName(info, ModuleName)
446 
447 #define SET_INTERNAL_NAME(OwnerName, MemberName) \
448  NCBI_NS_NCBI::SetInternalName(info, OwnerName, MemberName)
449 
450 #define SET_NAMESPACE(name) \
451  info->SetNamespaceName(name)
452 
453 #define SET_ASN_TAGGED_TYPE_INFO(method, args) \
454  info->method args
455 
456 #define END_CLASS_INFO \
457  NCBI_NS_NCBI::CClassInfoHelper<CClass>::SetReadWriteMemberMethods(info); \
458  END_STRUCT_INFO
459 
460 #define BEGIN_NAMED_ABSTRACT_CLASS_INFO(ClassAlias,ClassName) \
461  BEGIN_TYPE_INFO(ClassName, \
462  ClassName::GetTypeInfo, \
463  NCBI_NS_NCBI::CClassTypeInfo, \
464  NCBI_NS_NCBI::CClassInfoHelper<CClass>::CreateAbstractClassInfo(ClassAlias))
465 #define BEGIN_ABSTRACT_CLASS_INFO(ClassName) \
466  BEGIN_NAMED_ABSTRACT_CLASS_INFO(#ClassName, ClassName)
467 #define BEGIN_NAMED_ABSTRACT_BASE_CLASS_INFO(ClassAlias,ClassName) \
468  BEGIN_BASE_TYPE_INFO(ClassName, NCBI_NAME2(ClassName,_Base), \
469  NCBI_NAME2(ClassName,_Base)::GetTypeInfo, \
470  NCBI_NS_NCBI::CClassTypeInfo, \
471  NCBI_NS_NCBI::CClassInfoHelper<CClass>::CreateAbstractClassInfo(ClassAlias))
472 
473 #define END_ABSTRACT_CLASS_INFO \
474  END_STRUCT_INFO
475 
476 #define BEGIN_NAMED_DERIVED_CLASS_INFO(ClassAlias,ClassName,ParentClassName) \
477  BEGIN_NAMED_CLASS_INFO(ClassAlias,ClassName) \
478  SET_PARENT_CLASS(ParentClassName);
479 #define BEGIN_DERIVED_CLASS_INFO(ClassName,ParentClassName) \
480  BEGIN_NAMED_DERIVED_CLASS_INFO(#ClassName, ClassName, ParentClassName)
481 
482 #define END_DERIVED_CLASS_INFO \
483  END_STRUCT_INFO
484 
485 #define BEGIN_NAMED_CHOICE_INFO(ClassAlias,ClassName) \
486  BEGIN_TYPE_INFO(ClassName, \
487  ClassName::GetTypeInfo, \
488  NCBI_NS_NCBI::CChoiceTypeInfo, \
489  NCBI_NS_NCBI::CClassInfoHelper<CClass>::CreateChoiceInfo(ClassAlias))
490 #define BEGIN_CHOICE_INFO(ClassName) \
491  BEGIN_NAMED_CHOICE_INFO(#ClassName, ClassName)
492 #define BEGIN_NAMED_BASE_CHOICE_INFO(ClassAlias,ClassName) \
493  BEGIN_BASE_TYPE_INFO(ClassName, NCBI_NAME2(ClassName,_Base), \
494  NCBI_NAME2(ClassName,_Base)::GetTypeInfo, \
495  NCBI_NS_NCBI::CChoiceTypeInfo, \
496  NCBI_NS_NCBI::CClassInfoHelper<CClass>::CreateChoiceInfo(ClassAlias))
497 #define BEGIN_BASE_CHOICE_INFO(ClassName) \
498  BEGIN_NAMED_BASE_CHOICE_INFO(#ClassName, ClassName)
499 
500 #define SET_CHOICE_MODULE(ModuleName) \
501  NCBI_NS_NCBI::SetModuleName(info, ModuleName)
502 
503 #define SET_CHOICE_DELAYED() \
504  info->SetSelectDelay(&NCBI_NS_NCBI::CClassInfoHelper<CClass>::SelectDelayBuffer)
505 
506 #define END_CHOICE_INFO \
507  NCBI_NS_NCBI::CClassInfoHelper<CClass>::SetReadWriteVariantMethods(info); \
508  info->SetSelectorInfo(MEMBER_PTR(m_choice), sizeof(BASE_OBJECT()->m_choice)); \
509  END_STRUCT_INFO
510 
511 // sub class definition
512 #define SET_PARENT_CLASS(ParentClassName) \
513  info->SetParentClass(ParentClassName::GetTypeInfo())
514 #define ADD_NAMED_SUB_CLASS(SubClassAlias, SubClassName) \
515  info->AddSubClass(SubClassAlias, &SubClassName::GetTypeInfo)
516 #define ADD_SUB_CLASS(SubClassName) \
517  ADD_NAMED_SUB_CLASS(#SubClassName, SubClassName)
518 #define ADD_NAMED_NULL_SUB_CLASS(ClassAlias) \
519  info->AddSubClassNull(ClassAlias)
520 #define ADD_NULL_SUB_CLASS(ClassAlias) \
521  ADD_NAMED_NULL_SUB_CLASS("NULL")
522 
523 // enum definition macros
524 #define BEGIN_ENUM_INFO_METHOD(MethodName, EnumAlias, EnumName, IsInteger) \
525 const NCBI_NS_NCBI::CEnumeratedTypeValues* MethodName(void) \
526 { \
527  static NCBI_NS_NCBI::CEnumeratedTypeValues* volatile s_enumInfo = 0; \
528  NCBI_NS_NCBI::CEnumeratedTypeValues* enumInfo = s_enumInfo; \
529  if ( !enumInfo ) { \
530  XSERIAL_TYPEINFO_WRITELOCK; \
531  enumInfo = s_enumInfo; \
532  if ( !enumInfo ) { \
533  enumInfo = new NCBI_NS_NCBI::CEnumeratedTypeValues(EnumAlias, IsInteger); \
534  NCBI_NS_NCBI::RegisterEnumTypeValuesObject(enumInfo); \
535  EnumName enumValue;
536 #define END_ENUM_INFO_METHOD \
537  s_enumInfo = enumInfo; \
538  } \
539  } \
540  return enumInfo; \
541 }
542 
543 #define BEGIN_NAMED_ENUM_IN_INFO(EnumAlias, CppContext, EnumName, IsInteger) \
544  BEGIN_ENUM_INFO_METHOD(CppContext ENUM_METHOD_NAME(EnumName), EnumAlias, EnumName, IsInteger)
545 #define BEGIN_NAMED_ENUM_INFO(EnumAlias, EnumName, IsInteger) \
546  BEGIN_ENUM_INFO_METHOD(ENUM_METHOD_NAME(EnumName), EnumAlias, EnumName, IsInteger)
547 
548 #define BEGIN_ENUM_IN_INFO(CppContext, EnumName, IsInteger) \
549  BEGIN_NAMED_ENUM_IN_INFO(#EnumName, CppContext, EnumName, IsInteger)
550 #define BEGIN_ENUM_INFO(EnumName, IsInteger) \
551  BEGIN_NAMED_ENUM_INFO(#EnumName, EnumName, IsInteger)
552 
553 #define SET_ENUM_MODULE(ModuleName) \
554  NCBI_NS_NCBI::SetModuleName(enumInfo, ModuleName)
555 
556 #define SET_ENUM_BITSET \
557  enumInfo->SetBitset()
558 
559 #define SET_ENUM_INTERNAL_NAME(OwnerName, MemberName) \
560  NCBI_NS_NCBI::SetInternalName(enumInfo, OwnerName, MemberName)
561 
562 #define ADD_ENUM_VALUE(EnumValueName, EnumValueValue) \
563  enumInfo->AddValue(EnumValueName, enumValue = EnumValueValue)
564 
565 #define ADD_ENUM_VALUE_FLAGS(EnumValueName, EnumValueValue, EnumValueFlags) \
566  enumInfo->AddValue(EnumValueName, enumValue = EnumValueValue, EnumValueFlags)
567 
568 #define END_ENUM_IN_INFO END_ENUM_INFO_METHOD
569 #define END_ENUM_INFO END_ENUM_INFO_METHOD
570 
571 // alias definition macros
572 #define SERIAL_ALIAS(RefType) \
573  NCBI_NAME2(SERIAL_REF_, RefType)
574 #define ALIASED_TYPE_INFO(RefType, RefCode) \
575  NCBI_NAME2(RefType, RefCode)
576 #define BEGIN_ALIAS_INFO_METHOD(AliasName,ClassName,BaseClassName,SerialRef,Code) \
577 const NCBI_NS_NCBI::CTypeInfo* BaseClassName::GetTypeInfo(void) \
578 { \
579  static std::atomic<NCBI_NS_NCBI::CAliasTypeInfo*> s_info; \
580  NCBI_NS_NCBI::CAliasTypeInfo* info = s_info.load(std::memory_order_acquire); \
581  if ( !info ) { \
582  XSERIAL_TYPEINFO_WRITELOCK; \
583  info = s_info.load(std::memory_order_acquire); \
584  if ( !info ) { \
585  typedef ClassName CClass; \
586  typedef BaseClassName CClass_Base; \
587  DECLARE_BASE_OBJECT(CClass); \
588  typedef NCBI_NS_NCBI::TTypeInfo (*TGetter)(void); \
589  TGetter getter = SerialRef Code; \
590  info = new NCBI_NS_NCBI::CAliasTypeInfo(AliasName, getter()); \
591  NCBI_NS_NCBI::RegisterTypeInfoObject(info);
592 #define BEGIN_ALIAS_INFO(AliasName,ClassName,RefType,RefCode) \
593  BEGIN_ALIAS_INFO_METHOD(AliasName, ClassName, \
594  NCBI_NAME2(ClassName,_Base), \
595  SERIAL_ALIAS(RefType), RefCode)
596 
597 #define BEGIN_NESTED_ALIAS_INFO(AliasName,ClassName,RefType,RefCode) \
598  BEGIN_ALIAS_INFO_METHOD(AliasName, ClassName, \
599  ClassName, \
600  SERIAL_ALIAS(RefType), RefCode)
601 
602 #define BEGIN_ENUM_ALIAS_INFO_METHOD(AliasName,ClassName,BaseClassName,SerialRef,Code) \
603 const NCBI_NS_NCBI::CTypeInfo* BaseClassName::GetTypeInfo(void) \
604 { \
605  static std::atomic<NCBI_NS_NCBI::CAliasTypeInfo*> s_info; \
606  NCBI_NS_NCBI::CAliasTypeInfo* info = s_info.load(std::memory_order_acquire); \
607  if ( !info ) { \
608  XSERIAL_TYPEINFO_WRITELOCK; \
609  info = s_info.load(std::memory_order_acquire); \
610  if ( !info ) { \
611  typedef ClassName CClass; \
612  typedef BaseClassName CClass_Base; \
613  DECLARE_BASE_OBJECT(CClass); \
614  info = new NCBI_NS_NCBI::CAliasTypeInfo(AliasName, SerialRef Code); \
615  NCBI_NS_NCBI::RegisterTypeInfoObject(info);
616 #define BEGIN_ENUM_ALIAS_INFO(AliasName,ClassName,RefType,RefCode) \
617  BEGIN_ENUM_ALIAS_INFO_METHOD(AliasName, ClassName, \
618  NCBI_NAME2(ClassName,_Base), \
619  SERIAL_ALIAS(RefType), RefCode)
620 
621 #define BEGIN_NESTED_ENUM_ALIAS_INFO(AliasName,ClassName,RefType,RefCode) \
622  BEGIN_ENUM_ALIAS_INFO_METHOD(AliasName, ClassName, \
623  ClassName, \
624  SERIAL_ALIAS(RefType), RefCode)
625 
626 #define SET_STD_ALIAS_DATA_PTR \
627  info->SetDataOffset(NCBI_NS_NCBI::TPointerOffsetType(GetDataPtr(BASE_OBJECT())))
628 #define SET_CLASS_ALIAS_DATA_PTR \
629  info->SetDataOffset(NCBI_NS_NCBI::TPointerOffsetType(BASE_OBJECT())); \
630  info->SetCreateFunction(NCBI_NS_NCBI::CClassInfoHelper<CClass>::Create)
631 #define END_ALIAS_INFO \
632  s_info.store(info, std::memory_order_release); \
633  } \
634  } \
635  return info; \
636 }
637 #define SET_ALIAS_MODULE(ModuleName) \
638  NCBI_NS_NCBI::SetModuleName(info, ModuleName)
639 
640 #define SET_FULL_ALIAS info->SetFullAlias()
641 
642 
644 void SetModuleName(CTypeInfo* info, const char* name);
645 
647 void SetModuleName(CEnumeratedTypeValues* info, const char* name);
648 
651  const char* owner_name, const char* member_name = 0);
652 
655  const char* owner_name, const char* member_name = 0);
656 
657 // internal methods
658 // add member
660 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
661  const void* member,
662  TTypeInfo t);
664 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
665  const void* member,
668 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
669  const void* member,
670  const CTypeRef& r);
672 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
673  const void* member,
674  TTypeInfoGetter1 f1,
675  TTypeInfo t);
677 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
678  const void* member,
679  TTypeInfoGetter1 f1,
682 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
683  const void* member,
684  TTypeInfoGetter1 f1,
685  const CTypeRef& r);
687 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
688  const void* member,
689  TTypeInfoGetter1 f2,
690  TTypeInfoGetter1 f1,
691  TTypeInfo t);
693 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
694  const void* member,
695  TTypeInfoGetter1 f2,
696  TTypeInfoGetter1 f1,
699 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
700  const void* member,
701  TTypeInfoGetter1 f2,
702  TTypeInfoGetter1 f1,
703  const CTypeRef& r);
705 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
706  const void* member,
707  TTypeInfoGetter1 f3,
708  TTypeInfoGetter1 f2,
709  TTypeInfoGetter1 f1,
710  TTypeInfo t);
712 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
713  const void* member,
714  TTypeInfoGetter1 f3,
715  TTypeInfoGetter1 f2,
716  TTypeInfoGetter1 f1,
719 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
720  const void* member,
721  TTypeInfoGetter1 f3,
722  TTypeInfoGetter1 f2,
723  TTypeInfoGetter1 f1,
724  const CTypeRef& r);
726 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
727  const void* member,
728  TTypeInfoGetter1 f4,
729  TTypeInfoGetter1 f3,
730  TTypeInfoGetter1 f2,
731  TTypeInfoGetter1 f1,
732  TTypeInfo t);
734 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
735  const void* member,
736  TTypeInfoGetter1 f4,
737  TTypeInfoGetter1 f3,
738  TTypeInfoGetter1 f2,
739  TTypeInfoGetter1 f1,
742 CMemberInfo* AddMember(CClassTypeInfoBase* info, const char* name,
743  const void* member,
744  TTypeInfoGetter1 f4,
745  TTypeInfoGetter1 f3,
746  TTypeInfoGetter1 f2,
747  TTypeInfoGetter1 f1,
748  const CTypeRef& r);
749 // add variant
751 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
752  const void* member,
753  TTypeInfo t);
755 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
756  const void* member,
759 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
760  const void* member,
761  const CTypeRef& r);
763 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
764  const void* member,
765  TTypeInfoGetter1 f1,
766  TTypeInfo t);
768 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
769  const void* member,
770  TTypeInfoGetter1 f1,
773 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
774  const void* member,
775  TTypeInfoGetter1 f1,
776  const CTypeRef& r);
778 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
779  const void* member,
780  TTypeInfoGetter1 f2,
781  TTypeInfoGetter1 f1,
782  TTypeInfo t);
784 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
785  const void* member,
786  TTypeInfoGetter1 f2,
787  TTypeInfoGetter1 f1,
790 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
791  const void* member,
792  TTypeInfoGetter1 f2,
793  TTypeInfoGetter1 f1,
794  const CTypeRef& r);
796 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
797  const void* member,
798  TTypeInfoGetter1 f3,
799  TTypeInfoGetter1 f2,
800  TTypeInfoGetter1 f1,
801  TTypeInfo t);
803 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
804  const void* member,
805  TTypeInfoGetter1 f3,
806  TTypeInfoGetter1 f2,
807  TTypeInfoGetter1 f1,
810 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
811  const void* member,
812  TTypeInfoGetter1 f3,
813  TTypeInfoGetter1 f2,
814  TTypeInfoGetter1 f1,
815  const CTypeRef& r);
817 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
818  const void* member,
819  TTypeInfoGetter1 f4,
820  TTypeInfoGetter1 f3,
821  TTypeInfoGetter1 f2,
822  TTypeInfoGetter1 f1,
823  TTypeInfo t);
825 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
826  const void* member,
827  TTypeInfoGetter1 f4,
828  TTypeInfoGetter1 f3,
829  TTypeInfoGetter1 f2,
830  TTypeInfoGetter1 f1,
833 CVariantInfo* AddVariant(CChoiceTypeInfo* info, const char* name,
834  const void* member,
835  TTypeInfoGetter1 f4,
836  TTypeInfoGetter1 f3,
837  TTypeInfoGetter1 f2,
838  TTypeInfoGetter1 f1,
839  const CTypeRef& r);
840 // end of internal methods
841 
843 
844 
845 /* @} */
846 
847 
848 #endif
CRWLock –.
Definition: ncbimtx.hpp:953
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Definition: typeinfo.hpp:76
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define T(s)
Definition: common.h:230
CMemberInfo * AddMember(CClassTypeInfoBase *info, const char *name, const void *member, TTypeInfo t)
Definition: serial.cpp:135
static const void * ObjectPtrPtr(T *const *member)
Definition: serialimpl.hpp:241
SSystemMutex & GetTypeInfoMutex(void)
Definition: typeinfo.cpp:49
static const void * ObjectPtrPtr(CSerialObject *const *member)
Definition: serialimpl.hpp:245
CVariantInfo * AddVariant(CChoiceTypeInfo *info, const char *name, const void *member, TTypeInfo t)
Definition: serial.cpp:265
TTypeInfo(* TTypeInfoGetter)(void)
Definition: serialdef.hpp:63
void RegisterEnumTypeValuesObject(CEnumeratedTypeValues *object)
Definition: serial.cpp:556
TTypeInfo(* TTypeInfoGetter1)(TTypeInfo)
Definition: serialdef.hpp:64
~Check(void)
void SetModuleName(CTypeInfo *info, const char *name)
Definition: serial.cpp:96
TTypeInfoGetter GetStdTypeInfoGetter(const T *)
Definition: serialimpl.hpp:69
static const void * Ptr(const T *member)
Definition: serialimpl.hpp:233
void RegisterTypeInfoObject(CTypeInfo *object)
Definition: serial.cpp:569
Check(const Check< T > &)
static const void * PtrPtr(T *const *member)
Definition: serialimpl.hpp:237
Check(void)
CRWLock & GetTypeInfoLock(void)
Definition: typeinfo.cpp:53
void SetInternalName(CTypeInfo *info, const char *owner_name, const char *member_name=0)
Definition: serial.cpp:106
TTypeInfo EnumTypeInfo(const T *member, const CEnumeratedTypeValues *enumInfo)
Definition: serialimpl.hpp:266
Check< T > & operator=(const Check< T > &)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
CEnumeratedTypeInfo * CreateEnumeratedTypeInfo(const T &, const CEnumeratedTypeValues *values)
Definition: enumerated.hpp:103
#define NCBI_XSERIAL_EXPORT
Definition: ncbi_export.h:1435
static MDB_envinfo info
Definition: mdb_load.c:37
EIPRangeType t
Definition: ncbi_localip.c:101
Multi-threading – mutexes; rw-locks; semaphore.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
Modified on Sun Apr 14 05:28:41 2024 by modify_doxy.py rev. 669887