VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwPropertiesFixedArray.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 
12 
34 {
35 private:
38 
39 public:
40 
43  DtRwPropertiesFixedArray(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
44  DtRwPropertiesFixedArray(const DtString& name, const DtString& keyType,
45  const DtPropertyInterface* prototype, DtReaderWriterRegistry* parentRegistry = 0);
47  DtReaderWriterRegistry* parentRegistry = 0);
48  virtual ~DtRwPropertiesFixedArray() override;
50 
53  virtual void setFixedSize(unsigned s);
54 
57  virtual void setFixedSize(unsigned s, const DtPropertyInterface* prototype);
58 
62  virtual const char *readerWriterType() const override;
63 
65  static const char* theXmlType();
66 
67  virtual const char *xmlType() const override {
68  return theXmlType();
69  }
70 
73  virtual char *encode(char *) const override;
74 
77  virtual const char *decode(const char *) override;
78 
81  virtual void getSize(int &size) const override;
82 
84  virtual bool isSimilarProperty(const DtPropertyInterface *rhs,
85  bool strict = true) const override;
86 
87  bool operator==(const DtRwPropertiesFixedArray&) const;
88 
89 protected:
90 
92  virtual DtPropertyInterface *createPrototype(DtlObjPtr args) override;
93  virtual DtlObjPtr variablesStart(DtlObjPtr args) const override;
94 
95  virtual int hlaAlignment(const DtPropertyInterface *field) const override;
96 
101  virtual DtPropertyInterface *
102  clonePrototype(DtReaderWriterRegistry *parent = 0) override;
103 
104 private:
105 
107  virtual bool addItem(DtPropertyInterface *item) override { return false; };
108 
110  virtual DtPropertyInterface *addItem() override { return 0; };
111 
113  virtual void erase(DtPropertyInterface *item) override {};
114 
116  virtual void erase(iterator pos) override {};
117 
118 protected:
119 
121  unsigned myNextPropertyIndex;
122 
123 };
#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 DtPropertyInterface * addItem() override
Items cannot be added to a fixed array.
Definition: rwPropertiesFixedArray.h:110
virtual DtlObjPtr variablesStart(DtlObjPtr args) const
virtual void erase(DtPropertyInterface *item) override
Items cannot be removed from a fixed array.
Definition: rwPropertiesFixedArray.h:113
virtual char * encode(char *) const override
Encodes the property into the supplied buffer. Does not align the property. Buffer must already be al...
virtual const char * decode(const char *) override
Decodes the property from the specified buffer. Assumes buffer is the start of the property and prece...
voidpf void uLong size
Definition: ioapi.h:39
virtual int hlaAlignment() const override
The required byte alignment of this property when encoding to HLA.
Definition: readerWriterRegistry.h:39
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:53
Acts as a fixed array for properties. This is essentially the same as a DtRwPropertiesList, except that the number of entries is fixed and the size is not encoded on the network.
Definition: rwPropertiesFixedArray.h:33
virtual DtPropertyInterface * createPrototype(DtlObjPtr)
virtual bool isSimilarProperty(const DtPropertyInterface *rhs, bool strict=true) const override
Returns true prototype is the same.
int getSize() const
Returns the network size of this item in bytes. This does not include any upfront padding for alignme...
virtual const char * xmlType() const override
Definition: rwPropertiesFixedArray.h:67
virtual DtPropertyInterface * clonePrototype(DtReaderWriterRegistry *parent=0)
Returns a clone of the prototype that belongs to this list.
virtual bool addItem(DtPropertyInterface *item) override
Items cannot be added to a fixed array.
Definition: rwPropertiesFixedArray.h:107
bool operator==(const DtRwPropertiesList &) const
virtual void erase(DtPropertyInterface *item)
Erases the specified item.
Acts as a DtRwList for properties. Only real difference between this class and a DtRwProperties class...
Definition: rwPropertiesList.h:38
Definition: rwProperties.h:21
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...
static const char * theXmlType()
The type that is used when archiving to an XML stream.

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)