-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathSTEPinvAttrList.cc
More file actions
65 lines (54 loc) · 1.92 KB
/
STEPinvAttrList.cc
File metadata and controls
65 lines (54 loc) · 1.92 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
/** \file STEPinvAttrList.cc
* derived from STEPattributeList.cc
*/
#include "clstepcore/STEPinvAttrList.h"
#include "clstepcore/ExpDict.h"
invAttrListNodeI::invAttrListNodeI(Inverse_attribute* a, setterI_t s, getterI_t g): invAttrListNode(a), set( s ), get( g ) {}
invAttrListNodeA::invAttrListNodeA(Inverse_attribute* a, setterA_t s, getterA_t g): invAttrListNode(a), set( s ), get( g ) {}
invAttrListNodeI::~invAttrListNodeI() {}
invAttrListNodeA::~invAttrListNodeA() {}
STEPinvAttrList::STEPinvAttrList() {}
STEPinvAttrList::~STEPinvAttrList() {}
invAttrListNode * STEPinvAttrList::operator []( int n ) {
int x = 0;
invAttrListNode * a = ( invAttrListNode * )head;
int cnt = EntryCount();
if( n < cnt ) {
while( a && ( x < n ) ) {
a = ( invAttrListNode * )( a->next );
x++;
}
}
if( !a ) {
cerr << "\nERROR in STEP Core library: " << __FILE__ << ":"
<< __LINE__ << "\n" << _POC_ << "\n\n";
}
return a;
}
int STEPinvAttrList::list_length() {
return EntryCount();
}
void STEPinvAttrList::push( Inverse_attribute * a, setterA_t s, getterA_t g ) {
invAttrListNode * an = ( invAttrListNode * )head;
// if the attribute already exists in the list, don't push it
while( an ) {
if( a == ( an -> attr ) ) {
return;
}
an = ( invAttrListNode * )( an->next );
}
invAttrListNode * ialn = (invAttrListNode *) new invAttrListNodeA( a, s, g );
AppendNode( ialn );
}
void STEPinvAttrList::push( Inverse_attribute * a, setterI_t s, getterI_t g ) {
invAttrListNode * an = ( invAttrListNode * )head;
// if the attribute already exists in the list, don't push it
while( an ) {
if( a == ( an -> attr ) ) {
return;
}
an = ( invAttrListNode * )( an->next );
}
invAttrListNode * ialn = (invAttrListNode *) new invAttrListNodeI( a, s, g );
AppendNode( ialn );
}