root / trunk / libraries / libjni-readecw-linux / include / NCSObjectList.h @ 1868
History | View | Annotate | Download (2.08 KB)
1 | 1448 | igbrotru | /*******************************************************
|
---|---|---|---|
2 | ** Copyright 1999 Earth Resource Mapping Ltd.
|
||
3 | ** This document contains proprietary source code of
|
||
4 | ** Earth Resource Mapping Ltd, and can only be used under
|
||
5 | ** one of the three licenses as described in the
|
||
6 | ** license.txt file supplied with this distribution.
|
||
7 | ** See separate license.txt file for license details
|
||
8 | ** and conditions.
|
||
9 | **
|
||
10 | ** This software is covered by US patent #6,442,298,
|
||
11 | ** #6,102,897 and #6,633,688. Rights to use these patents
|
||
12 | ** is included in the license agreements.
|
||
13 | **
|
||
14 | ** FILE: CNCSObjectList.cpp
|
||
15 | ** CREATED: Wed Oct 18 2000
|
||
16 | ** AUTHOR: Jeff Pudwell
|
||
17 | ** PURPOSE: Class to store lists of Objects.
|
||
18 | **
|
||
19 | ** EDITS:
|
||
20 | *******************************************************/
|
||
21 | |||
22 | |||
23 | #ifndef NCSOBJECTLIST_H_
|
||
24 | #define NCSOBJECTLIST_H_
|
||
25 | |||
26 | |||
27 | #include "NCSTypes.h" |
||
28 | #include "NCSDefs.h" |
||
29 | #include "NCSMalloc.h" |
||
30 | #include "NCSUtil.h" |
||
31 | |||
32 | #ifdef MACINTOSH
|
||
33 | #define NCS_OBJECT_BAD_NODE (INT32)-1 |
||
34 | #define NCS_OBJECT_FIRST_NODE (INT32)0 |
||
35 | #else
|
||
36 | #define NCS_OBJECT_BAD_NODE -1 |
||
37 | #define NCS_OBJECT_FIRST_NODE 0 |
||
38 | #endif
|
||
39 | |||
40 | struct NCSObjectListNode
|
||
41 | { |
||
42 | INT32 index; |
||
43 | char *pStringID;
|
||
44 | void *pObject;
|
||
45 | NCSObjectListNode *next; |
||
46 | NCSObjectListNode *prev; |
||
47 | }; |
||
48 | |||
49 | |||
50 | class NCS_EXPORT CNCSObjectList |
||
51 | { |
||
52 | public:
|
||
53 | CNCSObjectList(); |
||
54 | virtual ~CNCSObjectList(); |
||
55 | |||
56 | protected:
|
||
57 | INT32 Add(char *pStringID, void *pObject); |
||
58 | void * Remove(char *pString); |
||
59 | void * Remove(INT32 nIndex);
|
||
60 | void * Remove(void *pObj); |
||
61 | void RemoveAllNodes();
|
||
62 | BOOLEAN Move(INT32 nSrcIndex, INT32 nDestIndex); |
||
63 | BOOLEAN isEmpty(); |
||
64 | |||
65 | void * Get(INT32 nIndex);
|
||
66 | void * Get(char *pStringID); |
||
67 | INT32 GetNumberNodes(); |
||
68 | |||
69 | INT32 GetIndex(char *pStringID);
|
||
70 | char * GetStringID(INT32 nIndex);
|
||
71 | |||
72 | void * GetFirstNode();
|
||
73 | void * GetNextNode();
|
||
74 | |||
75 | void * RemoveNode(NCSObjectListNode *pNode);
|
||
76 | void DeleteNode(NCSObjectListNode *pNode);
|
||
77 | NCSObjectListNode * FindNode(INT32 nIndex); |
||
78 | NCSObjectListNode * FindNode(char *pStringID);
|
||
79 | |||
80 | private:
|
||
81 | NCSObjectListNode *m_pList; |
||
82 | NCSObjectListNode *m_pCurrNode; |
||
83 | NCSObjectListNode *m_pLastNode; |
||
84 | INT32 m_nNodes; |
||
85 | |||
86 | void AdjustNodeIndexes();
|
||
87 | }; |
||
88 | |||
89 | |||
90 | #endif //NCSOBJECTLIST_H_ |
||
91 |