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

Go to the SVN repository for this file.

1 #ifndef STLTYPES__HPP
2 #define STLTYPES__HPP
3 
4 /* $Id: stltypes.hpp 91809 2020-12-14 15:36:04Z grichenk $
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 <corelib/ncbiobj.hpp>
37 #include <corelib/ncbiutil.hpp>
38 #include <set>
39 #include <map>
40 #include <list>
41 #include <vector>
42 #include <memory>
43 #include <serial/serialutil.hpp>
45 #include <serial/impl/ptrinfo.hpp>
46 #include <serial/objistr.hpp>
47 
48 
49 /** @addtogroup TypeInfoCPP
50  *
51  * @{
52  */
53 
54 
56 
57 template<typename Data>
59 {
60 public:
61  typedef Data TDataType;
62  typedef unique_ptr<TDataType> TObjectType;
63 
64  static TTypeInfo GetTypeInfo(TTypeInfo dataType)
65  {
67  }
69  {
70  CPointerTypeInfo* typeInfo =
71  new CPointerTypeInfo(sizeof(TObjectType), dataType);
72  typeInfo->SetFunctions(&GetData, &SetData);
73  return typeInfo;
74  }
75 
76 protected:
77  static TObjectPtr GetData(const CPointerTypeInfo* /*objectType*/,
78  TObjectPtr objectPtr)
79  {
80  return CTypeConverter<TObjectType>::Get(objectPtr).get();
81  }
82  static void SetData(const CPointerTypeInfo* /*objectType*/,
83  TObjectPtr objectPtr,
84  TObjectPtr dataPtr)
85  {
87  reset(&CTypeConverter<TDataType>::Get(dataPtr));
88  }
89 };
90 
91 template<typename Data>
93 {
94 public:
95  typedef Data TDataType;
97 
98  static TTypeInfo GetTypeInfo(TTypeInfo dataType)
99  {
100  return CStlClassInfoUtil::Get_CRef(dataType, &CreateTypeInfo);
101  }
103  {
104  CPointerTypeInfo* typeInfo =
105  new CPointerTypeInfo(sizeof(TObjectType), dataType);
106  typeInfo->SetFunctions(&GetData, &SetData);
107  return typeInfo;
108  }
109 
110 protected:
111  static TObjectPtr GetData(const CPointerTypeInfo* /*objectType*/,
112  TObjectPtr objectPtr)
113  {
114  return CTypeConverter<TObjectType>::Get(objectPtr).GetPointer();
115  }
116  static void SetData(const CPointerTypeInfo* /*objectType*/,
117  TObjectPtr objectPtr,
118  TObjectPtr dataPtr)
119  {
122  }
123 };
124 
125 template<typename Data>
127 {
128 public:
129  typedef Data TDataType;
131 
132  static TTypeInfo GetTypeInfo(TTypeInfo dataType)
133  {
135  }
137  {
138  CPointerTypeInfo* typeInfo =
139  new CPointerTypeInfo(sizeof(TObjectType), dataType);
140  typeInfo->SetFunctions(&GetData, &SetData);
141  return typeInfo;
142  }
143 
144 protected:
145  static TObjectPtr GetData(const CPointerTypeInfo* /*objectType*/,
146  TObjectPtr objectPtr)
147  {
148  // Bleh. Need to return a void* rather than a const Data*
149  return const_cast<TDataType*>
151  }
152  static void SetData(const CPointerTypeInfo* /*objectType*/,
153  TObjectPtr objectPtr,
154  TObjectPtr dataPtr)
155  {
157  Reset(&CTypeConverter<TDataType>::Get(dataPtr));
158  }
159 };
160 
161 template<typename Data>
163 {
164 public:
165  typedef Data TDataType;
167 
168  static TTypeInfo GetTypeInfo(TTypeInfo dataType)
169  {
171  }
173  {
174  CPointerTypeInfo* typeInfo =
175  new CPointerTypeInfo(sizeof(TObjectType), dataType);
176  typeInfo->SetFunctions(&GetData, &SetData);
177  return typeInfo;
178  }
179 
180 protected:
181  static TObjectPtr GetData(const CPointerTypeInfo* /*objectType*/,
182  TObjectPtr objectPtr)
183  {
184  return CTypeConverter<TObjectType>::Get(objectPtr).get();
185  }
186  static void SetData(const CPointerTypeInfo* /*objectType*/,
187  TObjectPtr objectPtr,
188  TObjectPtr dataPtr)
189  {
191  reset(&CTypeConverter<TDataType>::Get(dataPtr));
192  }
193 };
194 
195 template<class Container>
197 {
198 public:
199  typedef Container TObjectType;
201 
202  static TObjectType& Get(TObjectPtr objectPtr)
203  {
204  return CTypeConverter<TObjectType>::Get(objectPtr);
205  }
206  static const TObjectType& Get(TConstObjectPtr objectPtr)
207  {
208  return CTypeConverter<TObjectType>::Get(objectPtr);
209  }
210 
211  static TObjectPtr CreateContainer(TTypeInfo /*objectType*/,
212  CObjectMemoryPool* /*memoryPool*/)
213  {
214  return new TObjectType();
215  }
216 
217  static bool IsDefault(TConstObjectPtr objectPtr)
218  {
219  return Get(objectPtr).empty();
220  }
221  static void SetDefault(TObjectPtr objectPtr)
222  {
223  Get(objectPtr).clear();
224  }
225 
226  static TObjectPtr AddElement(const CContainerTypeInfo* containerType,
227  TObjectPtr containerPtr,
228  TConstObjectPtr elementPtr,
230  {
231  TObjectType& container = Get(containerPtr);
232 #if defined(_RWSTD_VER) && !defined(_RWSTD_STRICT_ANSI)
233  container.allocation_size(container.size());
234 #endif
235  if ( elementPtr ) {
236  TElementType elm;
237  containerType->GetElementType()->Assign
238  (&elm, &CTypeConverter<TElementType>::Get(elementPtr), how);
239  container.push_back(elm);
240  }
241  else {
242  container.push_back(TElementType());
243  }
244  return &container.back();
245  }
246  static TObjectPtr AddElementIn(const CContainerTypeInfo* containerType,
247  TObjectPtr containerPtr,
249  {
250  TObjectType& container = Get(containerPtr);
251 #if defined(_RWSTD_VER) && !defined(_RWSTD_STRICT_ANSI)
252  container.allocation_size(container.size());
253 #endif
254  container.push_back(TElementType());
255  in.SetDiscardCurrObject(false);
256  containerType->GetElementType()->ReadData(in, &container.back());
257  if (in.GetDiscardCurrObject()) {
258  container.pop_back();
259  in.SetDiscardCurrObject(false);
260  return 0;
261  }
262  return &container.back();
263  }
264 
265  static size_t GetElementCount(const CContainerTypeInfo*,
266  TConstObjectPtr containerPtr)
267  {
268  const TObjectType& container = Get(containerPtr);
269  return container.size();
270  }
271 
273  {
274  info->SetMemFunctions(&CreateContainer, &IsDefault, &SetDefault);
275  }
277  {
278  info->SetAddElementFunctions(&AddElement, &AddElementIn);
279  }
281  {
282  info->SetCountFunctions(&GetElementCount);
283  }
284 };
285 
286 template<class Container>
288 {
290 public:
293 
295  TObjectPtr containerPtr, size_t count)
296  {
297  TObjectType& container = CParent::Get(containerPtr);
298  container.reserve(count);
299  }
300 
302  {
303  info->SetCountFunctions(&CParent::GetElementCount,
304  &ReserveElements);
305  }
306 };
307 
308 template<class Container>
310 {
312 public:
315 
316  static void InsertElement(TObjectPtr containerPtr,
317  const TElementType& element)
318  {
319  TObjectType& container = CParent::Get(containerPtr);
320 #if defined(_RWSTD_VER) && !defined(_RWSTD_STRICT_ANSI)
321  container.allocation_size(container.size());
322 #endif
323  if ( !container.insert(element).second )
325  }
326  static TObjectPtr AddElement(const CContainerTypeInfo* /*containerType*/,
327  TObjectPtr containerPtr,
328  TConstObjectPtr elementPtr,
329  ESerialRecursionMode /* how = eRecursive */)
330  {
331  InsertElement(containerPtr,
333  return 0;
334  }
335  // this structure is required to initialize pointers by null before reading
337  {
340  };
341  static TObjectPtr AddElementIn(const CContainerTypeInfo* containerType,
342  TObjectPtr containerPtr,
344  {
346  containerType->GetElementType()->ReadData(in, &data.data);
347  InsertElement(containerPtr, data.data);
348  return 0;
349  }
350 
352  {
353  info->SetAddElementFunctions(&AddElement, &AddElementIn);
354  }
355 };
356 
357 template<class Container>
359  public CStlClassInfoFunctions<Container>
360 {
362 public:
365 
366  static void InsertElement(TObjectPtr containerPtr,
367  const TElementType& element)
368  {
369  TObjectType& container = CParent::Get(containerPtr);
370 #if defined(_RWSTD_VER) && !defined(_RWSTD_STRICT_ANSI)
371  container.allocation_size(container.size());
372 #endif
373  container.insert(element);
374  }
375  static TObjectPtr AddElement(const CContainerTypeInfo* /*containerType*/,
376  TObjectPtr containerPtr,
377  TConstObjectPtr elementPtr,
379  {
380  InsertElement(containerPtr,
382  return 0;
383  }
384  // this structure is required to initialize pointers by null before reading
386  {
389  };
390  static TObjectPtr AddElementIn(const CContainerTypeInfo* containerType,
391  TObjectPtr containerPtr,
393  {
395  containerType->GetElementType()->ReadData(in, &data.data);
396  InsertElement(containerPtr, data.data);
397  return 0;
398  }
399 
401  {
402  info->SetAddElementFunctions(&AddElement, &AddElementIn);
403  }
404 };
405 
406 template<class Container, class StlIterator,
407  typename ContainerPtr, typename ElementRef,
408  class TypeInfoIterator>
410  public CStlClassInfoFunctions<Container>
411 {
412 public:
413  typedef StlIterator TStlIterator;
414  typedef TypeInfoIterator TTypeInfoIterator;
417 
419  {
420  if ( sizeof(TStlIterator) <= sizeof(iter.m_IteratorData) ) {
421  void* data = &iter.m_IteratorData;
422  return *static_cast<TStlIterator*>(data);
423  }
424  else {
425  void* data = iter.m_IteratorData;
426  return *static_cast<TStlIterator*>(data);
427  }
428  }
429  static const TStlIterator& It(const TTypeInfoIterator& iter)
430  {
431  if ( sizeof(TStlIterator) <= sizeof(iter.m_IteratorData) ) {
432  const void* data = &iter.m_IteratorData;
433  return *static_cast<const TStlIterator*>(data);
434  }
435  else {
436  const void* data = iter.m_IteratorData;
437  return *static_cast<const TStlIterator*>(data);
438  }
439  }
440  static bool InitIterator(TTypeInfoIterator& iter)
441  {
442  TStlIterator stl_iter
443  = CParent::Get(iter.GetContainerPtr()).begin();
444  if ( sizeof(TStlIterator) <= sizeof(iter.m_IteratorData) ) {
445  void* data = &iter.m_IteratorData;
446  new (data) TStlIterator(stl_iter);
447  }
448  else {
449  iter.m_IteratorData = new TStlIterator(stl_iter);
450  }
451  return stl_iter != CParent::Get(iter.GetContainerPtr()).end();
452  }
454  {
455  if ( sizeof(TStlIterator) <= sizeof(iter.m_IteratorData) ) {
456  void* data = &iter.m_IteratorData;
457  static_cast<TStlIterator*>(data)->~StlIterator();
458  }
459  else {
460  void* data = iter.m_IteratorData;
461  delete static_cast<TStlIterator*>(data);
462  }
463  }
464  static void CopyIterator(TTypeInfoIterator& dst,
465  const TTypeInfoIterator& src)
466  {
467  It(dst) = It(src);
468  }
469 
470  static bool NextElement(TTypeInfoIterator& iter)
471  {
472  return ++It(iter) != CParent::Get(iter.GetContainerPtr()).end();
473  }
475  {
476  ElementRef e= *It(iter);
477  return &e;
478  }
479 };
480 
481 template<class Container>
483  public CStlClassInfoFunctionsIBase<Container, typename Container::const_iterator, const Container*, const typename Container::value_type&, CContainerTypeInfo::CConstIterator>
484 {
486 public:
488  {
489  info->SetConstIteratorFunctions(&CParent::InitIterator,
494  }
495 };
496 
497 template<class Container>
499  public CStlClassInfoFunctionsIBase<Container, typename Container::iterator, Container*, typename Container::value_type&, CContainerTypeInfo::CIterator>
500 {
502 public:
505  typedef typename CParent::TObjectPtr TObjectPtr;
506 
507  static bool EraseElement(TTypeInfoIterator& iter)
508  {
509  TStlIterator& it = CParent::It(iter);
510  Container* c = static_cast<Container*>(iter.GetContainerPtr());
511  it = c->erase(it);
512  return it != c->end();
513  }
515  {
516  Container* c = static_cast<Container*>(iter.GetContainerPtr());
517  c->erase(CParent::It(iter), c->end());
518  }
519 
521  {
522  info->SetIteratorFunctions(&CParent::InitIterator,
528  }
529 };
530 
531 template<class Container>
533  public CStlClassInfoFunctionsIBase<Container, typename Container::iterator, Container*, typename Container::value_type&, CContainerTypeInfo::CIterator>
534 {
536 public:
539  typedef typename CParent::TObjectPtr TObjectPtr;
540 
542  {
544  return 0;
545  }
546  static bool EraseElement(TTypeInfoIterator& iter)
547  {
548  TStlIterator& it = CParent::It(iter);
549  Container* c = static_cast<Container*>(iter.GetContainerPtr());
550  TStlIterator erase = it++;
551  c->erase(erase);
552  return it != c->end();
553  }
555  {
556  Container* c = static_cast<Container*>(iter.GetContainerPtr());
557  c->erase(CParent::It(iter), c->end());
558  }
559 
561  {
562  info->SetIteratorFunctions(&CParent::InitIterator,
566  &GetElementPtr,
568  }
569 };
570 
571 template<typename Data>
573 {
574 public:
575  typedef list<Data> TObjectType;
576 
577  static TTypeInfo GetTypeInfo(TTypeInfo elementType)
578  {
579  return CStlClassInfoUtil::Get_list(elementType, &CreateTypeInfo);
580  }
581  static CTypeInfo* CreateTypeInfo(TTypeInfo elementType)
582  {
584  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
585  false);
587  return info;
588  }
589  static CTypeInfo* CreateTypeInfo(TTypeInfo elementType, const string& name)
590  {
592  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
593  false, name);
595  return info;
596  }
597 
598  static TTypeInfo GetSetTypeInfo(TTypeInfo elementType)
599  {
600  return CStlClassInfoUtil::GetSet_list(elementType,
602  }
603  static CTypeInfo* CreateSetTypeInfo(TTypeInfo elementType)
604  {
606  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
607  true);
609  return info;
610  }
611  static CTypeInfo* CreateSetTypeInfo(TTypeInfo elementType, const string& name)
612  {
614  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
615  true, name);
617  return info;
618  }
619 
621  {
627  }
628 };
629 
630 template<typename Data>
632 {
633 public:
634  typedef vector<Data> TObjectType;
635 
636  static TTypeInfo GetTypeInfo(TTypeInfo elementType)
637  {
638  return CStlClassInfoUtil::Get_vector(elementType,
639  &CreateTypeInfo);
640  }
641  static CTypeInfo* CreateTypeInfo(TTypeInfo elementType)
642  {
644  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
645  false);
646 
648  return info;
649  }
650 
651  static TTypeInfo GetSetTypeInfo(TTypeInfo elementType)
652  {
653  return CStlClassInfoUtil::GetSet_vector(elementType,
655  }
656  static CTypeInfo* CreateSetTypeInfo(TTypeInfo elementType)
657  {
659  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
660  true);
662  return info;
663  }
664 
666  {
672  }
673 };
674 
675 template<typename Data>
677 {
678 public:
680 
681  static TTypeInfo GetTypeInfo(TTypeInfo elementType)
682  {
683  return CStlClassInfoUtil::Get_set(elementType, &CreateTypeInfo);
684  }
685  static CTypeInfo* CreateTypeInfo(TTypeInfo elementType)
686  {
688  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
689  true);
690 
696 
697  return info;
698  }
699 };
700 
701 template<typename Data>
703 {
704 public:
706 
707  static TTypeInfo GetTypeInfo(TTypeInfo elementType)
708  {
709  return CStlClassInfoUtil::Get_multiset(elementType,
710  &CreateTypeInfo);
711  }
712  static CTypeInfo* CreateTypeInfo(TTypeInfo elementType)
713  {
715  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
716  true);
717 
723 
724  return info;
725  }
726 };
727 
728 template<typename Data, typename Comparator>
730 {
731 public:
733 
734  static TTypeInfo GetTypeInfo(TTypeInfo elementType)
735  {
736  static TTypeInfo info = 0;
738  elementType,
739  &CreateTypeInfo);
740  }
741  static CTypeInfo* CreateTypeInfo(TTypeInfo elementType)
742  {
744  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
745  true);
746 
752 
753  return info;
754  }
755 };
756 
757 template<typename Data, typename Comparator>
759 {
760 public:
762 
763  static TTypeInfo GetTypeInfo(TTypeInfo elementType)
764  {
765  static TTypeInfo info = 0;
767  elementType,
768  &CreateTypeInfo);
769  }
770  static CTypeInfo* CreateTypeInfo(TTypeInfo elementType)
771  {
773  new CStlOneArgTemplate(sizeof(TObjectType), elementType,
774  true);
775 
781 
782  return info;
783  }
784 };
785 
786 template<typename Key, typename Value>
788 {
789 public:
792 
793  static TTypeInfo GetTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
794  {
795  return CStlClassInfoUtil::Get_map(keyType, valueType,
796  &CreateTypeInfo);
797  }
798 
799  static CTypeInfo* CreateTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
800  {
801  TElementType* dummy = 0;
804  (sizeof(TObjectType),
805  keyType,
806  reinterpret_cast<TPointerOffsetType>(&dummy->first),
807  valueType,
808  reinterpret_cast<TPointerOffsetType>(&dummy->second),
809  true);
810 
816 
817  return info;
818  }
819 };
820 
821 template<typename Key, typename Value>
823 {
824 public:
827 
828  static TTypeInfo GetTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
829  {
830  return CStlClassInfoUtil::Get_multimap(keyType, valueType,
831  &CreateTypeInfo);
832  }
833 
834  static CTypeInfo* CreateTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
835  {
836  TElementType* dummy = 0;
839  (sizeof(TObjectType),
840  keyType,
841  reinterpret_cast<TPointerOffsetType>(&dummy->first),
842  valueType,
843  reinterpret_cast<TPointerOffsetType>(&dummy->second),
844  true);
845 
851 
852  return info;
853  }
854 };
855 
856 template<typename Key, typename Value, typename Comparator>
858 {
859 public:
862 
863  static TTypeInfo GetTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
864  {
865  static TTypeInfo info = 0;
867  keyType, valueType,
868  &CreateTypeInfo);
869  }
870 
871  static CTypeInfo* CreateTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
872  {
873  TElementType* dummy = 0;
876  (sizeof(TObjectType),
877  keyType,
878  reinterpret_cast<TPointerOffsetType>(&dummy->first),
879  valueType,
880  reinterpret_cast<TPointerOffsetType>(&dummy->second),
881  true);
882 
888 
889  return info;
890  }
891 };
892 
893 template<typename Key, typename Value, typename Comparator>
895 {
896 public:
899 
900  static TTypeInfo GetTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
901  {
902  static TTypeInfo info = 0;
904  keyType, valueType,
905  &CreateTypeInfo);
906  }
907 
908  static CTypeInfo* CreateTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
909  {
910  TElementType* dummy = 0;
913  (sizeof(TObjectType),
914  keyType,
915  reinterpret_cast<TPointerOffsetType>(&dummy->first),
916  valueType,
917  reinterpret_cast<TPointerOffsetType>(&dummy->second),
918  true);
919 
925 
926  return info;
927  }
928 };
929 
931 
932 /* @} */
933 
934 #endif /* STLTYPES__HPP */
unsigned dummy
Definition: block_cipher.h:0
AutoPtr –.
Definition: ncbimisc.hpp:401
CConstRef –.
Definition: ncbiobj.hpp:1266
CObjectIStream –.
Definition: objistr.hpp:93
CRef –.
Definition: ncbiobj.hpp:618
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Definition: typeinfo.hpp:76
container_type::value_type value_type
Definition: map.hpp:52
Definition: map.hpp:338
Definition: set.hpp:45
Include a standard set of the NCBI C++ Toolkit most basic headers.
char data[12]
Definition: iconv.c:80
element_type * get(void) const
Get pointer.
Definition: ncbimisc.hpp:469
ESerialRecursionMode
How to assign and compare child sub-objects of serial objects.
Definition: serialdef.hpp:191
static TObjectType & Get(TObjectPtr object)
Definition: serialutil.hpp:56
void * TObjectPtr
Definition: serialdef.hpp:55
const void * TConstObjectPtr
Definition: serialdef.hpp:59
ssize_t TPointerOffsetType
Definition: serialdef.hpp:241
@ eRecursive
Recursively.
Definition: serialdef.hpp:192
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1684
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static TTypeInfo Get_CRef(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:61
static TTypeInfo GetInfo(TTypeInfo &storage, TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:118
static TObjectPtr AddElementIn(const CContainerTypeInfo *containerType, TObjectPtr containerPtr, CObjectIStream &in)
Definition: stltypes.hpp:390
static TTypeInfo GetTypeInfo(TTypeInfo dataType)
Definition: stltypes.hpp:132
static TObjectPtr AddElementIn(const CContainerTypeInfo *containerType, TObjectPtr containerPtr, CObjectIStream &in)
Definition: stltypes.hpp:246
TTypeInfoIterator::TObjectPtr TObjectPtr
Definition: stltypes.hpp:415
static CTypeInfo * CreateTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:641
static TObjectPtr GetData(const CPointerTypeInfo *, TObjectPtr objectPtr)
Definition: stltypes.hpp:77
TObjectPtr GetContainerPtr(void) const
AutoPtr< TDataType > TObjectType
Definition: stltypes.hpp:166
set< Data, Comparator > TObjectType
Definition: stltypes.hpp:732
static CTypeInfo * CreateTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:770
static void CopyIterator(TTypeInfoIterator &dst, const TTypeInfoIterator &src)
Definition: stltypes.hpp:464
static bool EraseElement(TTypeInfoIterator &iter)
Definition: stltypes.hpp:546
CParent::TTypeInfoIterator TTypeInfoIterator
Definition: stltypes.hpp:538
TObjectType::value_type TElementType
Definition: stltypes.hpp:826
CStlClassInfoFunctions< Container > CParent
Definition: stltypes.hpp:416
static TTypeInfo GetSet_vector(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:91
static TTypeInfo Get_map(TTypeInfo arg1, TTypeInfo arg2, TTypeInfoCreator2 f)
Definition: stltypes.cpp:106
CParent::TObjectPtr TObjectPtr
Definition: stltypes.hpp:505
CParent::TStlIterator TStlIterator
Definition: stltypes.hpp:503
static TTypeInfo GetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:577
CStlClassInfoFunctions< Container > CParent
Definition: stltypes.hpp:289
static TTypeInfo GetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:763
static TObjectPtr CreateContainer(TTypeInfo, CObjectMemoryPool *)
Definition: stltypes.hpp:211
static void EraseAllElements(TTypeInfoIterator &iter)
Definition: stltypes.hpp:514
static TTypeInfo GetSet_list(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:81
static TTypeInfo GetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:707
static CTypeInfo * CreateTypeInfo(TTypeInfo dataType)
Definition: stltypes.hpp:172
CConstRef< TDataType > TObjectType
Definition: stltypes.hpp:130
static TTypeInfo Get_AutoPtr(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:71
CParent::TObjectType TObjectType
Definition: stltypes.hpp:363
static TObjectPtr GetData(const CPointerTypeInfo *, TObjectPtr objectPtr)
Definition: stltypes.hpp:145
static void SetAddElementFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:351
static void SetCountFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:301
static CTypeInfo * CreateTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
Definition: stltypes.hpp:799
static CTypeInfo * CreateTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:581
static TTypeInfo GetTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
Definition: stltypes.hpp:900
static void EraseAllElements(TTypeInfoIterator &iter)
Definition: stltypes.hpp:554
static TTypeInfo Get_set(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:96
static CTypeInfo * CreateTypeInfo(TTypeInfo dataType)
Definition: stltypes.hpp:136
static TTypeInfo GetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:734
map< Key, Value > TObjectType
Definition: stltypes.hpp:790
static TTypeInfo GetTypeInfo(TTypeInfo dataType)
Definition: stltypes.hpp:168
static TStlIterator & It(TTypeInfoIterator &iter)
Definition: stltypes.hpp:418
static TTypeInfo Get_multiset(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:101
TObjectType::value_type TElementType
Definition: stltypes.hpp:292
static TTypeInfo GetTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
Definition: stltypes.hpp:863
TObjectType::value_type TElementType
Definition: stltypes.hpp:898
static TTypeInfo GetTypeInfo(TTypeInfo dataType)
Definition: stltypes.hpp:98
static TTypeInfo GetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:681
static bool NextElement(TTypeInfoIterator &iter)
Definition: stltypes.hpp:470
static CTypeInfo * CreateTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:712
vector< Data > TObjectType
Definition: stltypes.hpp:634
CRef< TDataType > TObjectType
Definition: stltypes.hpp:96
static TTypeInfo Get_auto_ptr(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:56
static void SetFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:665
NCBI_NS_NCBI::TConstObjectPtr TObjectPtr
Definition: continfo.hpp:88
static void CannotGetElementOfSet(void)
Definition: stltypes.cpp:143
static void InsertElement(TObjectPtr containerPtr, const TElementType &element)
Definition: stltypes.hpp:316
static TObjectPtr GetElementPtr(const TTypeInfoIterator &)
Definition: stltypes.hpp:541
static TObjectPtr GetData(const CPointerTypeInfo *, TObjectPtr objectPtr)
Definition: stltypes.hpp:111
static void SetData(const CPointerTypeInfo *, TObjectPtr objectPtr, TObjectPtr dataPtr)
Definition: stltypes.hpp:186
static void SetIteratorFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:487
CStlClassInfoFunctionsIBase< Container, typename Container::iterator, Container *, typename Container::value_type &, CContainerTypeInfo::CIterator > CParent
Definition: stltypes.hpp:535
static TObjectPtr AddElement(const CContainerTypeInfo *, TObjectPtr containerPtr, TConstObjectPtr elementPtr, ESerialRecursionMode=eRecursive)
Definition: stltypes.hpp:375
multimap< Key, Value, Comparator > TObjectType
Definition: stltypes.hpp:897
static TObjectPtr AddElement(const CContainerTypeInfo *containerType, TObjectPtr containerPtr, TConstObjectPtr elementPtr, ESerialRecursionMode how=eRecursive)
Definition: stltypes.hpp:226
static void SetMemFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:272
Data TDataType
Definition: stltypes.hpp:95
TObjectType::value_type TElementType
Definition: stltypes.hpp:364
static void SetAddElementFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:276
set< Data > TObjectType
Definition: stltypes.hpp:679
static TTypeInfo GetSetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:598
static TTypeInfo GetSetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:651
static TTypeInfo GetTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
Definition: stltypes.hpp:828
TObjectType::value_type TElementType
Definition: stltypes.hpp:200
void ReadData(CObjectIStream &in, TObjectPtr object) const
CStlClassInfoFunctions< Container > CParent
Definition: stltypes.hpp:361
multiset< Data > TObjectType
Definition: stltypes.hpp:705
static TObjectPtr AddElementIn(const CContainerTypeInfo *containerType, TObjectPtr containerPtr, CObjectIStream &in)
Definition: stltypes.hpp:341
virtual void Assign(TObjectPtr dst, TConstObjectPtr src, ESerialRecursionMode how=eRecursive) const =0
Set object to copy of another one.
static size_t GetElementCount(const CContainerTypeInfo *, TConstObjectPtr containerPtr)
Definition: stltypes.hpp:265
static TTypeInfo Get_CConstRef(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:66
static TObjectPtr AddElement(const CContainerTypeInfo *, TObjectPtr containerPtr, TConstObjectPtr elementPtr, ESerialRecursionMode)
Definition: stltypes.hpp:326
multimap< Key, Value > TObjectType
Definition: stltypes.hpp:825
static CTypeInfo * CreateTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:741
CParent::TStlIterator TStlIterator
Definition: stltypes.hpp:537
static void SetFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:620
static void ReleaseIterator(TTypeInfoIterator &iter)
Definition: stltypes.hpp:453
static CTypeInfo * CreateTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
Definition: stltypes.hpp:871
TObjectType::value_type TElementType
Definition: stltypes.hpp:861
static TObjectPtr GetData(const CPointerTypeInfo *, TObjectPtr objectPtr)
Definition: stltypes.hpp:181
static bool InitIterator(TTypeInfoIterator &iter)
Definition: stltypes.hpp:440
CStlClassInfoFunctions< Container > CParent
Definition: stltypes.hpp:311
static CTypeInfo * CreateTypeInfo(TTypeInfo dataType)
Definition: stltypes.hpp:68
static bool EraseElement(TTypeInfoIterator &iter)
Definition: stltypes.hpp:507
unique_ptr< TDataType > TObjectType
Definition: stltypes.hpp:62
static TTypeInfo GetTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
Definition: stltypes.hpp:793
static CTypeInfo * CreateSetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:603
static CTypeInfo * CreateTypeInfo(TTypeInfo elementType, const string &name)
Definition: stltypes.hpp:589
static TObjectType & Get(TObjectPtr objectPtr)
Definition: stltypes.hpp:202
static void InsertElement(TObjectPtr containerPtr, const TElementType &element)
Definition: stltypes.hpp:366
static const TObjectType & Get(TConstObjectPtr objectPtr)
Definition: stltypes.hpp:206
static CTypeInfo * CreateTypeInfo(TTypeInfo dataType)
Definition: stltypes.hpp:102
list< Data > TObjectType
Definition: stltypes.hpp:575
static void SetDefault(TObjectPtr objectPtr)
Definition: stltypes.hpp:221
static void ThrowDuplicateElementError(void)
Definition: stltypes.cpp:148
static void SetIteratorFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:520
TypeInfoIterator TTypeInfoIterator
Definition: stltypes.hpp:414
static void SetIteratorFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:560
static TTypeInfo Get_multimap(TTypeInfo arg1, TTypeInfo arg2, TTypeInfoCreator2 f)
Definition: stltypes.cpp:112
multiset< Data, Comparator > TObjectType
Definition: stltypes.hpp:761
map< Key, Value, Comparator > TObjectType
Definition: stltypes.hpp:860
CStlClassInfoFunctionsIBase< Container, typename Container::iterator, Container *, typename Container::value_type &, CContainerTypeInfo::CIterator > CParent
Definition: stltypes.hpp:501
static const TStlIterator & It(const TTypeInfoIterator &iter)
Definition: stltypes.hpp:429
static CTypeInfo * CreateTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:685
static CTypeInfo * CreateSetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:656
static TTypeInfo Get_vector(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:86
void SetFunctions(TGetDataFunction getFunc, TSetDataFunction setFunc)
Definition: ptrinfo.cpp:90
TObjectType::value_type TElementType
Definition: stltypes.hpp:314
CParent::TObjectType TObjectType
Definition: stltypes.hpp:313
static void ReserveElements(const CContainerTypeInfo *, TObjectPtr containerPtr, size_t count)
Definition: stltypes.hpp:294
static void SetData(const CPointerTypeInfo *, TObjectPtr objectPtr, TObjectPtr dataPtr)
Definition: stltypes.hpp:116
static CTypeInfo * CreateTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
Definition: stltypes.hpp:834
CParent::TObjectType TObjectType
Definition: stltypes.hpp:291
TObjectType::value_type TElementType
Definition: stltypes.hpp:791
CStlClassInfoFunctionsIBase< Container, typename Container::const_iterator, const Container *, const typename Container::value_type &, CContainerTypeInfo::CConstIterator > CParent
Definition: stltypes.hpp:485
static void SetCountFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:280
CParent::TObjectPtr TObjectPtr
Definition: stltypes.hpp:539
static TTypeInfo GetTypeInfo(TTypeInfo dataType)
Definition: stltypes.hpp:64
static void SetData(const CPointerTypeInfo *, TObjectPtr objectPtr, TObjectPtr dataPtr)
Definition: stltypes.hpp:82
static TObjectPtr GetElementPtr(const TTypeInfoIterator &iter)
Definition: stltypes.hpp:474
static void SetAddElementFunctions(CStlOneArgTemplate *info)
Definition: stltypes.hpp:400
static CTypeInfo * CreateTypeInfo(TTypeInfo keyType, TTypeInfo valueType)
Definition: stltypes.hpp:908
static void SetData(const CPointerTypeInfo *, TObjectPtr objectPtr, TObjectPtr dataPtr)
Definition: stltypes.hpp:152
TTypeInfo GetElementType(void) const
static bool IsDefault(TConstObjectPtr objectPtr)
Definition: stltypes.hpp:217
static TTypeInfo Get_list(TTypeInfo arg, TTypeInfoCreator1 f)
Definition: stltypes.cpp:76
static TTypeInfo GetTypeInfo(TTypeInfo elementType)
Definition: stltypes.hpp:636
static CTypeInfo * CreateSetTypeInfo(TTypeInfo elementType, const string &name)
Definition: stltypes.hpp:611
CParent::TTypeInfoIterator TTypeInfoIterator
Definition: stltypes.hpp:504
static MDB_envinfo info
Definition: mdb_load.c:37
double value_type
The numeric datatype used by the parser.
Definition: muParserDef.h:228
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Useful/utility classes and methods.
std::istream & in(std::istream &in_, double &x_)
Modified on Mon Jul 15 05:32:06 2024 by modify_doxy.py rev. 669887