VR-Forces 5.0.1 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) 2019 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();
50 
53  virtual void setFixedSize(unsigned s);
54 
57  virtual void setFixedSize(unsigned s, const DtPropertyInterface* prototype);
58 
62  virtual const char* readerWriterType() const;
63 
65  static const char* theXmlType();
66 
67  virtual const char* xmlType() const
68  {
69  return theXmlType();
70  }
71 
74  virtual char* encode(char*) const;
75 
78  virtual const char* decode(const char*);
79 
82  virtual void getSize(int& size) const;
83 
85  virtual bool isSimilarProperty(const DtPropertyInterface* rhs, bool strict = true) const;
86 
87  bool operator==(const DtRwPropertiesFixedArray&) const;
88 
89 protected:
90 
92  virtual DtPropertyInterface* createPrototype(DtlObjPtr args);
93  virtual DtlObjPtr variablesStart(DtlObjPtr args) const;
94 
95  virtual int hlaAlignment(const DtPropertyInterface* field) const;
96 
102 
103 private:
104 
106  virtual bool addItem(DtPropertyInterface* item) { return false; };
107 
109  virtual DtPropertyInterface* addItem() { return 0; };
110 
112  virtual void erase(DtPropertyInterface* item) {};
113 
115  virtual void erase(iterator pos) {};
116 
117 protected:
118 
120  unsigned myNextPropertyIndex;
121 
122 };
virtual DtPropertyInterface * addItem()
Items cannot be added to a fixed array.
Definition: rwPropertiesFixedArray.h:109
#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 DtlObjPtr variablesStart(DtlObjPtr args) const
voidpf void uLong size
Definition: ioapi.h:39
virtual void erase(DtPropertyInterface *item)
Items cannot be removed from a fixed array.
Definition: rwPropertiesFixedArray.h:112
Definition: readerWriterRegistry.h:39
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:48
virtual bool isSimilarProperty(const DtPropertyInterface *rhs, bool strict=true) const
Returns true prototype is the same.
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 char * encode(char *) const
Encodes the property into the supplied buffer. Does not align the property. Buffer must already be al...
virtual DtPropertyInterface * createPrototype(DtlObjPtr)
virtual const char * decode(const char *)
Decodes the property from the specified buffer. Assumes buffer is the start of the property and prece...
int getSize() const
Returns the network size of this item in bytes. This does not include any upfront padding for alignme...
virtual DtPropertyInterface * clonePrototype(DtReaderWriterRegistry *parent=0)
Returns a clone of the prototype that belongs to this list.
virtual const char * xmlType() const
Definition: rwPropertiesFixedArray.h:67
virtual bool addItem(DtPropertyInterface *item)
Items cannot be added to a fixed array.
Definition: rwPropertiesFixedArray.h:106
bool operator==(const DtRwPropertiesList &) const
virtual void erase(DtPropertyInterface *item)
Erases the item at the specified iterator position.
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
Acts as a DtRwList for properties. Only real difference between this class and a DtRwProperties class...
Definition: rwPropertiesList.h:38
Definition: rwProperties.h:25
virtual int hlaAlignment() const
The required byte alignment of this property when encoding to HLA.
static const char * theXmlType()
The type that is used when archiving to an XML stream.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)