VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwPropertiesList.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
14 
39 {
40 private:
43 
44 public:
45 
48  DtRwPropertiesList(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
49  DtRwPropertiesList(const DtString& name, const DtPropertyInterface* prototype,
50  DtReaderWriterRegistry* parentRegistry = 0);
51  DtRwPropertiesList(const DtString& name, const DtRwPropertiesList& orig,
52  DtReaderWriterRegistry* parentRegistry = 0);
53  virtual ~DtRwPropertiesList() override;
55 
58 
65  virtual bool addItem(DtPropertyInterface* item);
66 
74  virtual DtPropertyInterface* addItem();
76 
79 
81  virtual void erase(DtPropertyInterface* item);
82 
92  virtual void erase(iterator pos);
94 
97  virtual const char *readerWriterType() const override;
98 
100  static const char* theXmlType();
101 
102  virtual const char *xmlType() const override {
103  return theXmlType();
104  }
105 
108  virtual char *encode(char *) const override;
109 
112  virtual const char *decode(const char *) override;
113 
116  virtual void getSize(int &size) const override;
117 
119  virtual int hlaAlignment() const override;
120 
122  virtual bool isValidProperty(const DtPropertyInterface *) const override;
123 
125  virtual int count() const override;
126 
128  virtual void getSelf(DtlObjPtr args,
129  const DtReaderWriter::SearchPaths &searchPaths =
131  const DtVariableBindingsList &variableBindings =
132  nullVariableReference()) override;
133 
134  virtual void writeSelf(std::string &fp, int indentLevel = 0,
135  bool writeUnspecified = false,
136  const DtFilename &path = DtFilename::nullFilename()) override;
137  virtual void writeData(std::string &fp, int indentLevel = 0,
138  bool writeUnspecified = false,
139  const DtFilename &path = DtFilename::nullFilename()) override;
140 
142  virtual void setPrototype(const DtPropertyInterface*);
143 
145  virtual const DtPropertyInterface* prototype() const;
146 
148  virtual DtPropertyInterface* clonePrototype(DtReaderWriterRegistry* parent = 0);
149 
151 
153  virtual bool isSimilarProperty(const DtPropertyInterface *rhs,
154  bool strict = true) const override;
155 
156  bool operator==(const DtRwPropertiesList&) const;
157 
158  virtual bool matchPrototype(const DtReaderWriter*) const;
159 
160 protected:
161  virtual void writePrototype(const DtReaderWriter*, std::string& fp, int indentLevel, bool writeHeader = true) const;
162  virtual void bindToRwAsVariable(const DtReaderWriter *rw) override;
163 
164  virtual void createListEntry(DtPropertyInterface* iFace,
165  DtlObjPtr variableItem,
166  const DtReaderWriter::SearchPaths& searchPaths,
167  const DtVariableBindingsList& variableBindings);
168 
169  virtual DtPropertyInterface* createPrototype(DtlObjPtr);
170  virtual DtlObjPtr variablesStart(DtlObjPtr args) const;
171 
173  virtual const char *decode(DtPropertyInterface *, const char *) override;
174 
175  virtual DtlObjPtr getData(DtlObjPtr variableList,
176  const DtReaderWriter::SearchPaths &searchPaths,
177  const DtVariableBindingsList &variableBindings) override;
178 
179  virtual void getData(const DtEnvironmentSP env, const DtEnvValueSP root,
180  const DtReaderWriter::SearchPaths &searchPaths,
181  const DtVariableBindingsList &varBindings) override;
182  virtual void putData(DtEnvironmentSP, DtEnvValueSP value) const override;
183 
184  virtual void assignPrototypeToChildren();
185 
186  virtual void setPrototypeIntoTarget(const DtPropertyInterface* prototype, DtReaderWriter* target);
187 
188  virtual void postWriteItem(std::string& fp, DtReaderWriter* rw, int indentLevel);
189  virtual void preWriteItem(std::string& fp, DtReaderWriter* rw, int indentLevel);
190 
191  virtual bool matchPrototype(const DtReaderWriter* prototype, const DtReaderWriter* match) const;
192 
194  virtual void cloneAndAddProperty(const DtReaderWriter &rw) override;
195 
196 protected:
199 };
DtRwProperties & operator=(const DtRwProperties &orig)
#define DT_DLL_readerWriter
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: readerWriterDefines.h:34
virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference()) override
Reads in items, using the factory to read the correct types.
virtual const char * xmlType() const override
Definition: rwPropertiesList.h:102
virtual void putData(std::string &, int indentLevel=0) override
Deriving class overrides these to get/put class specific data.
virtual void cloneAndAddProperty(const DtReaderWriter &rw)
Clones the given RW and tries to add it to this list.
voidpf void uLong size
Definition: ioapi.h:39
Definition: readerWriter.h:85
Definition: readerWriterRegistry.h:39
virtual const char * decode(const char *) override
Decodes the variable bindings from the specified buffer. Buffer should already be properly aligned to...
bool operator==(const DtRwVariableBindings &) const
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:53
virtual int hlaAlignment() const override
The required byte alignment of this property when encoding to HLA.
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
DtPropertyInterface * myPrototype
Definition: rwPropertiesList.h:197
int getSize() const
Returns the network size of this item in bytes. This does not include any upfront padding for alignme...
virtual void writeData(std::string &fp, int indentLevel, bool writeUnspecified, const DtFilename &path)
static const DtVariableBindingsList & nullVariableReference()
virtual char * encode(char *) const override
Encodes the variable bindings into the supplied buffer. Buffer must already be properly aligned to hl...
Defines the DtPropertyInterface class, the interface for all property classes.
virtual void writeSelf(std::string &fp, int indentLevel, bool writeUnspecified, const DtFilename &path) override
Writes out registry data, but includes the type strings when writing.
virtual const char * readerWriterType() const override
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
virtual void bindToRwAsVariable(const DtReaderWriter *rw)
Copies values from the specified DtReaderWriter. rw must point to the same subclassed type of DtReade...
Definition: rwProperty.h:343
virtual int count() const
Number of properties.
Acts as a DtRwList for properties. Only real difference between this class and a DtRwProperties class...
Definition: rwPropertiesList.h:38
Definition: rwProperties.h:21
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:122
DtRwPropertyInt myCount
Definition: rwPropertiesList.h:198
static const char * theXmlType()
The type that is used when archiving to an XML stream.
DT_DLL_readerWriter std::shared_ptr< DtEnvironment > DtEnvironmentSP
Definition: readerWriter.h:30
virtual bool isSimilarProperty(const DtPropertyInterface *rhs, bool strict=true) const
Returns true if the readerWriterType is the same. Subclasses can do extra checking. If strict is true, some property types will do extra checking and fail if the types do not exactly match. If false, these types will do a basic check, which can be useful when the the types are similar enough to perform a merge.
virtual bool isValidProperty(const DtPropertyInterface *) const
Returns true if this is a valid property for the properties list.
virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference()) override
Override to allow a variable to be assigned to a property of derived type.

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)