home *** CD-ROM | disk | FTP | other *** search
- //========================================================================
- //
- // Array.h
- //
- // Copyright 1996 Derek B. Noonburg
- //
- //========================================================================
- //
- // Ported to EPOC by Sander van der Wal
- //
- // $Id: Array.h 1.2 2000-09-17 13:38:26+02 svdwal Exp svdwal $
-
- #ifndef ARRAY_H
- #define ARRAY_H
-
- #ifdef __GNUC__
- #pragma interface
- #endif
-
- #ifndef __E32BASE_H__
- #include <e32base.h>
- #endif
-
- class Object;
-
- //------------------------------------------------------------------------
- // Array
- //------------------------------------------------------------------------
-
- class Array: public CBase {
- public:
-
- // Constructor.
- Array();
-
- // Destructor.
- ~Array();
-
- // Reference counting.
- int incRef() { return ++ref; }
- int decRef() { return --ref; }
-
- // Get number of elements.
- int getLength() { return length; }
-
- // Add an element.
- void addL(Object *elem);
-
- // Accessors.
- Object *getL(int i, Object *obj);
- Object *getNFL(int i, Object *obj);
-
- private:
-
- Object *elems; // array of elements
- int size; // size of <elems> array
- int length; // number of elements in array
- int ref; // reference count
- };
-
- #endif
-