Fixed typos
[ACE_TAO.git] / ACE / ace / Map_Manager.h
blobe4c541957def321111240dddcf691b17ca081995
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Map_Manager.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //=============================================================================
11 #ifndef ACE_MAP_MANAGER_H
12 #define ACE_MAP_MANAGER_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/config-all.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Basic_Types.h"
23 #include "ace/Global_Macros.h"
24 #include "ace/Default_Constants.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
28 // Forward declaration.
29 class ACE_Allocator;
31 /**
32 * @class ACE_Map_Entry
34 * @brief An entry in the Map.
36 template <class EXT_ID, class INT_ID>
37 class ACE_Map_Entry
39 public:
40 /// Initialize member variables.
41 ACE_Map_Entry (void);
43 /// We need this destructor to keep some compilers from complaining.
44 /// It's just a no-op, however.
45 ~ACE_Map_Entry (void);
47 /// Key used to look up an entry.
48 EXT_ID ext_id_;
50 /// The contents of the entry itself.
51 INT_ID int_id_;
53 /// Dump the state of an object.
54 void dump (void) const;
56 /// Declare the dynamic allocation hooks.
57 ACE_ALLOC_HOOK_DECLARE;
59 // = These are really private, but unfortunately template friends
60 // are not portable.
62 /// Get next entry.
63 ACE_UINT32 next (void) const;
65 /// Set next entry.
66 void next (ACE_UINT32 n);
68 /// Get prev entry.
69 ACE_UINT32 prev (void) const;
71 /// Set prev entry.
72 void prev (ACE_UINT32 p);
74 /// Keeps track of the next entry.
75 ACE_UINT32 next_;
77 /// Keeps track of the previous entry.
78 ACE_UINT32 prev_;
80 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
82 /// Is this entry free?
83 bool free_;
84 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
87 // Forward decl.
88 template <class EXT_ID, class INT_ID, class ACE_LOCK>
89 class ACE_Map_Iterator_Base;
91 // Forward decl.
92 template <class EXT_ID, class INT_ID, class ACE_LOCK>
93 class ACE_Map_Const_Iterator_Base;
95 // Forward decl.
96 template <class EXT_ID, class INT_ID, class ACE_LOCK>
97 class ACE_Map_Iterator;
99 // Forward decl.
100 template <class EXT_ID, class INT_ID, class ACE_LOCK>
101 class ACE_Map_Const_Iterator;
103 // Forward decl.
104 template <class EXT_ID, class INT_ID, class ACE_LOCK>
105 class ACE_Map_Reverse_Iterator;
108 * @class ACE_Map_Manager
110 * @brief
111 * Define a map abstraction that associates EXT_IDs with
112 * INT_IDs.
114 * The EXT_ID must support @c operator==. This constraint can
115 * be alleviated via template specialization, as shown in the
116 * $ACE_ROOT/tests/Conn_Test.cpp test.
117 * This class uses an ACE_Allocator to allocate memory. The
118 * user can make this a persistant class by providing an
119 * ACE_Allocator with a persistable memory pool.
120 * This implementation of a map uses an array, which is searched
121 * linearly. For more efficient searching you should use the
122 * ACE_Hash_Map_Manager.
124 template <class EXT_ID, class INT_ID, class ACE_LOCK>
125 class ACE_Map_Manager
127 public:
128 friend class ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>;
129 friend class ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>;
130 friend class ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>;
131 friend class ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK>;
132 friend class ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>;
134 // = Traits.
135 typedef EXT_ID KEY;
136 typedef INT_ID VALUE;
137 typedef ACE_LOCK lock_type;
138 typedef ACE_Map_Entry<EXT_ID, INT_ID> ENTRY;
139 typedef ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> ITERATOR;
140 typedef ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> CONST_ITERATOR;
141 typedef ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> REVERSE_ITERATOR;
143 typedef ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> iterator;
144 typedef ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> const_iterator;
145 typedef ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> reverse_iterator;
147 /// Initialize a ACE_Map_Manager with the ACE_DEFAULT_MAP_SIZE.
148 ACE_Map_Manager (ACE_Allocator *alloc = 0);
150 /// Initialize a ACE_Map_Manager with @a size entries.
151 ACE_Map_Manager (size_t size,
152 ACE_Allocator *alloc = 0);
154 /// Initialize a ACE_Map_Manager with size @a length.
155 int open (size_t length = ACE_DEFAULT_MAP_SIZE,
156 ACE_Allocator *alloc = 0);
158 /// Close down a ACE_Map_Manager and release dynamically allocated
159 /// resources.
160 int close (void);
162 /// Close down a ACE_Map_Manager and release dynamically allocated
163 /// resources.
164 ~ACE_Map_Manager (void);
167 * Associate @a ext_id with @a int_id. If @a ext_id is already in the
168 * map then the ACE_Map_Entry is not changed.
169 * @retval 0 If a new entry is bound successfully.
170 * @retval 1 If an attempt is made to bind an existing entry.
171 * @retval -1 If failures occur.
173 int bind (const EXT_ID &ext_id,
174 const INT_ID &int_id);
177 * Reassociate @a ext_id with @a int_id. If @a ext_id is not in the
178 * map then behaves just like bind(). Otherwise, store the old
179 * values of @a ext_id and @a int_id into the "out" parameters and
180 * rebind the new parameters. This is very useful if you need to
181 * have an atomic way of updating <Map_Entries> and you also need
182 * full control over memory allocation.
183 * @retval 0 If a new entry is bound successfully.
184 * @retval 1 If an existing entry was rebound.
185 * @retval -1 If failures occur.
187 int rebind (const EXT_ID &ext_id,
188 const INT_ID &int_id,
189 EXT_ID &old_ext_id,
190 INT_ID &old_int_id);
193 * Reassociate @a ext_id with @a int_id. If @a ext_id is not in the
194 * map then behaves just like bind(). Otherwise, store the old
195 * values of @a int_id into the "out" parameter and rebind the new
196 * parameters.
197 * @retval 0 If a new entry is bound successfully.
198 * @retval 1 If an existing entry was rebound.
199 * @retval -1 If failures occur.
201 int rebind (const EXT_ID &ext_id,
202 const INT_ID &int_id,
203 INT_ID &old_int_id);
205 /// Reassociate @a ext_id with @a int_id. Old values in the map are
206 /// ignored.
207 int rebind (const EXT_ID &ext_id,
208 const INT_ID &int_id);
211 * Associate @a ext_id with @a int_id if and only if @a ext_id is not
212 * in the map. If @a ext_id is already in the map then the @a int_id
213 * parameter is overwritten with the existing value in the map
214 * @retval 0 If a new entry is bound successfully.
215 * @retval 1 If an attempt is made to bind an existing entry.
216 * @retval -1 If failures occur.
218 int trybind (const EXT_ID &ext_id,
219 INT_ID &int_id);
222 * Locate @a ext_id and pass out parameter via @a int_id.
223 * @retval 0 If found.
224 * @retval -1 If not found.
226 int find (const EXT_ID &ext_id,
227 INT_ID &int_id) const;
229 /// Returns 0 if the @a ext_id is in the mapping, otherwise -1.
230 int find (const EXT_ID &ext_id) const;
233 * Unbind (remove) the @a ext_id from the map. Don't return the
234 * @a int_id to the caller (this is useful for collections where the
235 * @a int_ids are *not* dynamically allocated...) Returns 0 if
236 * successful, else -1.
238 int unbind (const EXT_ID &ext_id);
241 * Break any association of @a ext_id. Returns the value of @a int_id
242 * in case the caller needs to deallocate memory. Returns 0 if
243 * successful, else -1.
245 int unbind (const EXT_ID &ext_id,
246 INT_ID &int_id);
249 * Unbind all entires.
251 void unbind_all (void);
253 /// Return the current size of the map.
254 size_t current_size (void) const;
256 /// Return the total size of the map.
257 size_t total_size (void) const;
260 * Returns a reference to the underlying ACE_LOCK. This makes it
261 * possible to acquire the lock explicitly, which can be useful in
262 * some cases if you instantiate the ACE_Atomic_Op with an
263 * ACE_Recursive_Mutex or ACE_Process_Mutex, or if you need to
264 * guard the state of an iterator.
265 * @note The right name would be lock, but HP/C++ will choke on that!
267 ACE_LOCK &mutex (void);
269 /// Dump the state of an object.
270 void dump (void) const;
272 // = STL styled iterator factory functions.
274 /// Return forward iterator.
275 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> begin (void);
276 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> end (void);
278 /// Return reverse iterator.
279 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> rbegin (void);
280 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> rend (void);
282 /// Declare the dynamic allocation hooks.
283 ACE_ALLOC_HOOK_DECLARE;
285 protected:
287 // = The following methods do the actual work.
289 // These methods assume that the locks are held by the private
290 // methods.
292 /// Performs the binding of @a ext_id to @a int_id. Must be called
293 /// with locks held.
294 int bind_i (const EXT_ID &ext_id,
295 const INT_ID &int_id);
297 /// Bind an entry (without finding first). Must be called with locks
298 /// held.
299 int shared_bind (const EXT_ID &ext_id,
300 const INT_ID &int_id);
302 /// Performs a rebinding of <ext_it> to @a int_id. Also, recovers old
303 /// values. Must be called with locks held.
304 int rebind_i (const EXT_ID &ext_id,
305 const INT_ID &int_id,
306 EXT_ID &old_ext_id,
307 INT_ID &old_int_id);
309 /// Performs a rebinding of <ext_it> to @a int_id. Also, recovers old
310 /// values. Must be called with locks held.
311 int rebind_i (const EXT_ID &ext_id,
312 const INT_ID &int_id,
313 INT_ID &old_int_id);
315 /// Performs a rebinding of <ext_it> to @a int_id. Must be called
316 /// with locks held.
317 int rebind_i (const EXT_ID &ext_id,
318 const INT_ID &int_id);
320 /// Performs a conditional bind of @a int_id using @a ext_id as the
321 /// key. Must be called with locks held.
322 int trybind_i (const EXT_ID &ext_id,
323 INT_ID &int_id);
325 /// Performs a find of @a int_id using @a ext_id as the key. Must be
326 /// called with locks held.
327 int find_i (const EXT_ID &ext_id,
328 INT_ID &int_id);
330 /// Performs a find using @a ext_id as the key. Must be called with
331 /// locks held.
332 int find_and_return_index (const EXT_ID &ext_id,
333 ACE_UINT32 &slot);
335 /// Performs an unbind of @a int_id using @a ext_id as the key. Must
336 /// be called with locks held.
337 int unbind_i (const EXT_ID &ext_id,
338 INT_ID &int_id);
340 /// Performs an unbind using @a ext_id as the key. Must be called
341 /// with locks held.
342 int unbind_i (const EXT_ID &ext_id);
344 /// Performs an unbind using @a ext_id as the key. Must be called
345 /// with locks held.
346 int unbind_and_return_index (const EXT_ID &ext_id,
347 ACE_UINT32 &slot);
349 /// Unbind @a slot.
350 void unbind_slot (ACE_UINT32 slot);
352 /// Resize the map. Must be called with locks held.
353 int resize_i (ACE_UINT32 size);
355 /// Close down a <Map_Manager>. Must be called with locks held.
356 int close_i (void);
358 /// Returns 1 if <id1> == <id2>, else 0. This is defined as a
359 /// separate method to facilitate template specialization.
360 int equal (const EXT_ID &id1, const EXT_ID &id2);
362 /// This function returns the new size of the Map Manager. This
363 /// function is called when we run out of room and need to resize.
364 ACE_UINT32 new_size (void);
366 /// Explicitly call the destructors and free up the
367 /// <search_structure_>.
368 void free_search_structure (void);
370 /// Id of the free list sentinel.
371 ACE_UINT32 free_list_id (void) const;
373 /// Id of the occupied list sentinel.
374 ACE_UINT32 occupied_list_id (void) const;
376 /// Finds the next free slot.
377 int next_free (ACE_UINT32 &slot);
379 /// Move from free list to occupied list.
380 void move_from_free_list_to_occupied_list (ACE_UINT32 slot);
382 /// Move from occupied list to free list.
383 void move_from_occupied_list_to_free_list (ACE_UINT32 slot);
385 #if defined (ACE_HAS_LAZY_MAP_MANAGER)
388 * In the case of lazy map managers, the movement of free slots from
389 * the occupied list to the free list is delayed until we run out of
390 * free slots in the free list. This function goes through the
391 * entire occupied list, moving free slots to the free list.
393 void move_all_free_slots_from_occupied_list (void);
395 #endif /* ACE_HAS_LAZY_MAP_MANAGER */
397 /// Move helper.
398 void shared_move (ACE_UINT32 slot,
399 ACE_Map_Entry<EXT_ID, INT_ID> &current_list,
400 ACE_UINT32 current_list_id,
401 ACE_Map_Entry<EXT_ID, INT_ID> &new_list,
402 ACE_UINT32 new_list_id);
404 /// Pointer to a memory allocator.
405 ACE_Allocator *allocator_;
407 /// Synchronization variable for the MT_SAFE ACE_Map_Manager.
408 mutable ACE_LOCK lock_;
410 /// Implement the Map as a resizeable array of ACE_Map_Entry.
411 ACE_Map_Entry<EXT_ID, INT_ID> *search_structure_;
413 /// Total number of elements in this->search_structure_.
414 ACE_UINT32 total_size_;
416 /// Current size of the map.
417 ACE_UINT32 cur_size_;
419 /// Free list.
420 ACE_Map_Entry<EXT_ID, INT_ID> free_list_;
422 /// Occupied list.
423 ACE_Map_Entry<EXT_ID, INT_ID> occupied_list_;
425 enum
427 /// Grow map exponentially up to 64K
428 MAX_EXPONENTIAL = 64 * 1024,
430 /// Afterwards grow in chunks of 32K
431 LINEAR_INCREASE = 32 * 1024
434 private:
435 // = Disallow these operations.
436 ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &))
437 ACE_UNIMPLEMENTED_FUNC (ACE_Map_Manager (const ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK> &))
441 * @class ACE_Map_Iterator_Base
443 * @brief Iterator for the ACE_Map_Manager.
445 * This class factors out common code from its templatized
446 * subclasses.
448 template <class EXT_ID, class INT_ID, class ACE_LOCK>
449 class ACE_Map_Iterator_Base
451 public:
452 /// Constructor. If head != 0, the iterator constructed is positioned
453 /// at the head of the map, it is positioned at the end otherwise.
454 ACE_Map_Iterator_Base (ACE_Map_Manager <EXT_ID, INT_ID, ACE_LOCK> &mm);
456 // = Iteration methods.
458 /// Pass back the next <entry> that hasn't been seen in the Set.
459 /// Returns 0 when all items have been seen, else 1.
460 int next (ACE_Map_Entry<EXT_ID, INT_ID> *&next_entry) const;
462 /// Returns 1 when all items have been seen, else 0.
463 int done (void) const;
465 /// Returns a reference to the interal element @c this is pointing to.
466 ACE_Map_Entry<EXT_ID, INT_ID>& operator* (void) const;
468 /// Returns reference the Map_Manager that is being iterated
469 /// over.
470 ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>& map (void);
472 /// Check if two iterators point to the same position
473 bool operator== (const ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> &) const;
474 bool operator!= (const ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> &) const;
476 /// Declare the dynamic allocation hooks.
477 ACE_ALLOC_HOOK_DECLARE;
479 protected:
480 /// Move forward by one element in the set. Returns 0 when there's
481 /// no more item in the set after the current items, else 1.
482 int forward_i (void);
484 /// Move backware by one element in the set. Returns 0 when there's
485 /// no more item in the set before the current item, else 1.
486 int reverse_i (void);
488 /// Dump the state of an object.
489 void dump_i (void) const;
491 /// Map we are iterating over.
492 ACE_Map_Manager <EXT_ID, INT_ID, ACE_LOCK> *map_man_;
494 /// Keeps track of how far we've advanced...
495 ACE_UINT32 next_;
499 * @class ACE_Map_Const_Iterator_Base
501 * @brief Const iterator for the ACE_Map_Manager.
503 * This class factors out common code from its templatized
504 * subclasses.
506 template <class EXT_ID, class INT_ID, class ACE_LOCK>
507 class ACE_Map_Const_Iterator_Base
509 public:
510 /// Constructor. If head != 0, the iterator constructed is positioned
511 /// at the head of the map, it is positioned at the end otherwise.
512 ACE_Map_Const_Iterator_Base (const ACE_Map_Manager <EXT_ID, INT_ID, ACE_LOCK> &mm);
514 // = Iteration methods.
516 /// Pass back the next <entry> that hasn't been seen in the Set.
517 /// Returns 0 when all items have been seen, else 1.
518 int next (ACE_Map_Entry<EXT_ID, INT_ID> *&next_entry) const;
520 /// Returns 1 when all items have been seen, else 0.
521 int done (void) const;
523 /// Returns a reference to the interal element @c this is pointing to.
524 ACE_Map_Entry<EXT_ID, INT_ID>& operator* (void) const;
526 /// Returns reference the Map_Manager that is being iterated
527 /// over.
528 const ACE_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>& map (void) const;
530 /// Check if two iterators point to the same position
531 bool operator== (const ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> &) const;
532 bool operator!= (const ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> &) const;
534 /// Declare the dynamic allocation hooks.
535 ACE_ALLOC_HOOK_DECLARE;
537 protected:
538 /// Move forward by one element in the set. Returns 0 when there's
539 /// no more item in the set after the current items, else 1.
540 int forward_i (void);
542 /// Move backware by one element in the set. Returns 0 when there's
543 /// no more item in the set before the current item, else 1.
544 int reverse_i (void);
546 /// Dump the state of an object.
547 void dump_i (void) const;
549 /// Map we are iterating over.
550 const ACE_Map_Manager <EXT_ID, INT_ID, ACE_LOCK> *map_man_;
552 /// Keeps track of how far we've advanced...
553 ACE_UINT32 next_;
557 * @class ACE_Map_Iterator
559 * @brief Forward iterator for the ACE_Map_Manager.
561 * This class does not perform any internal locking of the
562 * ACE_Map_Manager it is iterating upon since locking is
563 * inherently inefficient and/or error-prone within an STL-style
564 * iterator. If you require locking, you can explicitly use an
565 * ACE_GUARD or ACE_READ_GUARD on the ACE_Map_Manager's
566 * internal lock, which is accessible via its mutex() method.
568 template <class EXT_ID, class INT_ID, class ACE_LOCK>
569 class ACE_Map_Iterator : public ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>
571 public:
572 ACE_Map_Iterator (ACE_Map_Manager <EXT_ID, INT_ID, ACE_LOCK> &mm,
573 int pass_end = 0);
575 // = Iteration methods.
577 /// Move forward by one element in the set. Returns 0 when all the
578 /// items in the set have been seen, else 1.
579 int advance (void);
581 /// Dump the state of an object.
582 void dump (void) const;
584 // = STL styled iteration, compare, and reference functions.
586 /// Prefix advance.
587 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> &operator++ (void);
589 /// Postfix advance.
590 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> operator++ (int);
592 /// Prefix reverse.
593 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> &operator-- (void);
595 /// Postfix reverse.
596 ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK> operator-- (int);
598 /// Declare the dynamic allocation hooks.
599 ACE_ALLOC_HOOK_DECLARE;
603 * @class ACE_Map_Const_Iterator
605 * @brief Forward const iterator for the ACE_Map_Manager.
607 * This class does not perform any internal locking of the
608 * ACE_Map_Manager it is iterating upon since locking is
609 * inherently inefficient and/or error-prone within an STL-style
610 * iterator. If you require locking, you can explicitly use an
611 * ACE_GUARD or ACE_READ_GUARD on the ACE_Map_Manager's
612 * internal lock, which is accessible via its mutex() method.
614 template <class EXT_ID, class INT_ID, class ACE_LOCK>
615 class ACE_Map_Const_Iterator : public ACE_Map_Const_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>
617 public:
618 ACE_Map_Const_Iterator (const ACE_Map_Manager <EXT_ID, INT_ID, ACE_LOCK> &mm,
619 int pass_end = 0);
621 // = Iteration methods.
623 /// Move forward by one element in the set. Returns 0 when all the
624 /// items in the set have been seen, else 1.
625 int advance (void);
627 /// Dump the state of an object.
628 void dump (void) const;
630 // = STL styled iteration, compare, and reference functions.
632 /// Prefix advance.
633 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> &operator++ (void);
635 /// Postfix advance.
636 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> operator++ (int);
638 /// Prefix reverse.
639 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> &operator-- (void);
641 /// Postfix reverse.
642 ACE_Map_Const_Iterator<EXT_ID, INT_ID, ACE_LOCK> operator-- (int);
644 /// Declare the dynamic allocation hooks.
645 ACE_ALLOC_HOOK_DECLARE;
649 * @class ACE_Map_Reverse_Iterator
651 * @brief Reverse Iterator for the ACE_Map_Manager.
653 * This class does not perform any internal locking of the
654 * ACE_Map_Manager it is iterating upon since locking is
655 * inherently inefficient and/or error-prone within an STL-style
656 * iterator. If you require locking, you can explicitly use an
657 * ACE_GUARD or ACE_READ_GUARD on the ACE_Map_Manager's
658 * internal lock, which is accessible via its mutex() method.
660 template <class EXT_ID, class INT_ID, class ACE_LOCK>
661 class ACE_Map_Reverse_Iterator : public ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>
663 public:
664 ACE_Map_Reverse_Iterator (ACE_Map_Manager <EXT_ID, INT_ID, ACE_LOCK> &mm,
665 int pass_end = 0);
667 // = Iteration methods.
669 /// Move forward by one element in the set. Returns 0 when all the
670 /// items in the set have been seen, else 1.
671 int advance (void);
673 /// Dump the state of an object.
674 void dump (void) const;
676 // = STL styled iteration, compare, and reference functions.
678 /// Prefix reverse.
679 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> &operator++ (void);
681 /// Postfix reverse.
682 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> operator++ (int);
684 /// Prefix advance.
685 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> &operator-- (void);
687 /// Postfix advance.
688 ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK> operator-- (int);
690 /// Declare the dynamic allocation hooks.
691 ACE_ALLOC_HOOK_DECLARE;
694 ACE_END_VERSIONED_NAMESPACE_DECL
696 #if defined (__ACE_INLINE__)
697 #include "ace/Map_Manager.inl"
698 #endif /* __ACE_INLINE__ */
700 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
701 #include "ace/Map_Manager.cpp"
702 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
704 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
705 #pragma implementation ("Map_Manager.cpp")
706 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
708 #include /**/ "ace/post.h"
710 #endif /* ACE_MAP_MANAGER_H */