VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 #include "vrfutil/rwUUID.h"
19 
25 template <typename T, bool T_autoDelete>
27 {
28 public:
31 
34 
36  DtRwTemplatedListPtr(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL);
37  DtRwTemplatedListPtr(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL);
38 
42  DtReaderWriterRegistry* parentRegistry = NULL);
43 
45  DtReaderWriterRegistry* parentRegistry = NULL);
46 
49  DtReaderWriterRegistry* parentRegistry = NULL);
50 
52 
53  virtual ~DtRwTemplatedListPtr();
54 
55  DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
56  const DtVariableBindingsList& variableBindings);
57 
60  virtual DtListItem* add(T* data) {return DtRwList::add(data);};
61 
64  void removeAll();
65  void* remove(DtListItem* item);
66  void* remove(T* item);
67 
69  virtual std::set<DtString> supportedXmlTypes() const;
70 
72  void removeAndDeleteAll();
73 
75  bool operator==(const DtRwTemplatedListPtr&) const;
76  bool operator!=(const DtRwTemplatedListPtr&) const;
77 
78  static const char* theXmlType()
79  {
80  static DtString xmlType(DtString(T::theXmlType()) + "s");
81  return xmlType.c_str();
82  }
83 
84  virtual const char* xmlType() const
85  {
86  return theXmlType();
87  }
88 
89  //Populates list by looking add the templated list type
90  virtual void populateList(
91  boost::function<void (DtReaderWriter*)> addFunction,
92  DtEnvironmentSP env, DtEnvValueSP node,
93  const DtReaderWriter::SearchPaths& searchPaths, const DtVariableBindingsList& bindings);
94 
96  DtListItem* find( boost::function< bool (const T&)> predFcn) const;
97 
98 public:
99 
100  const char* readerWriterType() const;
101 
102  static const char* ListReaderWriterType();
103 
104  void copyList(const DtRwTemplatedListPtr& orig);
105 
106 protected:
108 };
109 
110 namespace DtBufferSerialize
111 {
114  template <typename T, bool T_autoDelete>
116 
120  template <typename T, bool T_autoDelete>
121  char *encode(const DtRwTemplatedListPtr<T, T_autoDelete>& val, char *buffer);
122 
127  template <typename T, bool T_autoDelete>
128  const char *decode(DtRwTemplatedListPtr<T, T_autoDelete>& val, const char *buffer) ;
129 };
130 
132 {
133 public:
136 
138  DtRwTemplatedStringList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
139  : DtRwTemplatedListPtr<DtRwString, true>(name, parentRegistry) {};
140  DtRwTemplatedStringList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
141  : DtRwTemplatedListPtr<DtRwString, true>(name, parentRegistry) {};
142 
144  DtReaderWriterRegistry* parentRegistry = NULL)
145  : DtRwTemplatedListPtr<DtRwString, true>(name, orig, parentRegistry) {};
146 
148  DtReaderWriterRegistry* parentRegistry = NULL)
149  : DtRwTemplatedListPtr<DtRwString, true>(name, orig, parentRegistry) {};
150 
152  DtReaderWriterRegistry* parentRegistry = NULL)
153  : DtRwTemplatedListPtr<DtRwString, true>(orig, parentRegistry) {};
154 };
155 
157 {
158 public:
161 
163  DtRwTemplatedUUIDList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
164  : DtRwTemplatedListPtr<DtRwUUID, true>(name, parentRegistry) {};
165  DtRwTemplatedUUIDList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
166  : DtRwTemplatedListPtr<DtRwUUID, true>(name, parentRegistry) {};
167 
169  DtReaderWriterRegistry* parentRegistry = NULL)
170  : DtRwTemplatedListPtr<DtRwUUID, true>(name, orig, parentRegistry) {};
171 
173  DtReaderWriterRegistry* parentRegistry = NULL)
174  : DtRwTemplatedListPtr<DtRwUUID, true>(name, orig, parentRegistry) {};
175 
177  DtReaderWriterRegistry* parentRegistry = NULL)
178  : DtRwTemplatedListPtr<DtRwUUID, true>(orig, parentRegistry) {};
179 };
180 
182 {
183 public:
186 
188  DtRwTemplatedIntList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
189  : DtRwTemplatedListPtr<DtRwInt, true>(name, parentRegistry) {};
190 
191  DtRwTemplatedIntList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
192  : DtRwTemplatedListPtr<DtRwInt, true>(name, parentRegistry) {};
193 
195  DtReaderWriterRegistry* parentRegistry = NULL)
196  : DtRwTemplatedListPtr<DtRwInt, true>(name, orig, parentRegistry) {};
197 
199  DtReaderWriterRegistry* parentRegistry = NULL)
200  : DtRwTemplatedListPtr<DtRwInt, true>(name, orig, parentRegistry) {};
201 
203  DtReaderWriterRegistry* parentRegistry = NULL)
204  : DtRwTemplatedListPtr<DtRwInt, true>(orig, parentRegistry) {};
205 };
206 
208 {
209 public:
212 
214  DtRwTemplatedRealList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
215  : DtRwTemplatedListPtr<DtRwReal, true>(name, parentRegistry) {};
216 
217  DtRwTemplatedRealList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
218  : DtRwTemplatedListPtr<DtRwReal, true>(name, parentRegistry) {};
219 
221  DtReaderWriterRegistry* parentRegistry = NULL)
222  : DtRwTemplatedListPtr<DtRwReal, true>(name, orig, parentRegistry) {};
223 
225  DtReaderWriterRegistry* parentRegistry = NULL)
226  : DtRwTemplatedListPtr<DtRwReal, true>(name, orig, parentRegistry) {};
227 
229  DtReaderWriterRegistry* parentRegistry = NULL)
230  : DtRwTemplatedListPtr<DtRwReal, true>(orig, parentRegistry) {};
231 };
232 
233 #include "vrfutil/rwTemplatedList.inl"

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)