NCBI C++ ToolKit
typeinfo.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: typeinfo.cpp 99787 2023-05-10 17:54:36Z vasilche $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Eugene Vasilchenko
27 *
28 * File Description:
29 * !!! PUT YOUR DESCRIPTION HERE !!!
30 *
31 * ===========================================================================
32 */
33 
34 #include <ncbi_pch.hpp>
35 #include <corelib/ncbithr.hpp>
36 #include <serial/typeinfo.hpp>
38 #include <serial/objistr.hpp>
39 #include <serial/objostr.hpp>
40 #include <serial/objcopy.hpp>
41 #include <serial/serialimpl.hpp>
42 #include <corelib/ncbimtx.hpp>
43 
45 
46 /* put back inside GetTypeInfoMutex when Mac CodeWarrior 9 comes out */
47 DEFINE_STATIC_MUTEX(s_TypeInfoMutex);
48 
49 SSystemMutex& GetTypeInfoMutex(void)
50 {
51  return s_TypeInfoMutex;
52 }
54 {
55  static CRWLock s_TypeInfoLock;
56  return s_TypeInfoLock;
57 }
58 
59 
61 {
62 public:
63  static void ReadWithHook(CObjectIStream& in,
64  TTypeInfo objectType, TObjectPtr objectPtr);
65  static void WriteWithHook(CObjectOStream& out,
66  TTypeInfo objectType, TConstObjectPtr objectPtr);
67  static void SkipWithHook(CObjectIStream& stream,
68  TTypeInfo objectType);
69  static void CopyWithHook(CObjectStreamCopier& copier,
70  TTypeInfo objectType);
71 };
72 
74 {
75 public:
76  CNamespaceInfoItem(void);
78  virtual ~CNamespaceInfoItem(void);
79 
80  bool HasNamespaceName(void) const;
81  const string& GetNamespaceName(void) const;
82  void SetNamespaceName(const string& ns_name);
83 
84  bool HasNamespacePrefix(void) const;
85  const string& GetNamespacePrefix(void) const;
86  void SetNamespacePrefix(const string& ns_prefix);
87 
89  void SetNsQualified(bool qualified);
90 
91 private:
92  string m_NsName;
93  string m_NsPrefix;
96 };
97 
99 
101  : m_TypeFamily(typeFamily), m_Size(size), m_Name(),
102  m_InfoItem(0),
103  m_CodeVer(0),
104  m_DataSpec(EDataSpec::eUnknown),
105  m_IsCObject(false),
106  m_IsInternal(false),
107  m_Tag(eNoExplicitTag), m_TagClass(CAsnBinaryDefs::eUniversal),
108  m_TagType(CAsnBinaryDefs::eAutomatic),
109  m_TagConstructed(CAsnBinaryDefs::eConstructed),
110  m_CSerialUserOp(eTriState_Unknown),
111  m_CreateFunction(&CVoidTypeFunctions::Create),
112  m_ReadHookData(&CVoidTypeFunctions::Read, &TFunc::ReadWithHook),
113  m_WriteHookData(&CVoidTypeFunctions::Write, &TFunc::WriteWithHook),
114  m_SkipHookData(&CVoidTypeFunctions::Skip, &TFunc::SkipWithHook),
115  m_CopyHookData(&CVoidTypeFunctions::Copy, &TFunc::CopyWithHook)
116 
117 {
118  return;
119 }
120 
121 
122 CTypeInfo::CTypeInfo(ETypeFamily typeFamily, size_t size, const char* name)
123  : m_TypeFamily(typeFamily), m_Size(size), m_Name(name),
124  m_InfoItem(0),
125  m_CodeVer(0),
126  m_DataSpec(EDataSpec::eUnknown),
127  m_IsCObject(false),
128  m_IsInternal(false),
129  m_Tag(eNoExplicitTag), m_TagClass(CAsnBinaryDefs::eUniversal),
130  m_TagType(CAsnBinaryDefs::eAutomatic),
131  m_TagConstructed(CAsnBinaryDefs::eConstructed),
132  m_CSerialUserOp(eTriState_Unknown),
133  m_CreateFunction(&CVoidTypeFunctions::Create),
134  m_ReadHookData(&CVoidTypeFunctions::Read, &TFunc::ReadWithHook),
135  m_WriteHookData(&CVoidTypeFunctions::Write, &TFunc::WriteWithHook),
136  m_SkipHookData(&CVoidTypeFunctions::Skip, &TFunc::SkipWithHook),
137  m_CopyHookData(&CVoidTypeFunctions::Copy, &TFunc::CopyWithHook)
138 {
139  return;
140 }
141 
142 
143 CTypeInfo::CTypeInfo(ETypeFamily typeFamily, size_t size, const string& name)
144  : m_TypeFamily(typeFamily), m_Size(size), m_Name(name),
145  m_InfoItem(0),
146  m_CodeVer(0),
147  m_DataSpec(EDataSpec::eUnknown),
148  m_IsCObject(false),
149  m_IsInternal(false),
150  m_Tag(eNoExplicitTag), m_TagClass(CAsnBinaryDefs::eUniversal),
151  m_TagType(CAsnBinaryDefs::eAutomatic),
152  m_TagConstructed(CAsnBinaryDefs::eConstructed),
153  m_CSerialUserOp(eTriState_Unknown),
154  m_CreateFunction(&CVoidTypeFunctions::Create),
155  m_ReadHookData(&CVoidTypeFunctions::Read, &TFunc::ReadWithHook),
156  m_WriteHookData(&CVoidTypeFunctions::Write, &TFunc::WriteWithHook),
157  m_SkipHookData(&CVoidTypeFunctions::Skip, &TFunc::SkipWithHook),
158  m_CopyHookData(&CVoidTypeFunctions::Copy, &TFunc::CopyWithHook)
159 {
160  return;
161 }
162 
163 
165 {
166  if (m_InfoItem) {
167  delete m_InfoItem;
168  }
169  return;
170 }
171 
175 {
176  m_Tag = tag;
177  m_TagClass = tagclass;
178  m_TagType = tagtype;
179  return this;
180 }
181 
183 {
184  m_DataSpec = spec;
185 }
186 
188 {
189  return m_InfoItem ? m_InfoItem->HasNamespaceName() : false;
190 }
191 
192 const string& CTypeInfo::GetNamespaceName(void) const
193 {
195 }
196 
197 const CTypeInfo* CTypeInfo::SetNamespaceName(const string& ns_name) const
198 {
200  m_InfoItem->SetNamespaceName(ns_name);
201  return this;
202 }
203 
204 const CTypeInfo* CTypeInfo::SetNsQualified(bool qualified) const
205 {
207  m_InfoItem->SetNsQualified(qualified);
208  return this;
209 }
210 
212 {
214 }
215 
217 {
218  return m_InfoItem ? m_InfoItem->HasNamespacePrefix() : false;
219 }
220 
221 const string& CTypeInfo::GetNamespacePrefix(void) const
222 {
224 }
225 
226 void CTypeInfo::SetNamespacePrefix(const string& ns_prefix) const
227 {
229  m_InfoItem->SetNamespacePrefix(ns_prefix);
230 }
231 
233 {
234  if (!m_InfoItem) {
236  }
237 }
238 
240 {
241  if (other->m_InfoItem) {
242  if (m_InfoItem) {
243  delete m_InfoItem;
244  }
245  m_InfoItem = new CNamespaceInfoItem(*(other->m_InfoItem));
246  }
247 }
248 
249 const string& CTypeInfo::GetName(void) const
250 {
251  return IsInternal()? kEmptyStr: m_Name;
252 }
253 
254 const string& CTypeInfo::GetModuleName(void) const
255 {
256  return IsInternal()? kEmptyStr: m_ModuleName;
257 }
258 
259 void CTypeInfo::SetModuleName(const string& name)
260 {
261  if ( !m_ModuleName.empty() )
262  NCBI_THROW(CSerialException,eFail, "cannot change module name");
263  m_ModuleName = name;
264 }
265 
266 void CTypeInfo::SetModuleName(const char* name)
267 {
268  SetModuleName(string(name));
269 }
270 
271 const string& CTypeInfo::GetInternalName(void) const
272 {
273  return !IsInternal()? kEmptyStr: m_Name;
274 }
275 
276 const string& CTypeInfo::GetInternalModuleName(void) const
277 {
278  return !IsInternal()? kEmptyStr: m_ModuleName;
279 }
280 
281 void CTypeInfo::SetInternalName(const string& name)
282 {
283  if ( IsInternal() || !m_Name.empty() || !m_ModuleName.empty() )
284  NCBI_THROW(CSerialException,eFail, "cannot change (internal) name");
285  m_IsInternal = true;
286  m_Name = name;
287 }
288 
289 const string& CTypeInfo::GetAccessName(void) const
290 {
291  return m_Name;
292 }
293 
294 const string& CTypeInfo::GetAccessModuleName(void) const
295 {
296  return m_ModuleName;
297 }
298 
299 void CTypeInfo::Delete(TObjectPtr /*object*/) const
300 {
301  NCBI_THROW(CSerialException,eIllegalCall,
302  "This type cannot be allocated on heap");
303 }
304 
306 {
307 }
308 
310 {
311  return this;
312 }
313 
314 bool CTypeInfo::IsType(TTypeInfo typeInfo) const
315 {
316  return this == typeInfo;
317 }
318 
321 {
322  return eMayContainType_no;
323 }
324 
326 {
327  return 0;
328 }
329 
330 bool CTypeInfo::IsParentClassOf(const CClassTypeInfo* /*classInfo*/) const
331 {
332  return false;
333 }
334 
336 {
337  if (IsCObject() && m_CSerialUserOp.load(memory_order_relaxed) != eTriState_False) {
338  const CSerialUserOp* op = dynamic_cast<const CSerialUserOp*>( static_cast<const CObject*>(obj));
339  m_CSerialUserOp.store((op != nullptr) ? eTriState_True : eTriState_False, memory_order_relaxed);
340  return op;
341  }
342  return nullptr;
343 }
344 
346 {
347  if (IsCObject() && m_CSerialUserOp.load(memory_order_relaxed) != eTriState_False) {
348  CSerialUserOp* op = dynamic_cast<CSerialUserOp*>( static_cast<CObject*>(obj));
349  m_CSerialUserOp.store((op != nullptr) ? eTriState_True : eTriState_False, memory_order_relaxed);
350  return op;
351  }
352  return nullptr;
353 }
354 
355 void CTypeInfo::SetCreateFunction(TTypeCreate func)
356 {
357  m_CreateFunction = func;
358 }
359 
361  CReadObjectHook* hook)
362 {
365 }
366 
368 {
371 }
372 
374 {
377 }
378 
380 {
383 }
384 
385 void CTypeInfo::SetPathReadHook(CObjectIStream* in, const string& path,
386  CReadObjectHook* hook)
387 {
389  m_ReadHookData.SetPathHook(in,path,hook);
390 }
391 
393 {
396 }
397 
399  CWriteObjectHook* hook)
400 {
403 }
404 
406 {
409 }
410 
412 {
415 }
416 
418  CWriteObjectHook* hook)
419 {
421  m_WriteHookData.SetPathHook(out,path,hook);
422 }
423 
425  CSkipObjectHook* hook)
426 {
429  stream.AddMonitorType(this);
430 }
431 
433 {
436 }
437 
438 void CTypeInfo::SetPathSkipHook(CObjectIStream* in, const string& path,
439  CSkipObjectHook* hook)
440 {
442  m_SkipHookData.SetPathHook(in,path,hook);
443 }
444 
446 {
449 }
450 
452  CCopyObjectHook* hook)
453 {
456 }
457 
459 {
462 }
463 
465 {
468 }
469 
470 void CTypeInfo::SetPathCopyHook(CObjectStreamCopier* copier, const string& path,
471  CCopyObjectHook* hook)
472 {
474  m_CopyHookData.SetPathHook(copier ? &(copier->In()) : 0,path,hook);
475 }
476 
478 {
480 }
481 
483 {
485 }
486 
488 {
490 }
491 
493 {
495 }
496 
498 {
500 }
501 
503  TTypeInfo objectType,
504  TObjectPtr objectPtr)
505 {
506  CReadObjectHook* hook =
507  objectType->m_ReadHookData.GetHook(stream.m_ObjectHookKey);
508  if (!hook) {
509  hook = objectType->m_ReadHookData.GetPathHook(stream);
510  }
511  if ( hook )
512  hook->ReadObject(stream, CObjectInfo(objectPtr, objectType));
513  else
514  objectType->DefaultReadData(stream, objectPtr);
515 }
516 
518  TTypeInfo objectType,
519  TConstObjectPtr objectPtr)
520 {
521  CWriteObjectHook* hook =
522  objectType->m_WriteHookData.GetHook(stream.m_ObjectHookKey);
523  if (!hook) {
524  hook = objectType->m_WriteHookData.GetPathHook(stream);
525  }
526  if ( hook )
527  hook->WriteObject(stream, CConstObjectInfo(objectPtr, objectType));
528  else
529  objectType->DefaultWriteData(stream, objectPtr);
530 }
531 
533  TTypeInfo objectType)
534 {
535  CSkipObjectHook* hook =
536  objectType->m_SkipHookData.GetHook(stream.m_ObjectSkipHookKey);
537  if (!hook) {
538  hook = objectType->m_SkipHookData.GetPathHook(stream);
539  }
540  if ( hook )
541  hook->SkipObject(stream, objectType);
542  else
543  objectType->DefaultSkipData(stream);
544 }
545 
547  TTypeInfo objectType)
548 {
549  CCopyObjectHook* hook =
550  objectType->m_CopyHookData.GetHook(stream.m_ObjectHookKey);
551  if (!hook) {
552  hook = objectType->m_CopyHookData.GetPathHook(stream.In());
553  }
554  if ( hook )
555  hook->CopyObject(stream, objectType);
556  else
557  objectType->DefaultCopyData(stream);
558 }
559 
560 
562 {
563  m_NsPrefixSet = false;
565 }
566 
568 {
569  m_NsName = other.m_NsName;
570  m_NsPrefix = other.m_NsPrefix;
573 }
574 
576 {
577 }
578 
580 {
581  return !m_NsName.empty();
582 }
583 
584 const string& CNamespaceInfoItem::GetNamespaceName(void) const
585 {
586  return m_NsName;
587 }
588 
589 void CNamespaceInfoItem::SetNamespaceName(const string& ns_name)
590 {
591  m_NsName = ns_name;
592 }
593 
595 {
596  return m_NsPrefixSet;
597 }
598 
599 const string& CNamespaceInfoItem::GetNamespacePrefix(void) const
600 {
601  return m_NsPrefix;
602 }
603 
604 void CNamespaceInfoItem::SetNamespacePrefix(const string& ns_prefix)
605 {
606  m_NsPrefix = ns_prefix;
607  m_NsPrefixSet = !m_NsPrefix.empty();
608 }
609 
611 {
612  return m_NsQualified;
613 }
614 
616 {
617  m_NsQualified = qualified ? eNSQualified : eNSUnqualified;
618 }
619 
CConstObjectInfo –.
Definition: objectinfo.hpp:421
Copy hook for a standalone object.
Definition: objhook.hpp:254
const string & GetNamespaceName(void) const
Definition: typeinfo.cpp:584
virtual ~CNamespaceInfoItem(void)
Definition: typeinfo.cpp:575
ENsQualifiedMode IsNsQualified(void)
Definition: typeinfo.cpp:610
void SetNsQualified(bool qualified)
Definition: typeinfo.cpp:615
CNamespaceInfoItem(void)
Definition: typeinfo.cpp:561
ENsQualifiedMode m_NsQualified
Definition: typeinfo.cpp:95
bool HasNamespacePrefix(void) const
Definition: typeinfo.cpp:594
const string & GetNamespacePrefix(void) const
Definition: typeinfo.cpp:599
void SetNamespacePrefix(const string &ns_prefix)
Definition: typeinfo.cpp:604
bool HasNamespaceName(void) const
Definition: typeinfo.cpp:579
void SetNamespaceName(const string &ns_name)
Definition: typeinfo.cpp:589
CObjectIStream –.
Definition: objistr.hpp:93
CObjectInfo –.
Definition: objectinfo.hpp:597
CObjectOStream –.
Definition: objostr.hpp:83
CObjectStreamCopier –.
Definition: objcopy.hpp:71
CObject –.
Definition: ncbiobj.hpp:180
CRWLock –.
Definition: ncbimtx.hpp:953
Read hook for a standalone object.
Definition: objhook.hpp:59
Root class for all serialization exceptions.
Definition: exception.hpp:50
Base class for user-defined serializable classes to allow for objects assignment and comparison.
Definition: serialbase.hpp:319
Skip hook for a standalone object.
Definition: objhook.hpp:205
static void WriteWithHook(CObjectOStream &out, TTypeInfo objectType, TConstObjectPtr objectPtr)
Definition: typeinfo.cpp:517
static void CopyWithHook(CObjectStreamCopier &copier, TTypeInfo objectType)
Definition: typeinfo.cpp:546
static void ReadWithHook(CObjectIStream &in, TTypeInfo objectType, TObjectPtr objectPtr)
Definition: typeinfo.cpp:502
static void SkipWithHook(CObjectIStream &stream, TTypeInfo objectType)
Definition: typeinfo.cpp:532
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Definition: typeinfo.hpp:76
Write hook for a standalone object.
Definition: objhook.hpp:161
std::ofstream out("events_result.xml")
main entry point for tests
#define false
Definition: bool.h:36
@ eTriState_False
The value is equivalent to false/no.
Definition: ncbimisc.hpp:130
@ eTriState_True
The value is equivalent to true/yes.
Definition: ncbimisc.hpp:131
@ eTriState_Unknown
The value is indeterminate.
Definition: ncbimisc.hpp:129
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
@ eUnknown
Definition: app_popup.hpp:72
ENsQualifiedMode
Defines namespace qualification of XML tags.
Definition: serialdef.hpp:198
SSystemMutex & GetTypeInfoMutex(void)
Definition: typeinfo.cpp:49
void * TObjectPtr
Definition: serialdef.hpp:55
const void * TConstObjectPtr
Definition: serialdef.hpp:59
void Read(CObjectIStream &in, TObjectPtr object, const CTypeRef &type)
Definition: serial.cpp:60
void Write(CObjectOStream &out, TConstObjectPtr object, const CTypeRef &type)
Definition: serial.cpp:55
ETypeFamily
Type family.
Definition: serialdef.hpp:138
#define XSERIAL_TYPEINFO_WRITELOCK
Definition: serialimpl.hpp:277
CRWLock & GetTypeInfoLock(void)
Definition: typeinfo.cpp:53
EDataSpec
Definition: serialdef.hpp:204
@ eNSQualified
Definition: serialdef.hpp:201
@ eNSQNotSet
Definition: serialdef.hpp:199
@ eNSUnqualified
Definition: serialdef.hpp:200
void(* TTypeWriteFunction)(CObjectOStream &out, const CTypeInfo *objectType, TConstObjectPtr objectPtr)
Definition: hookfunc.hpp:57
void(* TTypeCopyFunction)(CObjectStreamCopier &copier, const CTypeInfo *objectType)
Definition: hookfunc.hpp:60
TFunction GetDefaultFunction(void) const
Definition: hookdata.hpp:128
void(* TTypeReadFunction)(CObjectIStream &in, const CTypeInfo *objectType, TObjectPtr objectPtr)
Definition: hookfunc.hpp:54
void SetDefaultFunction(TFunction func)
Definition: hookdata.hpp:133
void SetPathHook(CObjectStack *stk, const string &path, THook *hook)
Definition: hookdata.hpp:151
void ResetGlobalHook(void)
Definition: hookdata.hpp:162
void SetLocalHook(TLocalHooks &key, THook *hook)
Definition: hookdata.hpp:141
THook * GetPathHook(CObjectStack &stk) const
Definition: hookdata.hpp:177
void SetGlobalHook(THook *hook)
Definition: hookdata.hpp:146
THook * GetHook(const TLocalHooks &key) const
Definition: hookdata.hpp:173
void(* TTypeSkipFunction)(CObjectIStream &in, const CTypeInfo *objectType)
Definition: hookfunc.hpp:62
void ResetLocalHook(TLocalHooks &key)
Definition: hookdata.hpp:157
virtual void SkipObject(CObjectIStream &stream, const CObjectTypeInfo &type)=0
CLocalHookSet< CSkipObjectHook > m_ObjectSkipHookKey
Definition: objistr.hpp:1149
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.
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.
void AddMonitorType(TTypeInfo type)
Definition: objistr.cpp:626
CLocalHookSet< CWriteObjectHook > m_ObjectHookKey
Definition: objostr.hpp:830
CLocalHookSet< CReadObjectHook > m_ObjectHookKey
Definition: objistr.hpp:1146
CLocalHookSet< CCopyObjectHook > m_ObjectHookKey
Definition: objcopy.hpp:158
CObjectIStream & In(void) const
virtual void CopyObject(CObjectStreamCopier &copier, const CObjectTypeInfo &type)=0
#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 kEmptyStr
Definition: ncbistr.hpp:123
void SetWriteFunction(TTypeWriteFunction func)
Definition: typeinfo.cpp:487
const string & GetName(void) const
Get name of this type.
Definition: typeinfo.cpp:249
virtual const string & GetModuleName(void) const
Get module name.
Definition: typeinfo.cpp:254
void SetPathCopyHook(CObjectStreamCopier *copier, const string &path, CCopyObjectHook *hook)
Set local context-specific copy hook.
Definition: typeinfo.cpp:470
virtual void DeleteExternalObjects(TObjectPtr object) const
Definition: typeinfo.cpp:305
void ResetLocalWriteHook(CObjectOStream &out)
Reset local write hook.
Definition: typeinfo.cpp:411
CHookData< CReadObjectHook, TTypeReadFunction > m_ReadHookData
Definition: typeinfo.hpp:316
void DataSpec(EDataSpec spec)
Definition: typeinfo.cpp:182
virtual TTypeInfo GetRealTypeInfo(TConstObjectPtr object) const
Definition: typeinfo.cpp:309
const string & GetAccessModuleName(void) const
Return internal or regular module name.
Definition: typeinfo.cpp:294
CTypeInfo(ETypeFamily typeFamily, size_t size)
Definition: typeinfo.cpp:100
bool HasNamespaceName(void) const
Check if data type has namespace name.
Definition: typeinfo.cpp:187
CHookData< CCopyObjectHook, TTypeCopyFunction > m_CopyHookData
Definition: typeinfo.hpp:319
virtual CTypeInfo * SetTag(CAsnBinaryDefs::TLongTag tag, CAsnBinaryDefs::ETagClass tagclass=CAsnBinaryDefs::eUniversal, CAsnBinaryDefs::ETagType tagtype=CAsnBinaryDefs::eAutomatic)
Definition: typeinfo.cpp:172
void SetModuleName(const string &name)
Set module name.
Definition: typeinfo.cpp:259
void x_CreateInfoItemIfNeeded(void) const
Definition: typeinfo.cpp:232
const string & GetInternalName(void) const
Return internal type access string e.g. Int-fuzz.range.
Definition: typeinfo.cpp:271
const CTypeInfo * SetNamespaceName(const string &ns_name) const
Set namespace name.
Definition: typeinfo.cpp:197
void SetGlobalWriteHook(CWriteObjectHook *hook)
Set global (for all input streams) write hook.
Definition: typeinfo.cpp:392
string m_Name
Definition: typeinfo.hpp:290
const string & GetNamespacePrefix(void) const
Get namespace prefix.
Definition: typeinfo.cpp:221
void ResetGlobalReadHook(void)
Reset global read hooks.
Definition: typeinfo.cpp:379
virtual EMayContainType GetMayContainType(TTypeInfo type) const
Definition: typeinfo.cpp:320
void DefaultSkipData(CObjectIStream &in) const
void SetNamespacePrefix(const string &ns_prefix) const
Set namespace prefix.
Definition: typeinfo.cpp:226
CAsnBinaryDefs::ETagClass m_TagClass
Definition: typeinfo.hpp:307
void SetInternalName(const string &name)
Mark this type as internal.
Definition: typeinfo.cpp:281
const CSerialUserOp * AsCSerialUserOp(TConstObjectPtr obj) const
Definition: typeinfo.cpp:335
TTypeReadFunction GetReadFunction(void) const
Definition: typeinfo.cpp:482
const string & GetNamespaceName(void) const
Get namespace name.
Definition: typeinfo.cpp:192
bool HasNamespacePrefix(void) const
Check if data type has namespace prefix.
Definition: typeinfo.cpp:216
void DefaultReadData(CObjectIStream &in, TObjectPtr object) const
void DefaultWriteData(CObjectOStream &out, TConstObjectPtr object) const
void SetLocalWriteHook(CObjectOStream &out, CWriteObjectHook *hook)
Set local (for a specific input stream) write hook.
Definition: typeinfo.cpp:398
void ResetGlobalCopyHook(void)
Reset global copy hooks.
Definition: typeinfo.cpp:458
void ResetLocalSkipHook(CObjectIStream &in)
Reset local skip hook.
Definition: typeinfo.cpp:432
TTypeCreate m_CreateFunction
Definition: typeinfo.hpp:314
bool IsCObject(void) const
Check is this TypeInfo object is kind of CClassTypeInfoBase.
CHookData< CWriteObjectHook, TTypeWriteFunction > m_WriteHookData
Definition: typeinfo.hpp:317
const string & GetInternalModuleName(void) const
Return internal type's owner module name.
Definition: typeinfo.cpp:276
CAsnBinaryDefs::ETagType m_TagType
Definition: typeinfo.hpp:308
virtual ~CTypeInfo(void)
Definition: typeinfo.cpp:164
ENsQualifiedMode IsNsQualified(void) const
Get namespace 'qualified' property.
Definition: typeinfo.cpp:211
const CTypeInfo * SetNsQualified(bool qualified) const
Set namespace 'qualified' property.
Definition: typeinfo.cpp:204
atomic< ETriState > m_CSerialUserOp
Definition: typeinfo.hpp:310
void SetLocalCopyHook(CObjectStreamCopier &copier, CCopyObjectHook *hook)
Set local (for a specific input stream) copy hook.
Definition: typeinfo.cpp:451
bool IsInternal(void) const
Check if this TypeInfo describes internal unnamed type.
void SetSkipFunction(TTypeSkipFunction func)
Definition: typeinfo.cpp:497
void SetGlobalCopyHook(CCopyObjectHook *hook)
Set global (for all input streams) copy hook.
Definition: typeinfo.cpp:445
CHookData< CSkipObjectHook, TTypeSkipFunction > m_SkipHookData
Definition: typeinfo.hpp:318
virtual bool IsType(TTypeInfo type) const
Definition: typeinfo.cpp:314
bool m_IsInternal
Definition: typeinfo.hpp:305
void CopyInfoItem(TTypeInfo other)
Definition: typeinfo.cpp:239
string m_ModuleName
Definition: typeinfo.hpp:291
void SetPathReadHook(CObjectIStream *in, const string &path, CReadObjectHook *hook)
Set local context-specific read hook.
Definition: typeinfo.cpp:385
void SetPathWriteHook(CObjectOStream *out, const string &path, CWriteObjectHook *hook)
Set local context-specific write hook.
Definition: typeinfo.cpp:417
void SetCreateFunction(TTypeCreate func)
Definition: typeinfo.cpp:355
void SetGlobalReadHook(CReadObjectHook *hook)
Set global (for all input streams) read hook.
Definition: typeinfo.cpp:367
EDataSpec m_DataSpec
Definition: typeinfo.hpp:294
virtual bool IsParentClassOf(const CClassTypeInfo *classInfo) const
Definition: typeinfo.cpp:330
void SetPathSkipHook(CObjectIStream *in, const string &path, CSkipObjectHook *hook)
Set local context-specific skip hook.
Definition: typeinfo.cpp:438
void DefaultCopyData(CObjectStreamCopier &copier) const
CNamespaceInfoItem * m_InfoItem
Definition: typeinfo.hpp:292
const string & GetAccessName(void) const
Return internal or regular name.
Definition: typeinfo.cpp:289
void SetLocalSkipHook(CObjectIStream &in, CSkipObjectHook *hook)
Set local (for a specific input stream) skip hook.
Definition: typeinfo.cpp:424
void SetCopyFunction(TTypeCopyFunction func)
Definition: typeinfo.cpp:492
virtual const CObject * GetCObjectPtr(TConstObjectPtr objectPtr) const
Definition: typeinfo.cpp:325
void ResetLocalCopyHook(CObjectStreamCopier &copier)
Reset local copy hook.
Definition: typeinfo.cpp:464
void SetLocalReadHook(CObjectIStream &in, CReadObjectHook *hook)
Set local (for a specific input stream) read hook.
Definition: typeinfo.cpp:360
void ResetLocalReadHook(CObjectIStream &in)
Reset local read hook.
Definition: typeinfo.cpp:373
CAsnBinaryDefs::TLongTag m_Tag
Definition: typeinfo.hpp:306
void ResetGlobalWriteHook(void)
Reset global write hooks.
Definition: typeinfo.cpp:405
virtual void Delete(TObjectPtr object) const
Delete object.
Definition: typeinfo.cpp:299
void SetReadFunction(TTypeReadFunction func)
Definition: typeinfo.cpp:477
@ eMayContainType_no
Definition: typeinfo.hpp:184
const struct ncbi::grid::netcache::search::fields::SIZE size
const char * tag
Multi-threading – mutexes; rw-locks; semaphore.
Multi-threading – classes, functions, and features.
std::istream & in(std::istream &in_, double &x_)
#define _ASSERT
CTypeInfoFunctions TFunc
Definition: typeinfo.cpp:98
DEFINE_STATIC_MUTEX(s_TypeInfoMutex)
Modified on Thu May 02 14:32:40 2024 by modify_doxy.py rev. 669887