VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwPropertiesStructure.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
10 
11 #pragma once
12 
14 
22 {
23 public:
24  // Implement so can be used in a map
26 
27  DtRwPropertiesStructure(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
29  DtReaderWriterRegistry* parentRegistry = 0);
31  DtReaderWriterRegistry* parentRegistry = 0);
33  virtual ~DtRwPropertiesStructure();
34 
41  inline const DtPropertyInterface* findFieldPropertyInterface(const DtString& fieldName) const
42  {
43  return findPropertyInterface(fieldName);
44  }
45 
46  inline DtPropertyInterface* findFieldPropertyInterface(const DtString& fieldName)
47  {
48  return findPropertyInterface(fieldName);
49  }
51 
59  template <typename SpecificPropType>
60  const SpecificPropType* findField(const DtString& fieldName) const
61  {
62  return findProperty<SpecificPropType>(fieldName);
63  }
64 
65  template <typename SpecificPropType>
66  SpecificPropType* findField(const DtString& fieldName)
67  {
68  return findProperty<SpecificPropType>(fieldName);
69  }
71 
80  template <typename ValueType>
81  boost::optional<ValueType> findFieldValue(const DtString& fieldName) const
82  {
83  return findPropertyValue<ValueType>(fieldName);
84  }
85 
92  template <typename ValueType>
93  bool findAndSetFieldValue(const DtString& fieldName, ValueType val)
94  {
95  return findAndSetPropertyValue<ValueType>(fieldName, val);
96  }
98 
106  virtual bool addField(DtPropertyInterface* field)
107  {
108  return addProperty(field);
109  }
110 
116  template <typename SpecificPropType>
117  SpecificPropType* addNewField(const DtString& fieldName)
118  {
119  return addNewProperty<SpecificPropType>(fieldName);
120  }
122 
129  virtual bool removeField(const DtString& propertyName)
130  {
131  return removeProperty(propertyName);
132  }
133 
134  virtual bool removeField(const DtPropertyInterface* property)
135  {
136  return removeProperty(property);
137  }
139 
147  DtPropertyInterface& operator[](const DtString& fieldName);
148 
149  const DtPropertyInterface& operator[](const DtString& fieldName) const;
151 
152  virtual void putSelf(std::string& fp, int indentLevel, bool writeUnspecified,
153  const DtFilename& path);
154 
155  virtual const char* readerWriterType() const;
156 
158  static const char* theXmlType();
159 
160  virtual const char* xmlType() const
161  {
162  return theXmlType();
163  }
164 
166  virtual bool isSimilarProperty(const DtPropertyInterface* rhs, bool strict = true) const;
167 
168 protected:
169  virtual void getData(const DtEnvironmentSP env, const DtEnvValueSP root,
170  const DtReaderWriter::SearchPaths& searchPaths, const DtVariableBindingsList& varBindings);
171  virtual void putData(DtEnvironmentSP, DtEnvValueSP value) const;
172 
173 protected:
174 
176 };
177 

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)