Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdObjectArray.h

00001 // rdObjectArray.h
00002 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00003 // Copyright 2003 Realistic Dynamics, Inc.
00004 // All rights reserved.
00005 //
00006 // Please do not read, copy, distribute, or use without permission.
00007 // Contact: Frank C. Anderson, fca@RealisticDynamics.com
00008 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00009 #ifndef __rdObjectArray_h__
00010 #define __rdObjectArray_h__
00011 
00012 
00013 #include "rdTools.h"
00014 #include "rdObject.h"
00015 
00016 #define rdObjectArray_CAPMIN 1;
00017 
00018 //=============================================================================
00019 //=============================================================================
00030 class RDTOOLS_API rdObjectArray : public rdObject
00031 {
00032 
00033 //=============================================================================
00034 // DATA
00035 //=============================================================================
00036 private:
00038    int _firstEmpty;
00039 protected:
00041    static const int CAPMIN;
00043    char *_descrip;
00045    int _capacity;
00048    int _capacityIncrement;
00050    rdObject **_array;
00051 
00052 
00053 //=============================================================================
00054 // METHODS
00055 //=============================================================================
00056 public:
00057    rdObjectArray(int aCapacity=128,const char *aName="UNKNOWN");
00058    rdObjectArray(const char *aFileName);
00059    rdObjectArray(IDOM_Element *aElement);
00060    virtual ~rdObjectArray();
00061 
00062 private:
00063    //--------------------------------------------------------------------------
00064    // CONSTRUCTION METHODS
00065    //--------------------------------------------------------------------------
00066    void allocateCapacity();
00067    void setNull();
00068 public:
00069 
00070    //--------------------------------------------------------------------------
00071    // GET AND SET
00072    //--------------------------------------------------------------------------
00073    virtual void setDescription(const char *aDescrip=NULL);
00074    virtual const char* getDescription() const;
00075    virtual bool ensureCapacity(int aCapacity);
00076    virtual int getCapacity() const;
00077    virtual void setCapacityIncrement(int aIncrement=-1);
00078    virtual int getCapacityIncrement() const;
00079 
00080    //--------------------------------------------------------------------------
00081    // RESET
00082    //--------------------------------------------------------------------------
00083    virtual void reset();
00084    virtual void reset(int aIndex);
00085 
00086    //--------------------------------------------------------------------------
00087    // STORAGE
00088    //--------------------------------------------------------------------------
00089    virtual int getFirstEmpty() const;
00090    virtual int getIndex(const char *aName,int aStart=0) const;
00091    virtual int getIndex(rdObject *aObject) const;
00092    virtual rdObject* set(int aIndex,rdObject *aObject);
00093    virtual rdObject* get(int aIndex) const;
00094    virtual rdObject* getLast() const;
00095    virtual int append(rdObject *aObject);
00096    virtual int append(rdObjectArray *aArray);
00097    virtual rdObject* remove(int aIndex);
00098    virtual rdObject* remove(rdObject *aObject);
00099 
00100    //--------------------------------------------------------------------------
00101    // XML
00102    //--------------------------------------------------------------------------
00103    virtual void updateObject(bool aDeep=true);
00104    virtual void updateNode(bool aDeep=true);
00105 
00106 //=============================================================================
00107 }; // END of class rdObjectArray
00108 //=============================================================================
00109 //=============================================================================
00110 
00111 #endif //__rdObjectArray_h__

Generated on Wed Aug 20 02:17:06 2003 for Simulation Software by doxygen1.3