VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rwTemplatedList.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include "vrfutil/rwList.h"
12 #include "vrfutil/iteratorBase.h"
14 
15 #include "vrfutil/rwString.h"
16 #include "vrfutil/rwInt.h"
17 #include "vrfutil/rwReal.h"
18 
24 template <typename T, bool T_autoDelete>
26 {
27 public:
30 
33 
35  DtRwTemplatedListPtr(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL);
36  DtRwTemplatedListPtr(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL);
37 
41  DtReaderWriterRegistry* parentRegistry = NULL);
42 
43  DtRwTemplatedListPtr(const DtSymbolString& name, const DtRwTemplatedListPtr& orig,
44  DtReaderWriterRegistry* parentRegistry = NULL);
45 
48  DtReaderWriterRegistry* parentRegistry = NULL);
49 
51 
52  virtual ~DtRwTemplatedListPtr();
53 
54  DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
55  const DtVariableBindingsList& variableBindings);
56 
59  virtual DtListItem* add(T* data) {return DtRwList::add(data);};
60 
63  void removeAll();
64  void* remove(DtListItem* item);
65  void* remove(T* item);
66 
68  virtual std::set<DtString> supportedXmlTypes() const;
69 
71  void removeAndDeleteAll();
72 
74  bool operator==(const DtRwTemplatedListPtr&) const;
75  bool operator!=(const DtRwTemplatedListPtr&) const;
76 
77  static const char* theXmlType()
78  {
79  static DtString xmlType(DtString(T::theXmlType()) + "s");
80  return xmlType.c_str();
81  }
82 
83  virtual const char* xmlType() const
84  {
85  return theXmlType();
86  }
87 
88  //Populates list by looking add the templated list type
89  virtual void populateList(
90  boost::function<void (DtReaderWriter*)> addFunction,
91  DtEnvironmentSP env, DtEnvValueSP node,
92  const DtReaderWriter::SearchPaths& searchPaths, const DtVariableBindingsList& bindings);
93 
94 public:
95 
96  const char* readerWriterType() const;
97 
98  static const char* ListReaderWriterType();
99 
100  void copyList(const DtRwTemplatedListPtr& orig);
101 
102 protected:
104 };
105 
106 namespace DtBufferSerialize
107 {
110  template <typename T, bool T_autoDelete>
112 
116  template <typename T, bool T_autoDelete>
117  char *encode(const DtRwTemplatedListPtr<T, T_autoDelete>& val, char *buffer);
118 
123  template <typename T, bool T_autoDelete>
124  const char *decode(DtRwTemplatedListPtr<T, T_autoDelete>& val, const char *buffer) ;
125 };
126 
128 {
129 public:
132 
134  DtRwTemplatedStringList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
135  : DtRwTemplatedListPtr<DtRwString, true>(name, parentRegistry) {};
136  DtRwTemplatedStringList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
137  : DtRwTemplatedListPtr<DtRwString, true>(name, parentRegistry) {};
138 
140  DtReaderWriterRegistry* parentRegistry = NULL)
141  : DtRwTemplatedListPtr<DtRwString, true>(name, orig, parentRegistry) {};
142 
143  DtRwTemplatedStringList(const DtSymbolString& name, const DtRwTemplatedStringList& orig,
144  DtReaderWriterRegistry* parentRegistry = NULL)
145  : DtRwTemplatedListPtr<DtRwString, true>(name, orig, parentRegistry) {};
146 
148  DtReaderWriterRegistry* parentRegistry = NULL)
149  : DtRwTemplatedListPtr<DtRwString, true>(orig, parentRegistry) {};
150 };
151 
153 {
154 public:
157 
159  DtRwTemplatedIntList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
160  : DtRwTemplatedListPtr<DtRwInt, true>(name, parentRegistry) {};
161 
162  DtRwTemplatedIntList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
163  : DtRwTemplatedListPtr<DtRwInt, true>(name, parentRegistry) {};
164 
166  DtReaderWriterRegistry* parentRegistry = NULL)
167  : DtRwTemplatedListPtr<DtRwInt, true>(name, orig, parentRegistry) {};
168 
169  DtRwTemplatedIntList(const DtSymbolString& name, const DtRwTemplatedIntList& orig,
170  DtReaderWriterRegistry* parentRegistry = NULL)
171  : DtRwTemplatedListPtr<DtRwInt, true>(name, orig, parentRegistry) {};
172 
174  DtReaderWriterRegistry* parentRegistry = NULL)
175  : DtRwTemplatedListPtr<DtRwInt, true>(orig, parentRegistry) {};
176 };
177 
179 {
180 public:
183 
185  DtRwTemplatedRealList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
186  : DtRwTemplatedListPtr<DtRwReal, true>(name, parentRegistry) {};
187 
188  DtRwTemplatedRealList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
189  : DtRwTemplatedListPtr<DtRwReal, true>(name, parentRegistry) {};
190 
192  DtReaderWriterRegistry* parentRegistry = NULL)
193  : DtRwTemplatedListPtr<DtRwReal, true>(name, orig, parentRegistry) {};
194 
195  DtRwTemplatedRealList(const DtSymbolString& name, const DtRwTemplatedRealList& orig,
196  DtReaderWriterRegistry* parentRegistry = NULL)
197  : DtRwTemplatedListPtr<DtRwReal, true>(name, orig, parentRegistry) {};
198 
200  DtReaderWriterRegistry* parentRegistry = NULL)
201  : DtRwTemplatedListPtr<DtRwReal, true>(orig, parentRegistry) {};
202 };
203 
204 #include "vrfutil/rwTemplatedList.inl"

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)