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

Go to the SVN repository for this file.

1 #if defined(TYPEINFO__HPP) && !defined(TYPEINFO__INL)
2 #define TYPEINFO__INL
3 
4 /* $Id: typeinfo.inl 50995 2011-08-23 16:26:09Z 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 * !!! PUT YOUR DESCRIPTION HERE !!!
33 */
34 
35 inline
37 {
38  return m_TypeFamily;
39 }
40 
41 inline
42 size_t CTypeInfo::GetSize(void) const
43 {
44  return m_Size;
45 }
46 
47 inline
48 bool CTypeInfo::MayContainType(TTypeInfo typeInfo) const
49 {
50  return GetMayContainType(typeInfo) == eMayContainType_yes;
51 }
52 
53 inline
56 {
57  return IsType(typeInfo)? eMayContainType_yes: GetMayContainType(typeInfo);
58 }
59 
60 inline
62 {
63  return m_CreateFunction(this, memoryPool);
64 }
65 
66 inline
68 {
69  m_ReadHookData.GetCurrentFunction()(in, this, object);
70 }
71 
72 inline
74 {
75  m_WriteHookData.GetCurrentFunction()(out, this, object);
76 }
77 
78 inline
79 void CTypeInfo::CopyData(CObjectStreamCopier& copier) const
80 {
81  m_CopyHookData.GetCurrentFunction()(copier, this);
82 }
83 
84 inline
86 {
88 }
89 
90 inline
92  TObjectPtr objectPtr) const
93 {
94  m_ReadHookData.GetDefaultFunction()(in, this, objectPtr);
95 }
96 
97 inline
99  TConstObjectPtr objectPtr) const
100 {
101  m_WriteHookData.GetDefaultFunction()(out, this, objectPtr);
102 }
103 
104 inline
106 {
107  m_CopyHookData.GetDefaultFunction()(copier, this);
108 }
109 
110 inline
112 {
114 }
115 
116 inline
117 bool CTypeInfo::IsCObject(void) const
118 {
119  return m_IsCObject;
120 }
121 
122 inline
123 bool CTypeInfo::IsInternal(void) const
124 {
125  return m_IsInternal;
126 }
127 
128 #endif /* def TYPEINFO__HPP && ndef TYPEINFO__INL */
CObjectIStream –.
Definition: objistr.hpp:93
CObjectOStream –.
Definition: objostr.hpp:83
CObjectStreamCopier –.
Definition: objcopy.hpp:71
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Definition: typeinfo.hpp:76
std::ofstream out("events_result.xml")
main entry point for tests
void * TObjectPtr
Definition: serialdef.hpp:55
const void * TConstObjectPtr
Definition: serialdef.hpp:59
ETypeFamily
Type family.
Definition: serialdef.hpp:138
TFunction GetDefaultFunction(void) const
Definition: hookdata.hpp:128
TFunction GetCurrentFunction(void) const
Definition: hookdata.hpp:123
void CopyData(CObjectStreamCopier &copier) const
CHookData< CReadObjectHook, TTypeReadFunction > m_ReadHookData
Definition: typeinfo.hpp:316
CHookData< CCopyObjectHook, TTypeCopyFunction > m_CopyHookData
Definition: typeinfo.hpp:319
void WriteData(CObjectOStream &out, TConstObjectPtr object) const
ETypeFamily GetTypeFamily(void) const
virtual EMayContainType GetMayContainType(TTypeInfo type) const
Definition: typeinfo.cpp:320
void DefaultSkipData(CObjectIStream &in) const
void DefaultReadData(CObjectIStream &in, TObjectPtr object) const
ETypeFamily m_TypeFamily
Definition: typeinfo.hpp:288
void DefaultWriteData(CObjectOStream &out, TConstObjectPtr object) const
bool m_IsCObject
Definition: typeinfo.hpp:304
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
void ReadData(CObjectIStream &in, TObjectPtr object) const
size_t m_Size
Definition: typeinfo.hpp:289
bool IsInternal(void) const
Check if this TypeInfo describes internal unnamed type.
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
EMayContainType IsOrMayContainType(TTypeInfo type) const
bool MayContainType(TTypeInfo type) const
void DefaultCopyData(CObjectStreamCopier &copier) const
size_t GetSize(void) const
Get size of data object in memory (like sizeof in C)
void SkipData(CObjectIStream &in) const
TObjectPtr Create(CObjectMemoryPool *memoryPool=0) const
Create object of this type on heap (can be deleted by operator delete)
@ eMayContainType_yes
Definition: typeinfo.hpp:186
std::istream & in(std::istream &in_, double &x_)
Modified on Sat May 25 14:17:19 2024 by modify_doxy.py rev. 669887