VR-Forces 4.7 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 "readerWriter/rwList.h"
12 #include "vrfutil/iteratorBase.h"
14 
15 #include "readerWriter/rwString.h"
16 #include "readerWriter/rwInt.h"
17 #include "readerWriter/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  virtual DtString prettyPrint() const;
99 
100 public:
101 
102  const char* readerWriterType() const;
103 
104  static const char* ListReaderWriterType();
105 
106  void copyList(const DtRwTemplatedListPtr& orig);
107 
108 protected:
110 };
111 
112 namespace DtBufferSerialize
113 {
116  template <typename T, bool T_autoDelete>
118 
122  template <typename T, bool T_autoDelete>
123  char *encode(const DtRwTemplatedListPtr<T, T_autoDelete>& val, char *buffer);
124 
129  template <typename T, bool T_autoDelete>
130  const char *decode(DtRwTemplatedListPtr<T, T_autoDelete>& val, const char *buffer) ;
131 };
132 
134 {
135 public:
138 
140  DtRwTemplatedStringList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
141  : DtRwTemplatedListPtr<DtRwString, true>(name, parentRegistry) {};
142  DtRwTemplatedStringList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
143  : DtRwTemplatedListPtr<DtRwString, true>(name, parentRegistry) {};
144 
146  DtReaderWriterRegistry* parentRegistry = NULL)
147  : DtRwTemplatedListPtr<DtRwString, true>(name, orig, parentRegistry) {};
148 
150  DtReaderWriterRegistry* parentRegistry = NULL)
151  : DtRwTemplatedListPtr<DtRwString, true>(name, orig, parentRegistry) {};
152 
154  DtReaderWriterRegistry* parentRegistry = NULL)
155  : DtRwTemplatedListPtr<DtRwString, true>(orig, parentRegistry) {};
156 };
157 
159 {
160 public:
163 
165  DtRwTemplatedUUIDList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
166  : DtRwTemplatedListPtr<DtRwUUID, true>(name, parentRegistry) {};
167  DtRwTemplatedUUIDList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
168  : DtRwTemplatedListPtr<DtRwUUID, true>(name, parentRegistry) {};
169 
171  DtReaderWriterRegistry* parentRegistry = NULL)
172  : DtRwTemplatedListPtr<DtRwUUID, true>(name, orig, parentRegistry) {};
173 
175  DtReaderWriterRegistry* parentRegistry = NULL)
176  : DtRwTemplatedListPtr<DtRwUUID, true>(name, orig, parentRegistry) {};
177 
179  DtReaderWriterRegistry* parentRegistry = NULL)
180  : DtRwTemplatedListPtr<DtRwUUID, true>(orig, parentRegistry) {};
181 };
182 
184 {
185 public:
188 
190  DtRwTemplatedIntList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
191  : DtRwTemplatedListPtr<DtRwInt, true>(name, parentRegistry) {};
192 
193  DtRwTemplatedIntList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
194  : DtRwTemplatedListPtr<DtRwInt, true>(name, parentRegistry) {};
195 
197  DtReaderWriterRegistry* parentRegistry = NULL)
198  : DtRwTemplatedListPtr<DtRwInt, true>(name, orig, parentRegistry) {};
199 
201  DtReaderWriterRegistry* parentRegistry = NULL)
202  : DtRwTemplatedListPtr<DtRwInt, true>(name, orig, parentRegistry) {};
203 
205  DtReaderWriterRegistry* parentRegistry = NULL)
206  : DtRwTemplatedListPtr<DtRwInt, true>(orig, parentRegistry) {};
207 };
208 
210 {
211 public:
214 
216  DtRwTemplatedRealList(const DtString& name, DtReaderWriterRegistry* parentRegistry = NULL)
217  : DtRwTemplatedListPtr<DtRwReal, true>(name, parentRegistry) {};
218 
219  DtRwTemplatedRealList(const DtSymbolString& name, DtReaderWriterRegistry* parentRegistry = NULL)
220  : DtRwTemplatedListPtr<DtRwReal, true>(name, parentRegistry) {};
221 
223  DtReaderWriterRegistry* parentRegistry = NULL)
224  : DtRwTemplatedListPtr<DtRwReal, true>(name, orig, parentRegistry) {};
225 
227  DtReaderWriterRegistry* parentRegistry = NULL)
228  : DtRwTemplatedListPtr<DtRwReal, true>(name, orig, parentRegistry) {};
229 
231  DtReaderWriterRegistry* parentRegistry = NULL)
232  : DtRwTemplatedListPtr<DtRwReal, true>(orig, parentRegistry) {};
233 };
234 
235 #include "vrfutil/rwTemplatedList.inl"

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)