Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrew Bauer
VTK
Commits
9ff453f8
Commit
9ff453f8
authored
Sep 09, 1994
by
Will Schroeder
Browse files
ENH: Added destructor.
parent
36489010
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/Collect.hh
View file @
9ff453f8
...
...
@@ -33,18 +33,20 @@ class vlCollectionElement
class
vlCollection
:
public
vlObject
{
public:
int
NumberOfItems
;
public:
vlCollection
();
virtual
~
vlCollection
();
void
PrintSelf
(
ostream
&
os
,
vlIndent
indent
);
char
*
GetClassName
()
{
return
"vlCollection"
;};
void
AddItem
(
vlObject
*
);
void
RemoveItem
(
vlObject
*
);
int
IsItemPresent
(
vlObject
*
);
int
GetNumberOfItems
();
vlObject
*
GetItem
(
int
num
);
void
PrintSelf
(
ostream
&
os
,
vlIndent
indent
);
char
*
GetClassName
()
{
return
"vlCollection"
;};
private:
protected:
int
NumberOfItems
;
vlCollectionElement
*
Top
;
vlCollectionElement
*
Bottom
;
...
...
src/Collect.cc
View file @
9ff453f8
...
...
@@ -27,6 +27,16 @@ vlCollection::vlCollection()
this
->
Bottom
=
NULL
;
}
vlCollection
::~
vlCollection
()
{
vlCollectionElement
*
p
;
for
(
p
=
this
->
Top
;
p
!=
NULL
;
p
=
p
->
Next
)
{
delete
p
;
}
}
// Description:
// Add an object to the list. Does not prevent duplicate entries.
void
vlCollection
::
AddItem
(
vlObject
*
a
)
...
...
@@ -157,11 +167,3 @@ void vlCollection::PrintSelf(ostream& os, vlIndent indent)
os
<<
indent
<<
"Number Of Items: "
<<
this
->
NumberOfItems
<<
"
\n
"
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment