-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathmgrnodearray.h
More file actions
105 lines (83 loc) · 3.3 KB
/
mgrnodearray.h
File metadata and controls
105 lines (83 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef mgrnodearray_h
#define mgrnodearray_h
/*
* NIST STEP Editor Class Library
* cleditor/mgrnodearray.h
* April 1997
* David Sauder
* K. C. Morris
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
/* $Id: mgrnodearray.h,v 3.0.1.3 1997/11/05 22:11:38 sauderd DP3.1 $ */
#include <sc_export.h>
#include <string.h>
#include <gennode.h>
#include <gennodelist.h>
//#include <gennode.inline.h>
#include <mgrnode.h>
#include <mgrnodelist.h>
#include <gennodearray.h>
#define ARRAY_DEFAULT_SIZE (1024)
//////////////////////////////////////////////////////////////////////////////
// class MgrNodeArray
// This class implements the array of MgrNodes representing the
// master list for the seInstMgr which will have a one to one
// mapping by index to the display list of corresponding STEPentities.
// If you delete this object it deletes all of the entries it points to.
//////////////////////////////////////////////////////////////////////////////
class SC_CORE_EXPORT MgrNodeArray : public GenNodeArray {
public:
MgrNodeArray( int defaultSize = ARRAY_DEFAULT_SIZE );
~MgrNodeArray();
// REDEFINED functions
// need to redefine Append() & Insert(GenericNode *) so they call
// MgrNodeArray::Insert(GenericNode *, int index);
virtual int Insert( GenericNode * gn, int index );
virtual void Append( GenericNode * gn ) {
Insert( gn, _count );
}
virtual int Insert( GenericNode * gn ) {
return Insert( gn, _count );
}
virtual void Remove( int index );
virtual void ClearEntries();
virtual void DeleteEntries();
// ADDED functions
virtual int MgrNodeIndex( int fileId );
void AssignIndexAddress( int index );
};
//////////////////////////////////////////////////////////////////////////////
// class MgrNodeArraySorted
// This class implements the array of MgrNodes representing the
// sorted master list for the seInstMgr. This list is sorted by
// STEPentity::fileId.
// If you delete this object it won't delete the entries it points to.
//////////////////////////////////////////////////////////////////////////////
class SC_CORE_EXPORT MgrNodeArraySorted : public GenNodeArray {
public:
MgrNodeArraySorted( int defaultSize = ARRAY_DEFAULT_SIZE );
~MgrNodeArraySorted() { }
// REDEFINED functions
virtual int Index( GenericNode * gn );
virtual int Index( GenericNode ** gn );
virtual int Insert( GenericNode * gn );
virtual int Insert( GenericNode * gn, int index ) {
cerr <<
"Call MgrNodeArraySorted::Insert() without index argument instead.\n"
<< "index argument: " << index << " being ignored.\n";
return Insert( gn );
}
virtual void Append( GenericNode * gn ) {
Insert( gn );
}
virtual void ClearEntries();
virtual void DeleteEntries();
// ADDED functions
virtual int MgrNodeIndex( int fileId );
int FindInsertPosition( const int fileId );
};
//////////////////////////////////////////////////////////////////////////////
// class MgrNodeArray inline public functions
//////////////////////////////////////////////////////////////////////////////
#endif