summaryrefslogtreecommitdiff
path: root/ace/Containers.h
diff options
context:
space:
mode:
authornw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-29 06:55:25 +0000
committernw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-29 06:55:25 +0000
commit6eec1060ff709103cd49a76d56d7201f8b44b5c3 (patch)
tree914ce6ae12a2fd7c07660521ba2e67efc56582d0 /ace/Containers.h
parent9189e3bd52f8565dadb66aca4169a183c76866d2 (diff)
downloadATCD-6eec1060ff709103cd49a76d56d7201f8b44b5c3.tar.gz
Decouple memory allocation strategy for ACE_Unbounded_Stack,
ACE_Unbounded_Set, ACE_Unbounded_Queue.
Diffstat (limited to 'ace/Containers.h')
-rw-r--r--ace/Containers.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/ace/Containers.h b/ace/Containers.h
index cffb7258eac..153163c50d3 100644
--- a/ace/Containers.h
+++ b/ace/Containers.h
@@ -18,6 +18,7 @@
#define ACE_CONTAINERS_H
#include "ace/ACE.h"
+#include "ace/Malloc_T.h"
template <class T>
class ACE_Bounded_Stack
@@ -206,8 +207,9 @@ class ACE_Unbounded_Stack
friend class ACE_Unbounded_Stack_Iterator<T>;
public:
// = Initialization, assignemnt, and termination methods.
- ACE_Unbounded_Stack (void);
- // Initialize a new stack so that it is empty.
+ ACE_Unbounded_Stack (ACE_Allocator *alloc = 0);
+ // Initialize a new stack so that it is empty. Use user defined
+ // allocation strategy if specified.
ACE_Unbounded_Stack (const ACE_Unbounded_Stack<T> &s);
// The copy constructor (performs initialization).
@@ -278,6 +280,9 @@ private:
size_t cur_size_;
// Current size of the stack.
+
+ ACE_Allocator *allocator_;
+ // Allocation strategy of the stack.
};
template <class T>
@@ -367,8 +372,9 @@ class ACE_Unbounded_Queue
friend class ACE_Unbounded_Queue_Iterator<T>;
public:
// = Initialization and termination methods.
- ACE_Unbounded_Queue (void);
- // construction.
+ ACE_Unbounded_Queue (ACE_Allocator *alloc = 0);
+ // construction. Use user specified allocation strategy
+ // if specified.
ACE_Unbounded_Queue (const ACE_Unbounded_Queue<T> &);
// Copy constructor.
@@ -437,6 +443,9 @@ protected:
size_t cur_size_;
// Current size of the queue.
+
+ ACE_Allocator *allocator_;
+ // Allocation Strategy of the queue.
};
template <class T>
@@ -488,8 +497,9 @@ class ACE_Unbounded_Set
friend class ACE_Unbounded_Set_Iterator<T>;
public:
// = Initialization and termination methods.
- ACE_Unbounded_Set (void);
- // Constructor.
+ ACE_Unbounded_Set (ACE_Allocator *alloc = 0);
+ // Constructor. Use user specified allocation strategy
+ // if specified.
ACE_Unbounded_Set (const ACE_Unbounded_Set<T> &);
// Copy constructor.
@@ -549,6 +559,9 @@ private:
size_t cur_size_;
// Current size of the set.
+
+ ACE_Allocator *allocator_;
+ // Allocation strategy of the set.
};
// Forward declaration.