diff options
-rw-r--r-- | ChangeLog-97a | 38 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | ace/IOStream.h | 2 | ||||
-rw-r--r-- | ace/README | 1 | ||||
-rw-r--r-- | ace/Timer_Heap_T.cpp | 42 | ||||
-rw-r--r-- | ace/Timer_Heap_T.h | 28 | ||||
-rw-r--r-- | ace/Timer_List_T.cpp | 52 | ||||
-rw-r--r-- | ace/Timer_List_T.h | 12 | ||||
-rw-r--r-- | ace/Timer_Queue_T.cpp | 2 | ||||
-rw-r--r-- | ace/Timer_Queue_T.h | 32 | ||||
-rw-r--r-- | ace/Timer_Wheel_T.cpp | 34 | ||||
-rw-r--r-- | ace/Timer_Wheel_T.h | 18 | ||||
-rw-r--r-- | ace/config-irix6.2-sgic++-nothreads.h | 1 | ||||
-rw-r--r-- | ace/config-irix6.2-sgic++.h | 1 |
14 files changed, 141 insertions, 124 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a index ff59b18cddd..03b733b1cbc 100644 --- a/ChangeLog-97a +++ b/ChangeLog-97a @@ -7,18 +7,18 @@ Mon Apr 28 14:12:04 1997 Chris Cleeland <cleeland@cs.wustl.edu> Mon Apr 28 11:17:26 1997 David L. Levine <levine@cs.wustl.edu> * tests/Conn_Test.cpp,Message_{Block,Queue}_Test.cpp, - Process_Strategy_Test.cpp: - fixed template specializations for platforms without threads. - Thanks to Nanbor Wang <nw1@cs.wustl.edu> for pointing out this - problem. + Process_Strategy_Test.cpp: fixed template specializations + for platforms without threads. Thanks to Nanbor Wang + <nw1@cs.wustl.edu> for pointing out this problem. - * ace/Connector.h: use ACE_SYNCH_RW_MUTEX in Map typedefs instead - of old ACE_RW_Mutex (which should have been ACE_Thread_RW_Mutex) - and ACE_Null_Mutex (depending on whether the platform has threads). + * ace/Connector.h: use ACE_SYNCH_RW_MUTEX in Map typedefs + instead of old ACE_RW_Mutex (which should have been + ACE_Thread_RW_Mutex) and ACE_Null_Mutex (depending on + whether the platform has threads). * ace/Service_Record.cpp: added ACE_NULL_SYNCH template specializations with threads, because they're still needed even - with threads. This way, individual programs don't have to + with threads. This way, individual programs don't have to specialize these. * ace/Task.cpp: added ACE_TSS<ACE_Task_Exit> and @@ -45,12 +45,32 @@ Mon Apr 28 11:17:26 1997 David L. Levine <levine@cs.wustl.edu> * examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp: fixed typos in template specializations. -Mon Apr 28 02:16:19 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> +Mon Apr 28 10:33:36 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * ace/IOStream.h: Added a new macro called + ACE_LACKS_IOSTREAM_SETGET, which works around bugs with SGI C++ + on IRIX 6.2. Thanks to Torbjorn Lindgren <tl@funcom.com> for + reporting this. + + * ace/Timer_List_T.h: Replaced the use of + ITERATOR with ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR> to + work around problems with SGI C++. Thanks to + Torbjorn Lindgren <tl@funcom.com> for reporting this. + + * ace/Timer_List_T.cpp: Removed the use of NODE * and replaced it + with ACE_Timer_Node_T<TYPE, FUNCTOR> in order to work around + bugs with certain C++ compilers (i.e., SGI). Thanks to Torbjorn + Lindgren <tl@funcom.com> for reporting this. * tests/Conn_Test.cpp: Removed some extraneous template specializations. Thanks to Nanbor Wang <nw1@cs.wustl.edu> for reporting these. +Mon Apr 28 11:17:26 1997 David L. Levine <levine@cs.wustl.edu> + + * examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp: fixed + typos in template specializations. + Mon Apr 28 00:25:17 1997 <irfan@TWOSTEP> * apps/JAWS/client: Removed ACE_Export macro from class @@ -1,4 +1,4 @@ -This is ACE version 4.1.11, released Mon Apr 28 02:46:29 CDT 1997. +This is ACE version 4.1.10, released Mon Apr 28 02:46:29 CDT 1997. If you have any problems with ACE, please send email to Douglas C. Schmidt (schmidt@cs.wustl.edu). diff --git a/ace/IOStream.h b/ace/IOStream.h index c6f51ec97df..45d08db7830 100644 --- a/ace/IOStream.h +++ b/ace/IOStream.h @@ -344,9 +344,11 @@ public: // The converse of the QuotedString put operator. #endif /* __GNUG__ */ +#if !defined (ACE_LACKS_IOSTREAM_SETGET) // = Using the macros to provide get/set operators. ACE_OPERATORG_SET (ACE_IOStream<STREAM>); ACE_OPERATORP_SET (ACE_IOStream<STREAM>); +#endif /* ACE_LACKS_IOSTREAM_SETSET */ // = These are handy to have around for overriding. diff --git a/ace/README b/ace/README index 4be656248a3..eb3d21138f8 100644 --- a/ace/README +++ b/ace/README @@ -163,6 +163,7 @@ ACE_LACKS_COND_T Platform lacks condition variables (e.g., Win32 and VxWorks) ACE_LACKS_CONDATTR_PSHARED Platform has no implementation of pthread_condattr_setpshared(), even though it supports pthreads! ACE_LACKS_EXEC Platform lacks the exec() family of system calls (e.g., Win32, VxWorks, Chorus) ACE_LACKS_FILELOCKS Platform lacks file locking mechanism +ACE_LACKS_IOSTREAM_SETGET Platforms lacks IOStream get/set operators (e.g., SGI IRIX 6.2). ACE_LACKS_IOSTREAM_FX iostream header does not declare ipfx (), opfx (), etc. ACE_LACKS_LINEBUFFERED_STREAMBUF Platform lacks streambuf "linebuffered ()". ACE_LACKS_MADVISE Platform lacks madvise() (e.g., Linux) diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp index 319430906aa..b12d7f753a8 100644 --- a/ace/Timer_Heap_T.cpp +++ b/ace/Timer_Heap_T.cpp @@ -52,7 +52,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::ACE_Timer_Heap_T (size_t size, ACE_TRACE ("ACE_Timer_Heap::ACE_Timer_Heap"); // Create the heap array. - ACE_NEW (this->heap_, NODE *[size]); + ACE_NEW (this->heap_, (ACE_Timer_Node_T<TYPE, FUNCTOR> *[size])); // Create the parallel ACE_NEW (this->timer_ids_, int[size]); @@ -66,7 +66,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::ACE_Timer_Heap_T (size_t size, if (preallocate) { ACE_NEW (this->preallocated_nodes_, - NODE[size]); + (ACE_Timer_Node_T<TYPE, FUNCTOR>[size])); // Add allocated array to set of such arrays for deletion // on cleanup. @@ -96,10 +96,10 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::~ACE_Timer_Heap_T (void) // clean up any preallocated timer nodes if (preallocated_nodes_ != 0) { - ACE_Unbounded_Set_Iterator<NODE *> + ACE_Unbounded_Set_Iterator<ACE_Timer_Node_T<TYPE, FUNCTOR> *> set_iterator (this->preallocated_node_set_); - for (NODE **entry = 0; + for (ACE_Timer_Node_T<TYPE, FUNCTOR> **entry = 0; set_iterator.next (entry) !=0; set_iterator.advance ()) delete [] *entry; @@ -208,7 +208,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::copy (int index, ACE_Timer_Node_T<TYPE, FUNCTOR template <class TYPE, class FUNCTOR> ACE_Timer_Node_T<TYPE, FUNCTOR> * ACE_Timer_Heap_T<TYPE, FUNCTOR>::remove (size_t index) { - NODE *removed_node = this->heap_[index]; + ACE_Timer_Node_T<TYPE, FUNCTOR> *removed_node = this->heap_[index]; // Return this timer id to the freelist. this->push_freelist (removed_node->timer_id_); @@ -221,7 +221,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::remove (size_t index) if (index < this->cur_size_) { - NODE *moved_node = this->heap_[this->cur_size_]; + ACE_Timer_Node_T<TYPE, FUNCTOR> *moved_node = this->heap_[this->cur_size_]; // Move the end node to the location being removed and update // the corresponding slot in the parallel <timer_ids> array. @@ -317,8 +317,8 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::grow_heap (void) // First grow the heap itself. - NODE **new_heap = 0; - ACE_NEW (new_heap, NODE *[new_size]); + ACE_Timer_Node_T<TYPE, FUNCTOR> **new_heap = 0; + ACE_NEW (new_heap, (ACE_Timer_Node_T<TYPE, FUNCTOR> *[new_size])); ACE_OS::memcpy (new_heap, this->heap_, max_size_ * sizeof *new_heap); delete [] this->heap_; @@ -347,7 +347,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::grow_heap (void) // Create a new array with max_size elements to link in // to existing list. ACE_NEW (this->preallocated_nodes_, - NODE[this->max_size_]); + (ACE_Timer_Node_T<TYPE, FUNCTOR>[this->max_size_])); // Add it to the set for later deletion this->preallocated_node_set_.insert (this->preallocated_nodes_); @@ -365,9 +365,9 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::grow_heap (void) this->preallocated_nodes_freelist_ = &preallocated_nodes_[0]; else { - NODE *previous = this->preallocated_nodes_freelist_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *previous = this->preallocated_nodes_freelist_; - for (NODE *current = this->preallocated_nodes_freelist_->next_; + for (ACE_Timer_Node_T<TYPE, FUNCTOR> *current = this->preallocated_nodes_freelist_->next_; current != 0; current = current->next_) previous = current; @@ -400,7 +400,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::alloc_node (void) // Only allocate a node if we are *not* using the preallocated heap. if (this->preallocated_nodes_ == 0) ACE_NEW_RETURN (temp, - NODE, + (ACE_Timer_Node_T<TYPE, FUNCTOR>), 0); else { @@ -451,17 +451,17 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::schedule (const TYPE &type, int timer_id = this->timer_id (); // Obtain the memory to the new node. - NODE *temp = this->alloc_node (); + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp = this->alloc_node (); if (temp) { // Use operator placement new. - new (temp) NODE (type, - act, - future_time, - interval, - 0, - timer_id); + new (temp) ACE_Timer_Node_T<TYPE, FUNCTOR> (type, + act, + future_time, + interval, + 0, + timer_id); this->insert (temp); return timer_id; } @@ -493,7 +493,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::cancel (int timer_id, } else { - NODE *temp = this->remove (timer_node_slot); + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp = this->remove (timer_node_slot); if (dont_call == 0) // Call the close hook. @@ -523,7 +523,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::cancel (const TYPE &type, { if (this->heap_[i]->type_ == type) { - NODE *temp = this->remove (i); + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp = this->remove (i); number_of_cancellations++; diff --git a/ace/Timer_Heap_T.h b/ace/Timer_Heap_T.h index 3c212c991f1..7c21f0bb6e1 100644 --- a/ace/Timer_Heap_T.h +++ b/ace/Timer_Heap_T.h @@ -37,7 +37,7 @@ public: ACE_Timer_Heap_Iterator_T (ACE_Timer_Heap_T<TYPE, FUNCTOR> &); // Constructor. - virtual int next (NODE *&timer_node, + virtual int next (ACE_Timer_Node_T<TYPE, FUNCTOR> *&timer_node, const ACE_Time_Value &cur_time); // Pass back the next <timer_node> that hasn't been seen yet, if its // <time_value_> <= <cur_time>. In addition, moves the timer queue @@ -128,27 +128,27 @@ public: // Dump the state of an object. protected: - virtual void reschedule (NODE *); + virtual void reschedule (ACE_Timer_Node_T<TYPE, FUNCTOR> *); // Reschedule an "interval" <ACE_Timer_Node>. - virtual ITERATOR &iter (void); + virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR> &iter (void); // Returns a pointer to this <ACE_Timer_Queue>'s iterator. - virtual NODE *alloc_node (void); + virtual ACE_Timer_Node_T<TYPE, FUNCTOR> *alloc_node (void); // Factory method that allocates a new node (uses operator new if // we're *not* preallocating, otherwise uses an internal freelist). - virtual void free_node (NODE *); + virtual void free_node (ACE_Timer_Node_T<TYPE, FUNCTOR> *); // Factory method that frees a previously allocated node (uses // operatord delete if we're *not* preallocating, otherwise uses an // internal freelist). private: - NODE *remove (size_t index); + ACE_Timer_Node_T<TYPE, FUNCTOR> *remove (size_t index); // Remove and return the <index>th <ACE_Timer_Node> and restore the // heap property. - void insert (NODE *new_node); + void insert (ACE_Timer_Node_T<TYPE, FUNCTOR> *new_node); // Insert <new_node> into the heap and restore the heap property. void grow_heap (void); @@ -156,17 +156,17 @@ private: // If preallocation is used, will also double the size of the // preallocated array of ACE_Timer_Nodes. - void reheap_up (NODE *new_node, + void reheap_up (ACE_Timer_Node_T<TYPE, FUNCTOR> *new_node, size_t index, size_t parent); // Restore the heap property, starting at <index>. - void reheap_down (NODE *moved_node, + void reheap_down (ACE_Timer_Node_T<TYPE, FUNCTOR> *moved_node, size_t index, size_t child); // Restore the heap property, starting at <index>. - void copy (int index, NODE *moved_node); + void copy (int index, ACE_Timer_Node_T<TYPE, FUNCTOR> *moved_node); // Copy <moved_node> into the <index> slot of <heap_> and move // <index> into the corresponding slot in the <timer_id_> array. @@ -191,7 +191,7 @@ private: HEAP_ITERATOR iterator_; // Iterator used to expire timers. - NODE **heap_; + ACE_Timer_Node_T<TYPE, FUNCTOR> **heap_; // Current contents of the Heap, which is organized as a "heap" of // <ACE_Timer_Node> *'s. In this context, a heap is a "partially // ordered, almost complete" binary tree, which is stored in an @@ -211,17 +211,17 @@ private: // "Pointer" to the first element in the freelist contained within // the <timer_ids_> array, which is organized as a stack. - NODE *preallocated_nodes_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *preallocated_nodes_; // If this is non-0, then we preallocate <max_size_> number of // <ACE_Timer_Node> objects in order to reduce dynamic allocation // costs. In auto-growing implementation, this points to the // last array of nodes allocated. - NODE *preallocated_nodes_freelist_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *preallocated_nodes_freelist_; // This points to the head of the <preallocated_nodes_> freelist, // which is organized as a stack. - ACE_Unbounded_Set<NODE *> preallocated_node_set_; + ACE_Unbounded_Set<ACE_Timer_Node_T<TYPE, FUNCTOR> *> preallocated_node_set_; // Set of pointers to the arrays of preallocated timer nodes. // Used to delete the allocated memory when required. diff --git a/ace/Timer_List_T.cpp b/ace/Timer_List_T.cpp index 384a86bcf10..aaeba15dbe5 100644 --- a/ace/Timer_List_T.cpp +++ b/ace/Timer_List_T.cpp @@ -59,14 +59,12 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::is_empty (void) const return this->head_ == 0; } - template <class TYPE, class FUNCTOR> ACE_Timer_Node_T<TYPE, FUNCTOR> * ACE_Timer_List_T<TYPE, FUNCTOR>::alloc_node (void) { - return new NODE; + return new ACE_Timer_Node_T<TYPE, FUNCTOR>; } - template <class TYPE, class FUNCTOR> void ACE_Timer_List_T<TYPE, FUNCTOR>::free_node (ACE_Timer_Node_T<TYPE, FUNCTOR> *node) { @@ -91,11 +89,11 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::~ACE_Timer_List_T (void) ACE_TRACE ("ACE_Timer_List::~ACE_Timer_List"); ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_)); - NODE *curr = this->head_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *curr = this->head_; while (curr != 0) { - NODE *next = curr->next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *next = curr->next_; this->free_node (curr); curr = next; } @@ -128,8 +126,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::reschedule (ACE_Timer_Node_T<TYPE, FUNCTOR> *ex } else { - NODE *prev = this->head_; - NODE *after = this->head_->next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *prev = this->head_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *after = this->head_->next_; // Locate the proper position in the queue. @@ -164,15 +162,15 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::schedule (const TYPE &type, if (this->is_empty () || future_time < this->earliest_time ()) { // Place at the beginning of the list. - NODE *temp = this->alloc_node (); + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp = this->alloc_node (); // Use operator placement new. - this->head_ = new (temp) NODE (type, - act, - future_time, - interval, - this->head_, - timer_id); + this->head_ = new (temp) ACE_Timer_Node_T<TYPE, FUNCTOR> (type, + act, + future_time, + interval, + this->head_, + timer_id); return timer_id; } @@ -180,8 +178,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::schedule (const TYPE &type, // ascending order of absolute time to expire). else { - NODE *prev = this->head_; - NODE *after = this->head_->next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *prev = this->head_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *after = this->head_->next_; while (after != 0 && future_time > after->timer_value_) { @@ -189,15 +187,15 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::schedule (const TYPE &type, after = after->next_; } - NODE *temp = this->alloc_node (); + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp = this->alloc_node (); // Use operator placement new. - prev->next_ = new (temp) NODE (type, - act, - future_time, - interval, - after, - timer_id); + prev->next_ = new (temp) ACE_Timer_Node_T<TYPE, FUNCTOR> (type, + act, + future_time, + interval, + after, + timer_id); return timer_id; } } @@ -227,8 +225,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::cancel (int timer_id, ACE_TRACE ("ACE_Timer_List::cancel"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); - NODE *prev = 0; - NODE *curr = 0; + ACE_Timer_Node_T<TYPE, FUNCTOR> *prev = 0; + ACE_Timer_Node_T<TYPE, FUNCTOR> *curr = 0; // Try to locate the ACE_Timer_Node that matches the timer_id. @@ -268,8 +266,8 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::cancel (const TYPE &type, ACE_TRACE ("ACE_Timer_List::cancel"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); - NODE *prev = 0; - NODE *curr = this->head_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *prev = 0; + ACE_Timer_Node_T<TYPE, FUNCTOR> *curr = this->head_; int number_of_cancellations = 0; diff --git a/ace/Timer_List_T.h b/ace/Timer_List_T.h index de99c863113..ba2d84488ad 100644 --- a/ace/Timer_List_T.h +++ b/ace/Timer_List_T.h @@ -36,7 +36,7 @@ public: ACE_Timer_List_Iterator_T (ACE_Timer_List_T<TYPE, FUNCTOR> &); // Constructor. - virtual int next (NODE *&timer_node, + virtual int next (ACE_Timer_Node_T<TYPE, FUNCTOR> *&timer_node, const ACE_Time_Value &cur_time); // Pass back the next <timer_node> that hasn't been seen yet, if its // <time_value_> <= <cur_time>. In addition, moves the timer queue @@ -131,10 +131,10 @@ public: // Dump the state of an object. protected: - virtual NODE *alloc_node (void); + virtual ACE_Timer_Node_T<TYPE, FUNCTOR> *alloc_node (void); // Factory method that allocates a new node (uses operator new). - virtual void free_node (NODE *); + virtual void free_node (ACE_Timer_Node_T<TYPE, FUNCTOR> *); // Factory method that frees a previously allocated node (uses // operator delete). @@ -145,13 +145,13 @@ private: // timer id returned from this method will never == -1 to avoid // conflicts with other failure return values. - virtual void reschedule (NODE *); + virtual void reschedule (ACE_Timer_Node_T<TYPE, FUNCTOR> *); // Reschedule an "interval" <ACE_Timer_Node>. - virtual ITERATOR &iter (void); + virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR> &iter (void); // Returns a pointer to this <ACE_Timer_Queue>'s iterator. - NODE *head_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *head_; // Pointer to linked list of <ACE_Timer_Handles>. LIST_ITERATOR iterator_; diff --git a/ace/Timer_Queue_T.cpp b/ace/Timer_Queue_T.cpp index 0a259b2fa53..f02ab7e5005 100644 --- a/ace/Timer_Queue_T.cpp +++ b/ace/Timer_Queue_T.cpp @@ -173,7 +173,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR>::expire (const ACE_Time_Value &cur_time) // Keep looping while there are timers remaining and the earliest // timer is <= the <cur_time> passed in to the method. - for (NODE *expired; + for (ACE_Timer_Node_T<TYPE, FUNCTOR> *expired; iter.next (expired, cur_time) != 0; ) { diff --git a/ace/Timer_Queue_T.h b/ace/Timer_Queue_T.h index 6c407c93d05..8dedf64ea24 100644 --- a/ace/Timer_Queue_T.h +++ b/ace/Timer_Queue_T.h @@ -59,15 +59,12 @@ class ACE_Timer_Node_T friend class ACE_Timer_Wheel_T<TYPE, FUNCTOR>; friend class ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR>; - typedef ACE_Timer_Node_T<TYPE, FUNCTOR> NODE; - // Typedef for self - // = Initialization methods. ACE_Timer_Node_T (const TYPE &type, const void *a, const ACE_Time_Value &t, const ACE_Time_Value &i, - NODE *n, + ACE_Timer_Node_T<TYPE, FUNCTOR> *n, int timer_id); // Constructor. @@ -75,8 +72,8 @@ class ACE_Timer_Node_T const void *a, const ACE_Time_Value &t, const ACE_Time_Value &i, - NODE *p, - NODE *n, + ACE_Timer_Node_T<TYPE, FUNCTOR> *p, + ACE_Timer_Node_T<TYPE, FUNCTOR> *n, int timer_id); // Constructor for the doubly linked list version. @@ -97,10 +94,10 @@ class ACE_Timer_Node_T // If this is a periodic timer this holds the time until the next // timeout. - NODE *prev_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *prev_; // Pointer to previous timer. - NODE *next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *next_; // Pointer to next timer. int timer_id_; @@ -124,14 +121,14 @@ class ACE_Timer_Queue_Iterator_T // the head of the timer queue up by one every time. { public: - - typedef ACE_Timer_Node_T<TYPE, FUNCTOR> NODE; - // Type of the Node - + // = Initialization and termination methods. ACE_Timer_Queue_Iterator_T (void); + // Constructor. + virtual ~ACE_Timer_Queue_Iterator_T (void); + // Destructor. - virtual int next (NODE *&timer_node, + virtual int next (ACE_Timer_Node_T<TYPE, FUNCTOR> *&timer_node, const ACE_Time_Value &cur_time) = 0; // Pass back the next <timer_node> that hasn't been seen yet, if its // <time_value_> <= <cur_time>. In addition, moves the timer queue @@ -150,9 +147,6 @@ class ACE_Timer_Queue_T // and <ACE_Timer_Heap>. { public: - typedef ACE_Timer_Node_T<TYPE, FUNCTOR> NODE; - // Type of Node - typedef ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR> ITERATOR; // Type of Iterator @@ -255,16 +249,16 @@ protected: // This method will call the <functor> with the <type>, <act> and // <time> - virtual void reschedule (NODE *) = 0; + virtual void reschedule (ACE_Timer_Node_T<TYPE, FUNCTOR> *) = 0; // Reschedule an "interval" <ACE_Timer_Node>. virtual ITERATOR &iter (void) = 0; // Returns a pointer to this <ACE_Timer_Queue>'s iterator. - virtual NODE *alloc_node (void) = 0; + virtual ACE_Timer_Node_T<TYPE, FUNCTOR> *alloc_node (void) = 0; // Factory method that allocates a new node. - virtual void free_node (NODE *) = 0; + virtual void free_node (ACE_Timer_Node_T<TYPE, FUNCTOR> *) = 0; // Factory method that frees a previously allocated node. #if defined (ACE_MT_SAFE) diff --git a/ace/Timer_Wheel_T.cpp b/ace/Timer_Wheel_T.cpp index ae995155fd6..aef170018f8 100644 --- a/ace/Timer_Wheel_T.cpp +++ b/ace/Timer_Wheel_T.cpp @@ -69,12 +69,12 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::ACE_Timer_Wheel_T (size_t wheelsize, size_t i; // Create the timing wheel - ACE_NEW (this->wheel_, NODE *[wheelsize]); + ACE_NEW (this->wheel_, (ACE_Timer_Node_T<TYPE, FUNCTOR> *[wheelsize])); for (i = 0; i < wheelsize; i++) { // Create the dummy nodes - NODE *tempnode = this->alloc_node (); + ACE_Timer_Node_T<TYPE, FUNCTOR> *tempnode = this->alloc_node (); tempnode->next_ = tempnode->prev_ = tempnode; this->wheel_[i] = tempnode; } @@ -82,8 +82,8 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::ACE_Timer_Wheel_T (size_t wheelsize, // Do the preallocation for (i = 0; i < prealloc; i++) { - NODE *temp; - ACE_NEW (temp, NODE); + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp; + ACE_NEW (temp, (ACE_Timer_Node_T<TYPE, FUNCTOR>)); temp->next_ = this->freelist_; this->freelist_ = temp; } @@ -100,7 +100,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::~ACE_Timer_Wheel_T (void) // delete nodes until only the dummy node is left while (this->wheel_[i]->next_ != this->wheel_[i]) { - NODE *next = this->wheel_[i]->next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *next = this->wheel_[i]->next_; this->wheel_[i]->next_ = next->next_; next->next_->prev_ = this->wheel_[i]; this->free_node (next); @@ -113,7 +113,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::~ACE_Timer_Wheel_T (void) // Get rid of the freelist now while (this->freelist_ != NULL) { - NODE *temp = this->freelist_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp = this->freelist_; this->freelist_ = temp->next_; delete temp; } @@ -167,14 +167,14 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::schedule (const TYPE &type, ACE_TRACE ("ACE_Timer_Wheel_T::schedule"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); - NODE *tempnode = this->alloc_node (); + ACE_Timer_Node_T<TYPE, FUNCTOR> *tempnode = this->alloc_node (); if (tempnode) { // Note that the timer_id is actually the pointer to the node // Use operator placement new. - new (tempnode) NODE (type, + new (tempnode) ACE_Timer_Node_T<TYPE, FUNCTOR> (type, act, delay, interval, @@ -202,7 +202,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::cancel (const TYPE &type, for (size_t i = 0; i < this->wheel_size_; i++) { - NODE *curr = this->wheel_[i]->next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *curr = this->wheel_[i]->next_; while (curr != this->wheel_[i]) { @@ -216,7 +216,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::cancel (const TYPE &type, // two args) this->upcall_functor_.operator () (*this, curr->type_); - NODE *tempnode = curr; + ACE_Timer_Node_T<TYPE, FUNCTOR> *tempnode = curr; curr->prev_->next_ = curr->next_; curr->next_->prev_ = curr->prev_; curr = curr->next_; @@ -242,11 +242,11 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::cancel (int timer_id, ACE_TRACE ("ACE_Timer_Wheel_T::cancel"); ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, this->lock_, -1)); - NODE *node = (NODE *) timer_id; + ACE_Timer_Node_T<TYPE, FUNCTOR> *node = (ACE_Timer_Node_T<TYPE, FUNCTOR> *) timer_id; ACE_ASSERT (timer_id == node->timer_id_); - // Check to see if the node looks like a true NODE + // Check to see if the node looks like a true ACE_Timer_Node_T<TYPE, FUNCTOR> if (timer_id == node->timer_id_) { node->next_->prev_ = node->prev_; @@ -284,7 +284,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::dump (void) const for (size_t i = 0; i < this->wheel_size_; i++) { ACE_DEBUG ((LM_DEBUG, "%d\n", i)); - NODE *temp = this->wheel_[i]->next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp = this->wheel_[i]->next_; while (temp != this->wheel_[i]) { temp->dump (); @@ -298,12 +298,12 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::dump (void) const template <class TYPE, class FUNCTOR> ACE_Timer_Node_T<TYPE, FUNCTOR> * ACE_Timer_Wheel_T<TYPE, FUNCTOR>::alloc_node (void) { - NODE *temp; + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp; if (this->freelist_ == NULL) { ACE_NEW_RETURN (temp, - NODE, + (ACE_Timer_Node_T<TYPE, FUNCTOR>), 0); } else @@ -352,7 +352,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::remove (void) } // Remove and return - NODE *temp = this->wheel_[earliest_pos]->next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *temp = this->wheel_[earliest_pos]->next_; temp->prev_->next_ = temp->next_; temp->next_->prev_ = temp->prev_; @@ -370,7 +370,7 @@ ACE_Timer_Wheel_T<TYPE, FUNCTOR>::reschedule (ACE_Timer_Node_T<TYPE, FUNCTOR> *e // Insert time into dummy node this->wheel_[pos]->timer_value_ = expired->timer_value_; - NODE *cursor = this->wheel_[pos]->next_; + ACE_Timer_Node_T<TYPE, FUNCTOR> *cursor = this->wheel_[pos]->next_; // Find position to insert while (cursor->timer_value_ < expired->timer_value_) diff --git a/ace/Timer_Wheel_T.h b/ace/Timer_Wheel_T.h index a9661d34bd5..855904d4f12 100644 --- a/ace/Timer_Wheel_T.h +++ b/ace/Timer_Wheel_T.h @@ -35,7 +35,7 @@ public: ACE_Timer_Wheel_Iterator_T (ACE_Timer_Wheel_T<TYPE, FUNCTOR> &); // Constructor. - virtual int next (NODE *&timer_node, + virtual int next (ACE_Timer_Node_T<TYPE, FUNCTOR> *&timer_node, const ACE_Time_Value &cur_time); // Pass back the next <timer_node> that hasn't been seen yet, if its // <time_value_> <= <cur_time>. In addition, moves the timer queue @@ -129,24 +129,24 @@ public: // Dump the state of an object. protected: - virtual NODE *alloc_node (void); + virtual ACE_Timer_Node_T<TYPE, FUNCTOR> *alloc_node (void); // Factory method that allocates a new node (uses operator new). - virtual void free_node (NODE *); + virtual void free_node (ACE_Timer_Node_T<TYPE, FUNCTOR> *); // Factory method that frees a previously allocated node (uses // operator delete). private: - NODE *remove (void); + ACE_Timer_Node_T<TYPE, FUNCTOR> *remove (void); // Removes the earliest node and returns a pointer to it. - virtual void reschedule (NODE *); + virtual void reschedule (ACE_Timer_Node_T<TYPE, FUNCTOR> *); // Reschedule an "interval" node - virtual ITERATOR &iter (void); + virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR> &iter (void); // Returns a pointer to this <ACE_Timer_Queue_T>'s iterator. - NODE **wheel_; + ACE_Timer_Node_T<TYPE, FUNCTOR> **wheel_; // Timing Wheel. size_t wheel_size_; @@ -167,8 +167,8 @@ private: ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR> iterator_; // Iterator used to expire timers. - NODE *freelist_; - // Pointer to the freelist of <NODE>. + ACE_Timer_Node_T<TYPE, FUNCTOR> *freelist_; + // Pointer to the freelist of <ACE_Timer_Node_T<TYPE, FUNCTOR>>. // = Don't allow these operations for now. ACE_Timer_Wheel_T (const ACE_Timer_Wheel_T &); diff --git a/ace/config-irix6.2-sgic++-nothreads.h b/ace/config-irix6.2-sgic++-nothreads.h index 76fe2f86b4d..4090f026898 100644 --- a/ace/config-irix6.2-sgic++-nothreads.h +++ b/ace/config-irix6.2-sgic++-nothreads.h @@ -11,6 +11,7 @@ // Include XtReactor into the library. #define ACE_HAS_XT +#define ACE_LACKS_IOSTREAM_SETGET // Platform supports getpagesize() call. #define ACE_HAS_GETPAGESIZE diff --git a/ace/config-irix6.2-sgic++.h b/ace/config-irix6.2-sgic++.h index 7a99194cb6e..f99ce88040d 100644 --- a/ace/config-irix6.2-sgic++.h +++ b/ace/config-irix6.2-sgic++.h @@ -13,6 +13,7 @@ #if !defined (ACE_CONFIG_H) #define ACE_CONFIG_H +#define ACE_LACKS_IOSTREAM_SETGET #define ACE_HAS_IRIX62_THREADS #define ACE_HAS_PTHREAD_SIGMASK |