![]() |
Public API Reference |
Go to the source code of this file.
Compounds | |
class | csStaticArray |
Helper class for CS_DECLARE_STATIC_ARRAY. More... | |
Defines | |
#define | CS_DECLARE_STATIC_ARRAY(Name, Type) CS_PRIVATE_DECLARE_STATIC_ARRAY (Name, Type) |
Definition in file sarray.h.
|
|
|
Value: class Name : public csStaticArray \ { \ typedef Type cont_type; \ private: \ void *AllocateArray (int n) const {return new cont_type[n];} \ void DeleteArray (void *a) const {delete[] ((cont_type*)a);} \ void CopyArray (void *Dest, void *Src, int n) const \ {memcpy (Dest, Src, n*sizeof (cont_type)); } \ public: \ inline Name (int Size = 0) : \ csStaticArray (Size) {} \ virtual ~Name () \ { Clear (); } \ inline cont_type *GetArray () \ { return (cont_type*)Map; } \ inline const cont_type *GetArray () const \ { return (cont_type*)Map; } \ inline void Copy (cont_type *NewData, int NewSize, bool DeleteOld = true) \ { csStaticArray::Copy (NewData, NewSize, DeleteOld); } \ inline void Copy (const Name *other, bool DeleteOld = true) \ { csStaticArray::Copy (other, DeleteOld); } \ inline void TakeOver (cont_type *NewData, int NewSize, bool DeleteOld = true) \ { csStaticArray::TakeOver (NewData, NewSize, DeleteOld); } \ inline void TakeOver (Name *other, bool DeleteOld = true) \ { csStaticArray::TakeOver (other, DeleteOld); } \ inline cont_type &operator[] (int n) \ { return GetArray () [n]; } \ inline const cont_type &operator[] (int n) const \ { return GetArray () [n]; } \ } |