Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
ListOfHDF_DataBaseRCData.h
Go to the documentation of this file.
1
#ifndef LISTOFHDF_DATABASERCDATA_H
2
#define LISTOFHDF_DATABASERCDATA_H "ListOfHDF_DataBaseRCData.h"
3
class
HDF_DataBaseRCData;
4
//
5
// ListOfHDF_DataBaseRCData Class Template
6
//
7
// This is the header file for a template class that stores pointers
8
// of objects within an array. The array is dynamic so that only
9
// memory and time limit the number of objects stored on the list.
10
11
//
12
// Set this parameter to 1 if you find it necessary to track the lists
13
// being created and destroyed.
14
//
15
#define DEBUGTEMPLATE 0
16
17
18
class
ListOfHDF_DataBaseRCData
{
19
private
:
20
21
#if DEBUGTEMPLATE
22
int
theID;
// Unique id for each list object created.
23
#endif // the counter static int theIDCount is used
24
// to assign a value.
25
26
int
listLength;
// Number of elements in the list.
27
int
memAlloc;
// Current amount of memory allocated for the list.
28
HDF_DataBaseRCData **aList;
// Pointer to a list of pointers to object HDF_DataBaseRCData.
29
30
void
checkRange(
int
)
const
;
// Internal range check function.
31
32
public
:
33
34
#if DEBUGTEMPLATE // Should be initialized for debugging.
35
static
int
theIDCount;
// example:
36
#endif // int ListOfHDF_DataBaseRCData<stuff>::theIDCount = 0;
37
38
// Constructors/Destructors
39
ListOfHDF_DataBaseRCData
();
// Default constructor.
40
ListOfHDF_DataBaseRCData
(
const
ListOfHDF_DataBaseRCData
&);
// Copy constructor.
41
~ListOfHDF_DataBaseRCData
();
// Destructor.
42
43
ListOfHDF_DataBaseRCData
&
operator=
(
const
ListOfHDF_DataBaseRCData
&);
// Equal operator (only pointers of
44
// list objects copied).
45
46
// void Iterator( void (HDF_DataBaseRCData::*Function)()); // Function iterator.
47
48
49
// ListOfHDF_DataBaseRCData Management Functions
50
51
void
addElement
(HDF_DataBaseRCData &
X
);
// Add an object to the list.
52
53
void
addElement
(HDF_DataBaseRCData &X,
int
index);
// Add an object to the list at a
54
// given location.
55
int
getLength
()
const
{
return
listLength;};
// Get length of list.
56
57
HDF_DataBaseRCData*
getElementPtr
(
int
index)
const
;
// Get the pointer of the object
58
// at a given location.
59
HDF_DataBaseRCData&
getElement
(
int
index)
const
;
// Reference the object at a
60
// a given location.
61
HDF_DataBaseRCData&
operator[]
(
int
index)
const
;
// Reference the object at a
62
// given location.
63
void
deleteElement
(HDF_DataBaseRCData &X);
// Find an element on the list
64
// and delete it.
65
void
deleteElement
(
int
index);
// Delete the object at a given
66
// location in the list.
67
void
setElementPtr
(HDF_DataBaseRCData *X,
int
i);
// Set the list element at i
68
// to point to X.
69
void
swapElements
(
int
i,
int
j);
// Swap two elements for sorting
70
// among other things.
71
void
clean
();
// Deallocate pointer list but
72
// not objects in the list.
73
void
deepClean
();
// Deallocate pointer list and
74
// the pointers on the list.
75
};
76
77
#endif
Generated on Fri Jan 4 2013 10:17:55 for Overture by
1.8.3