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

Go to the SVN repository for this file.

1 #ifndef STLTYPESIMPL__HPP
2 #define STLTYPESIMPL__HPP
3 
4 /* $Id: stltypesimpl.hpp 79648 2017-09-28 13:18:13Z gouriano $
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 #include <serial/impl/continfo.hpp>
38 #include <serial/impl/memberid.hpp>
39 
40 
41 /** @addtogroup TypeInfoCPP
42  *
43  * @{
44  */
45 
46 
48 
50 {
51 public:
52  static TTypeInfo Get_auto_ptr(TTypeInfo arg, TTypeInfoCreator1 f);
53  static TTypeInfo Get_CRef(TTypeInfo arg, TTypeInfoCreator1 f);
54  static TTypeInfo Get_CConstRef(TTypeInfo arg, TTypeInfoCreator1 f);
55  static TTypeInfo Get_AutoPtr(TTypeInfo arg, TTypeInfoCreator1 f);
56  static TTypeInfo Get_list(TTypeInfo arg, TTypeInfoCreator1 f);
57  static TTypeInfo GetSet_list(TTypeInfo arg, TTypeInfoCreator1 f);
58  static TTypeInfo Get_vector(TTypeInfo arg, TTypeInfoCreator1 f);
59  static TTypeInfo GetSet_vector(TTypeInfo arg, TTypeInfoCreator1 f);
60  static TTypeInfo Get_set(TTypeInfo arg, TTypeInfoCreator1 f);
61  static TTypeInfo Get_multiset(TTypeInfo arg, TTypeInfoCreator1 f);
62  static TTypeInfo Get_map(TTypeInfo arg1, TTypeInfo arg2,
64  static TTypeInfo Get_multimap(TTypeInfo arg1, TTypeInfo arg2,
66  static TTypeInfo GetInfo(TTypeInfo& storage,
68  static TTypeInfo GetInfo(TTypeInfo& storage,
69  TTypeInfo arg1, TTypeInfo arg2,
71 
72  // throw exceptions
73  NCBI_NORETURN
74  static void ThrowDuplicateElementError(void);
75  NCBI_NORETURN
76  static void CannotGetElementOfSet(void);
77 };
78 
80 {
82 public:
83  CStlOneArgTemplate(size_t size, TTypeInfo dataType,
84  bool randomOrder, const string& name);
85  CStlOneArgTemplate(size_t size, TTypeInfo dataType,
86  bool randomOrder);
87  CStlOneArgTemplate(size_t size, const CTypeRef& dataType,
88  bool randomOrder);
89 
90  const CMemberId& GetDataId(void) const
91  {
92  return m_DataId;
93  }
94  void SetDataId(const CMemberId& id);
95 
96  virtual bool IsDefault(TConstObjectPtr objectPtr) const override;
97  virtual void SetDefault(TObjectPtr objectPtr) const override;
98 
99  // private use
100  typedef bool (*TIsDefaultFunction)(TConstObjectPtr objectPtr);
101  typedef void (*TSetDefaultFunction)(TObjectPtr objectPtr);
102 
103  void SetMemFunctions(TTypeCreate create,
104  TIsDefaultFunction isDefault,
105  TSetDefaultFunction setDefault);
106 
107 private:
108  TIsDefaultFunction m_IsDefault;
109  TSetDefaultFunction m_SetDefault;
110 
112 };
113 
115 {
117 public:
118  CStlTwoArgsTemplate(size_t size,
119  TTypeInfo keyType, TPointerOffsetType keyOffset,
120  TTypeInfo valueType, TPointerOffsetType valueOffset,
121  bool randomOrder);
122  CStlTwoArgsTemplate(size_t size,
123  const CTypeRef& keyType, TPointerOffsetType keyOffset,
124  const CTypeRef& valueType, TPointerOffsetType valueOffset,
125  bool randomOrder);
126 
127  const CMemberId& GetKeyId(void) const
128  {
129  return m_KeyId;
130  }
131  const CMemberId& GetValueId(void) const
132  {
133  return m_ValueId;
134  }
135  void SetKeyId(const CMemberId& id);
136  void SetValueId(const CMemberId& id);
137 
138 private:
142 
146 
147  static TTypeInfo CreateElementTypeInfo(TTypeInfo info);
148 };
149 
151 
152 #endif /* STLTYPESIMPL__HPP */
153 
154 
155 /* @} */
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 bool
Definition: bool.h:34
void * TObjectPtr
Definition: serialdef.hpp:55
const void * TConstObjectPtr
Definition: serialdef.hpp:59
CTypeInfo *(* TTypeInfoCreator1)(TTypeInfo)
Definition: serialdef.hpp:67
CTypeInfo *(* TTypeInfoCreator2)(TTypeInfo, TTypeInfo)
Definition: serialdef.hpp:68
ssize_t TPointerOffsetType
Definition: serialdef.hpp:241
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
TIsDefaultFunction m_IsDefault
TSetDefaultFunction m_SetDefault
CStlOneArgTemplate CParent
const CMemberId & GetDataId(void) const
CContainerTypeInfo CParent
const CMemberId & GetValueId(void) const
TPointerOffsetType m_ValueOffset
TPointerOffsetType m_KeyOffset
const CMemberId & GetKeyId(void) const
#define NCBI_XSERIAL_EXPORT
Definition: ncbi_export.h:1435
static MDB_envinfo info
Definition: mdb_load.c:37
const struct ncbi::grid::netcache::search::fields::SIZE size
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
Modified on Mon May 27 04:37:38 2024 by modify_doxy.py rev. 669887