home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 720 / PDF090B4-SorceCode / pdf / Array.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  1.2 KB  |  62 lines

  1. //========================================================================
  2. //
  3. // Array.h
  4. //
  5. // Copyright 1996 Derek B. Noonburg
  6. //
  7. //========================================================================
  8. //
  9. // Ported to EPOC by Sander van der Wal
  10. //
  11. // $Id: Array.h 1.2 2000-09-17 13:38:26+02 svdwal Exp svdwal $
  12.  
  13. #ifndef ARRAY_H
  14. #define ARRAY_H
  15.  
  16. #ifdef __GNUC__
  17. #pragma interface
  18. #endif
  19.  
  20. #ifndef __E32BASE_H__
  21. #include <e32base.h>
  22. #endif
  23.  
  24. class Object;
  25.  
  26. //------------------------------------------------------------------------
  27. // Array
  28. //------------------------------------------------------------------------
  29.  
  30. class Array: public CBase {
  31. public:
  32.  
  33.   // Constructor.
  34.   Array();
  35.  
  36.   // Destructor.
  37.   ~Array();
  38.  
  39.   // Reference counting.
  40.   int incRef() { return ++ref; }
  41.   int decRef() { return --ref; }
  42.  
  43.   // Get number of elements.
  44.   int getLength() { return length; }
  45.  
  46.   // Add an element.
  47.   void addL(Object *elem);
  48.  
  49.   // Accessors.
  50.   Object *getL(int i, Object *obj);
  51.   Object *getNFL(int i, Object *obj);
  52.  
  53. private:
  54.  
  55.   Object *elems;        // array of elements
  56.   int size;            // size of <elems> array
  57.   int length;            // number of elements in array
  58.   int ref;            // reference count
  59. };
  60.  
  61. #endif
  62.