diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-09-16 23:37:28 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-09-16 23:37:28 +0000 |
commit | b0c2215400c73c76bf943be729bd7cb9ac9937e7 (patch) | |
tree | 0a66ad6416a461420129850dfd66bc20d13f294d /ace | |
parent | 240a318fb9204b3fc4dfcdf7f217e6b38aed9027 (diff) | |
download | ATCD-b0c2215400c73c76bf943be729bd7cb9ac9937e7.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Asynch_Acceptor.cpp | 19 | ||||
-rw-r--r-- | ace/Containers.h | 126 | ||||
-rw-r--r-- | ace/Containers.i | 126 | ||||
-rw-r--r-- | ace/config-hpux-11.x-hpc++.h | 3 |
4 files changed, 176 insertions, 98 deletions
diff --git a/ace/Asynch_Acceptor.cpp b/ace/Asynch_Acceptor.cpp index 797844850e1..190d45942a3 100644 --- a/ace/Asynch_Acceptor.cpp +++ b/ace/Asynch_Acceptor.cpp @@ -85,7 +85,8 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, // Bind to the specified port. if (ACE_OS::bind (this->listen_handle_, - (sockaddr *) address.get_addr (), + ACE_reinterpret_cast (sockaddr *, + address.get_addr ()), address.get_size ()) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", @@ -300,7 +301,8 @@ ACE_Asynch_Acceptor<HANDLER>::parse_address (const ACE_Asynch_Accept::Result &re remote_size)); // Set the address. - remote_address.set_addr ((sockaddr_in *) message_block.rd_ptr (), + remote_address.set_addr (ACE_reinterpret_cast (sockaddr_in *, + message_block.rd_ptr ()), remote_size); // Update the <rd_ptr>. @@ -313,8 +315,9 @@ ACE_Asynch_Acceptor<HANDLER>::parse_address (const ACE_Asynch_Accept::Result &re // Get the address. sockaddr_in local_addr; - if (getsockname (result.accept_handle (), - (sockaddr *) &local_addr, + if (ACE_OS::getsockname (result.accept_handle (), + ACE_reinterpret_cast (sockaddr *, + &local_addr), &local_size) < 0) ACE_ERROR ((LM_ERROR, "%p\n", @@ -350,8 +353,12 @@ ACE_Asynch_Acceptor<HANDLER>::parse_address (const ACE_Asynch_Accept::Result &re &remote_addr, &remote_size); - local_address.set_addr ((sockaddr_in *) local_addr, local_size); - remote_address.set_addr ((sockaddr_in *) remote_addr, remote_size); + local_address.set_addr (ACE_reinterpret_cast (sockaddr_in *, + local_addr), + local_size); + remote_address.set_addr (ACE_reinterpret_cast (sockaddr_in *, + remote_addr), + remote_size); #else // just in case errno = ENOTSUP; diff --git a/ace/Containers.h b/ace/Containers.h index f59dbff66d9..2fc87799a1c 100644 --- a/ace/Containers.h +++ b/ace/Containers.h @@ -677,38 +677,23 @@ protected: // Allocation Strategy of the queue. }; +#if !defined (ACE_LACKS_TEMPLATE_AS_TEMPLATE_PARAMETER) -#if ! defined (ACE_LACKS_TEMPLATE_AS_TEMPLATE_PARAMETER) - -// -// I found ACE_Double_Linked_List really difficult to use. So, I create -// another layer of abstraction on top of it to make it easier to use. -// -- jxh template <class T> class ACE_DLList; template <class T> class ACE_DLList_Iterator; template <class T> class ACE_DLList_Node { -friend class ACE_DLList<T>; -friend class ACE_DLList_Iterator<T>; + friend class ACE_DLList<T>; + friend class ACE_DLList_Iterator<T>; public: - ACE_DLList_Node (void) - : item_ (0), - next_ (0), - prev_ (0) - {}; - + ACE_DLList_Node (void); ACE_DLList_Node (T *&i, ACE_DLList_Node<T> *n = 0, - ACE_DLList_Node<T> *p = 0) - : item_ (i), - next_ (n), - prev_ (p) - {}; - - ~ACE_DLList_Node (void) {}; + ACE_DLList_Node<T> *p = 0); + ~ACE_DLList_Node (void); // This isn't necessary, but it keeps the compiler happy. T * item_; @@ -719,27 +704,24 @@ public: }; template <class T> -class ACE_DLList - : private ACE_Double_Linked_List< ACE_DLList_Node<T> > +class ACE_DLList : private ACE_Double_Linked_List< ACE_DLList_Node<T> > { -friend class ACE_DLList_Node<T>; -friend class ACE_DLList_Iterator<T>; - + friend class ACE_DLList_Node<T>; + friend class ACE_DLList_Iterator<T>; public: - typedef ACE_Double_Linked_List< ACE_DLList_Node<T> > DLList; - typedef ACE_DLList_Node<T> DLList_NODE; - typedef ACE_DLList_Iterator<T> DLList_ITERATOR; + typedef ACE_Double_Linked_List< ACE_DLList_Node<T> > + DLList; + typedef ACE_DLList_Node<T> + DLList_NODE; + typedef ACE_DLList_Iterator<T> + DLList_ITERATOR; - void operator= (ACE_DLList<T> &l) { *(DLList *)this = l; }; + void operator= (ACE_DLList<T> &l); // = Check boundary conditions. - - int is_empty (void) const - { return ACE_Double_Linked_List< ACE_DLList_Node<T> >::is_empty (); }; - - int is_full (void) const - { return ACE_Double_Linked_List< ACE_DLList_Node<T> >::is_full (); }; + int is_empty (void) const; + int is_full (void) const; // = Classic queue operations. @@ -750,77 +732,37 @@ public: // = Additional utility methods. - void reset (void) - { ACE_Double_Linked_List< ACE_DLList_Node<T> >::reset (); }; - - int get (T *&item, size_t index = 0) - { - DLList_NODE *node; - int result - = ACE_Double_Linked_List< ACE_DLList_Node<T> >::get (node, index); - item = node->item_; - return result; - }; - - size_t size (void) const - { return ACE_Double_Linked_List< ACE_DLList_Node<T> >::size (); }; - - void dump (void) const - { ACE_Double_Linked_List< ACE_DLList_Node<T> >::dump (); }; + void reset (void); + int get (T *&item, size_t index = 0); + size_t size (void) const; + void dump (void) const; ACE_ALLOC_HOOK_DECLARE; // = Initialization and termination methods. - ACE_DLList (ACE_Allocator *alloc = 0) - : ACE_Double_Linked_List< ACE_DLList_Node<T> > (alloc) {}; - - ACE_DLList (ACE_DLList<T> &l) - : ACE_Double_Linked_List< ACE_DLList_Node<T> > ((DLList &)l) {}; - - ~ACE_DLList (void) { while (this->delete_head ()) ; }; - -private: + ACE_DLList (ACE_Allocator *alloc = 0); + ACE_DLList (ACE_DLList<T> &l); + ~ACE_DLList (void); }; template <class T> -class ACE_DLList_Iterator - : private ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> > +class ACE_DLList_Iterator : private ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> > { -friend class ACE_DLList<T>; -friend class ACE_DLList_Node<T>; - + friend class ACE_DLList<T>; + friend class ACE_DLList_Node<T>; public: // = Initialization method. - ACE_DLList_Iterator (ACE_DLList<T> &l) - : ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> > (l) {}; + ACE_DLList_Iterator (ACE_DLList<T> &l); // = Iteration methods. - T *next (void) const - { - ACE_DLList_Node<T> *temp - = ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> > - ::next (); - return temp ? temp->item_ : 0; - }; - - int advance (void) - { return - ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::advance (); }; - - int first (void) - { return - ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::first (); }; - - int done (void) const - { return - ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::done (); }; - - void dump (void) const - { ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::dump (); }; + T *next (void) const; + int advance (void); + int first (void); + int done (void) const; + void dump (void) const; ACE_ALLOC_HOOK_DECLARE; - }; #endif /* ! defined (ACE_LACKS_TEMPLATE_AS_TEMPLATE_PARAMETER) */ diff --git a/ace/Containers.i b/ace/Containers.i index c49f95438a4..05c55c3ed86 100644 --- a/ace/Containers.i +++ b/ace/Containers.i @@ -376,3 +376,129 @@ ACE_Array_Iterator<T>::done (void) const return this->current_ >= array_.size (); } + +template <class T> ACE_INLINE +ACE_DLList_Node::ACE_DLList_Node (void) + : item_ (0), + next_ (0), + prev_ (0) +{} + +template <class T> ACE_INLINE +ACE_DLList_Node::ACE_DLList_Node (T *&i, + ACE_DLList_Node<T> *n, + ACE_DLList_Node<T> *p) + : item_ (i), + next_ (n), + prev_ (p) +{ +} + +template <class T> ACE_INLINE +ACE_DLList_Node::~ACE_DLList_Node (void) +{ +}; + +template <class T> ACE_INLINE void +ACE_DLList::operator= (ACE_DLList<T> &l) +{ + *(DLList *) this = l; +} + +template <class T> ACE_INLINE int +ACE_DLList::is_empty (void) const +{ + return ACE_Double_Linked_List< ACE_DLList_Node<T> >::is_empty (); +} + +template <class T> ACE_INLINE int +ACE_DLList::is_full (void) const +{ + return ACE_Double_Linked_List< ACE_DLList_Node<T> >::is_full (); +} + +template <class T> ACE_INLINE void +ACE_DLList::eset (void) +{ + ACE_Double_Linked_List< ACE_DLList_Node<T> >::reset (); +} + +template <class T> ACE_INLINE int +ACE_DLList::get (T *&item, size_t index) +{ + DLList_NODE *node; + int result + = ACE_Double_Linked_List< ACE_DLList_Node<T> >::get (node, + index); + item = node->item_; + return result; +} + +template <class T> ACE_INLINE size_t +ACE_DLList::size (void) const +{ + return ACE_Double_Linked_List< ACE_DLList_Node<T> >::size (); +} + +template <class T> ACE_INLINE void +ACE_DLList::dump (void) const +{ + ACE_Double_Linked_List< ACE_DLList_Node<T> >::dump (); +} + +template <class T> ACE_INLINE +ACE_DLList::ACE_DLList (ACE_Allocator *alloc ) + : ACE_Double_Linked_List< ACE_DLList_Node<T> > (alloc) +{ +} + +template <class T> ACE_INLINE +ACE_DLList::ACE_DLList (ACE_DLList<T> &l) + : ACE_Double_Linked_List< ACE_DLList_Node<T> > ((DLList &) l) +{ +} + +template <class T> ACE_INLINE +ACE_DLList::~ACE_DLList (void) +{ + while (this->delete_head ()) ; +} + +template <class T> ACE_INLINE +ACE_DLList_Iterator::ACE_DLList_Iterator (ACE_DLList<T> &l) + : ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> > (l) +{ +} + +template <class T> ACE_INLINE T * +ACE_DLList_Iterator::next (void) const +{ + ACE_DLList_Node<T> *temp + = ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::next (); + return temp ? temp->item_ : 0; +} + +template <class T> ACE_INLINE int +ACE_DLList_Iterator::advance (void) +{ + return ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::advance (); +} + +template <class T> ACE_INLINE int +ACE_DLList_Iterator::first (void) +{ + return ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::first (); +} + +template <class T> ACE_INLINE int +ACE_DLList_Iterator::done (void) const +{ + return ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::done (); +} + +template <class T> ACE_INLINE void +ACE_DLList_Iterator::dump (void) const +{ + ACE_Double_Linked_List_Iterator< ACE_DLList_Node<T> >::dump (); +} + diff --git a/ace/config-hpux-11.x-hpc++.h b/ace/config-hpux-11.x-hpc++.h index e244459a5a1..86662805589 100644 --- a/ace/config-hpux-11.x-hpc++.h +++ b/ace/config-hpux-11.x-hpc++.h @@ -93,6 +93,9 @@ // Compiler doesn't handle 'signed char' correctly (used in ace/IOStream.h) #define ACE_LACKS_SIGNED_CHAR +#define ACE_HAS_DIRENT +#define ACE_HAS_GPERF + #include "ace/config-hpux11.h" /* OS information */ #endif /* ACE_CONFIG_H */ |