diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-08-31 17:13:20 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-08-31 17:13:20 +0000 |
commit | 3379f45428e1f86e22d878ac47d3bb54b96d0149 (patch) | |
tree | ec23eca55a1109af326b1962fe3756a7b00d3b4e | |
parent | 6f97c830690a77c70bc7bb1b9e631bef4d10766d (diff) | |
download | ATCD-3379f45428e1f86e22d878ac47d3bb54b96d0149.tar.gz |
ChangeLogTag:Tue Aug 31 00:16:34 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
33 files changed, 2314 insertions, 2438 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index a15bacbfea9..3841e98da32 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,5 +1,14 @@ Tue Aug 31 00:16:34 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * ace/Process.cpp: Need to #include "ace/Signal.h". + + * Added a series of fixes that allow ACE to build and + run cleanly with SunC++ 5.0 and Solaris 7 even when debugging is + NOT enabled. These changes require moving the explicit template + instantiations from the BOTTOM of the *.cpp files to near the + top. Thanks to Robert Shewan <rshew@peri.com> for reporting + this. + * ace/Process_Manager.cpp: Fixed some warnings. Thanks to Carlos for reporting this. diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index ef5aa589579..a3252c203bb 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,12 @@ +Tue Aug 31 00:16:34 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * Added a series of fixes that allow TAO to build and + run cleanly with SunC++ 5.0 and Solaris 7 even when debugging is + NOT enabled. These changes require moving the explicit template + instantiations from the BOTTOM of the *.cpp files to near the + top. Thanks to Robert Shewan <rshew@peri.com> for reporting + this. + Tue Aug 31 9:25:00 1999 Michael Kircher <Michael.Kircher@mchp.siemens.de> * tao/TAO.dsp: diff --git a/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp index 4120f0a3aca..9d986f321ed 100644 --- a/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp @@ -5,16 +5,16 @@ #include "orbsvcs/Channel_Clients_T.h" +ACE_RCSID(orbsvcs, Channel_Clients_T, "$Id$") + #if !defined (__ACE_INLINE__) #include "orbsvcs/Channel_Clients_T.i" #endif /* __ACE_INLINE__ */ -ACE_RCSID(orbsvcs, Channel_Clients_T, "$Id$") - template<class TARGET> void ACE_PushConsumer_Adapter<TARGET>::push (const RtecEventComm::EventSet& events, CORBA::Environment &TAO_IN_ENV) - ACE_THROW_SPEC (( CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { target_->push (events, TAO_IN_ENV); } @@ -22,7 +22,7 @@ ACE_PushConsumer_Adapter<TARGET>::push (const RtecEventComm::EventSet& events, template<class TARGET> void ACE_PushConsumer_Adapter<TARGET>::disconnect_push_consumer ( CORBA::Environment &TAO_IN_ENV) - ACE_THROW_SPEC (( CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { target_->disconnect_push_consumer (TAO_IN_ENV); @@ -31,7 +31,7 @@ ACE_PushConsumer_Adapter<TARGET>::disconnect_push_consumer ( template<class TARGET> void ACE_PushSupplier_Adapter<TARGET>::disconnect_push_supplier ( CORBA::Environment &TAO_IN_ENV) - ACE_THROW_SPEC (( CORBA::SystemException)) + ACE_THROW_SPEC ((CORBA::SystemException)) { target_->disconnect_push_supplier (TAO_IN_ENV); } diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp index 815677f653f..3b382128bd7 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp @@ -6,6 +6,30 @@ ACE_RCSID(Event, EC_Gateway, "$Id$") + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_PushConsumer_Adapter<TAO_EC_Gateway_IIOP>; +template class ACE_PushSupplier_Adapter<TAO_EC_Gateway_IIOP>; +template class ACE_Map_Entry<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr>; +template class ACE_Map_Manager<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex>; +template class ACE_Map_Iterator_Base<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex>; +template class ACE_Map_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex>; +template class ACE_Map_Reverse_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex>; + +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_PushConsumer_Adapter<TAO_EC_Gateway_IIOP> +#pragma instantiate ACE_PushSupplier_Adapter<TAO_EC_Gateway_IIOP> + +#pragma instantiate ACE_Map_Entry<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr> +#pragma instantiate ACE_Map_Manager<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator_Base<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> +#pragma instantiate ACE_Map_Reverse_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + TAO_EC_Gateway::TAO_EC_Gateway (void) : handle_ (0) { @@ -27,8 +51,6 @@ TAO_EC_Gateway::observer_handle (void) const return this->handle_; } -// **************************************************************** - TAO_EC_Gateway_IIOP::TAO_EC_Gateway_IIOP (void) : busy_count_ (0), update_posted_ (0), @@ -471,26 +493,3 @@ TAO_EC_Gateway_IIOP::shutdown (CORBA::Environment& ACE_TRY_ENV) return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_PushConsumer_Adapter<TAO_EC_Gateway_IIOP>; -template class ACE_PushSupplier_Adapter<TAO_EC_Gateway_IIOP>; -template class ACE_Map_Entry<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr>; -template class ACE_Map_Manager<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex>; -template class ACE_Map_Iterator_Base<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex>; -template class ACE_Map_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex>; -template class ACE_Map_Reverse_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex>; - -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_PushConsumer_Adapter<TAO_EC_Gateway_IIOP> -#pragma instantiate ACE_PushSupplier_Adapter<TAO_EC_Gateway_IIOP> - -#pragma instantiate ACE_Map_Entry<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr> -#pragma instantiate ACE_Map_Manager<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> -#pragma instantiate ACE_Map_Iterator_Base<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> -#pragma instantiate ACE_Map_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> -#pragma instantiate ACE_Map_Reverse_Iterator<RtecEventComm::EventSourceID,RtecEventChannelAdmin::ProxyPushConsumer_ptr,ACE_Null_Mutex> - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp index 16474b3da3f..1b38ff9c583 100644 --- a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp @@ -20,6 +20,82 @@ ACE_RCSID(Event, Event_Channel, "$Id$") #include "tao/Timeprobe.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_Atomic_Op<ACE_ES_MUTEX, int>; +template class ACE_Map_Entry<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT>; +template class ACE_Map_Entry<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT>; +template class ACE_Map_Entry<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry>; +template class ACE_Map_Manager<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Manager<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Manager<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex>; +template class ACE_Map_Iterator_Base<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Iterator_Base<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Iterator_Base<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex>; +template class ACE_Map_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Iterator<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex>; +template class ACE_Map_Reverse_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Reverse_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Reverse_Iterator<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex>; +template class ACE_Node<ACE_ES_Consumer_Rep *>; +template class ACE_Node<ACE_Push_Consumer_Proxy *>; +template class ACE_Node<ACE_Push_Supplier_Proxy *>; +template class ACE_Unbounded_Set<ACE_ES_Consumer_Rep *>; +template class ACE_Unbounded_Set<ACE_Push_Consumer_Proxy *>; +template class ACE_Unbounded_Set<ACE_Push_Supplier_Proxy *>; +template class ACE_Unbounded_Set_Iterator<ACE_ES_Consumer_Rep *>; +template class ACE_Unbounded_Set_Iterator<ACE_Push_Consumer_Proxy *>; +template class ACE_Unbounded_Set_Iterator<ACE_Push_Supplier_Proxy *>; + +template class ACE_Auto_Basic_Ptr<ACE_Push_Supplier_Proxy>; +template class ACE_Auto_Basic_Ptr<ACE_Push_Consumer_Proxy>; +template class auto_ptr<ACE_Push_Supplier_Proxy>; +template class auto_ptr<ACE_Push_Consumer_Proxy>; + +template class ACE_Array<TAO_EC_Event>; +template class ACE_Array_Base<TAO_EC_Event>; +template class ACE_Array_Iterator<TAO_EC_Event>; + +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_Atomic_Op<ACE_ES_MUTEX, int> +#pragma instantiate ACE_Map_Entry<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT> +#pragma instantiate ACE_Map_Entry<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT> +#pragma instantiate ACE_Map_Entry<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry> +#pragma instantiate ACE_Map_Manager<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH> +#pragma instantiate ACE_Map_Manager<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH> +#pragma instantiate ACE_Map_Manager<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator_Base<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH> +#pragma instantiate ACE_Map_Iterator_Base<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH> +#pragma instantiate ACE_Map_Iterator_Base<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH> +#pragma instantiate ACE_Map_Iterator<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH> +#pragma instantiate ACE_Map_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH> +#pragma instantiate ACE_Map_Reverse_Iterator<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex> +#pragma instantiate ACE_Node<ACE_ES_Consumer_Rep *> +#pragma instantiate ACE_Node<ACE_Push_Consumer_Proxy *> +#pragma instantiate ACE_Node<ACE_Push_Supplier_Proxy *> +#pragma instantiate ACE_Unbounded_Set<ACE_ES_Consumer_Rep *> +#pragma instantiate ACE_Unbounded_Set<ACE_Push_Consumer_Proxy *> +#pragma instantiate ACE_Unbounded_Set<ACE_Push_Supplier_Proxy *> +#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_ES_Consumer_Rep *> +#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_Push_Consumer_Proxy *> +#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_Push_Supplier_Proxy *> + +#pragma instantiate ACE_Auto_Basic_Ptr<ACE_Push_Supplier_Proxy> +#pragma instantiate ACE_Auto_Basic_Ptr<ACE_Push_Consumer_Proxy> +#pragma instantiate auto_ptr<ACE_Push_Supplier_Proxy> +#pragma instantiate auto_ptr<ACE_Push_Consumer_Proxy> + +#pragma instantiate ACE_Array<TAO_EC_Event> +#pragma instantiate ACE_Array_Base<TAO_EC_Event> +#pragma instantiate ACE_Array_Iterator<TAO_EC_Event> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + #if defined (ACE_ENABLE_TIMEPROBES) static const char *TAO_Event_Channel_Timeprobe_Description[] = @@ -81,8 +157,6 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Event_Channel_Timeprobe_Description, #endif /* ACE_ENABLE_TIMEPROBES */ -// ************************************************************ - static RtecScheduler::Preemption_Priority_t Preemption_Priority (RtecScheduler::Scheduler_ptr scheduler, RtecScheduler::handle_t rtinfo, @@ -123,23 +197,21 @@ IntervalToPriority (RtecScheduler::Time interval) return ACE_Scheduler_MIN_PREEMPTION_PRIORITY; } -// ************************************************************ - class TAO_ORBSVCS_Export Shutdown_Consumer : public ACE_ES_Dispatch_Request -// = TITLE -// Shutdown Consumer command -// -// = DESCRIPTION -// This command object is sent through the system when a consumer -// disconnects. When the Dispatching Module dequeues this request, -// it calls execute which execute calls back to the Consumer -// Module. At that point, the Consumer Module can tell the rest of -// the system that the consumer has disconnected and delete the -// consumer proxy. This allows all events queued for the consumer -// to be flushed to the consumer proxy (which will drop them). -// Events can be queued in the ReactorEx (in a dispatch set), or in -// the Dispatching Module. { + // = TITLE + // Shutdown Consumer command + // + // = DESCRIPTION + // This command object is sent through the system when a consumer + // disconnects. When the Dispatching Module dequeues this request, + // it calls execute which execute calls back to the Consumer + // Module. At that point, the Consumer Module can tell the rest of + // the system that the consumer has disconnected and delete the + // consumer proxy. This allows all events queued for the consumer + // to be flushed to the consumer proxy (which will drop them). + // Events can be queued in the ReactorEx (in a dispatch set), or in + // the Dispatching Module. public: // When executed, tells <consumer_module> that <consumer> has shut // down. @@ -147,69 +219,67 @@ public: ACE_Push_Consumer_Proxy *consumer, RtecScheduler::Scheduler_ptr scheduler) : consumer_module_ (consumer_module) - { - consumer_ = consumer; + { + consumer_ = consumer; - // Set rt_info_ to the lowest priority rt_info in consumer_. - // This is so the dispatching module can query us as a dispatch - // request to get the appropriate preemption priority. - ACE_ES_Dependency_Iterator iter (consumer->qos ().dependencies); + // Set rt_info_ to the lowest priority rt_info in consumer_. + // This is so the dispatching module can query us as a dispatch + // request to get the appropriate preemption priority. + ACE_ES_Dependency_Iterator iter (consumer->qos ().dependencies); - RtecScheduler::Preemption_Priority_t p = - ACE_Scheduler_MIN_PREEMPTION_PRIORITY; - while (iter.advance_dependency () == 0) - { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - RtecEventComm::EventType &type = (*iter).event.header.type; - - if (type != ACE_ES_GLOBAL_DESIGNATOR && - type != ACE_ES_CONJUNCTION_DESIGNATOR && - type != ACE_ES_DISJUNCTION_DESIGNATOR) - { - RtecScheduler::Preemption_Priority_t q = - ::Preemption_Priority (scheduler, (*iter).rt_info, - ACE_TRY_ENV); - ACE_TRY_CHECK; - if (rt_info_ == 0 || q < p) - { - this->rt_info_ = ((*iter).rt_info); - p = q; - } - } - } - ACE_CATCHANY - { - // Ignore exceptions... - } - ACE_ENDTRY; - } - } + RtecScheduler::Preemption_Priority_t p = + ACE_Scheduler_MIN_PREEMPTION_PRIORITY; + while (iter.advance_dependency () == 0) + { + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + RtecEventComm::EventType &type = (*iter).event.header.type; + + if (type != ACE_ES_GLOBAL_DESIGNATOR && + type != ACE_ES_CONJUNCTION_DESIGNATOR && + type != ACE_ES_DISJUNCTION_DESIGNATOR) + { + RtecScheduler::Preemption_Priority_t q = + ::Preemption_Priority (scheduler, (*iter).rt_info, + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (rt_info_ == 0 || q < p) + { + this->rt_info_ = ((*iter).rt_info); + p = q; + } + } + } + ACE_CATCHANY + { + // Ignore exceptions... + } + ACE_ENDTRY; + } + } // Report to the consumer module that consumer_ has shutdown. virtual int execute (u_long &command_action) - { - consumer_module_->shutdown_request (this); - command_action = ACE_RT_Task_Command::RELEASE; - return 0; - } + { + consumer_module_->shutdown_request (this); + command_action = ACE_RT_Task_Command::RELEASE; + return 0; + } #if 0 // @@ Memory allocators void *operator new (size_t /* nbytes */) - { return ::new char[sizeof (Shutdown_Consumer)]; } + { return ::new char[sizeof (Shutdown_Consumer)]; } void operator delete (void *buf) - { ::delete [] ACE_static_cast(char*,buf); } + { ::delete [] ACE_static_cast(char*,buf); } #endif /* 0 */ // The module that we report to. ACE_ES_Consumer_Module *consumer_module_; }; -// ************************************************************ - class TAO_ORBSVCS_Export Shutdown_Channel : public ACE_ES_Dispatch_Request { public: @@ -238,16 +308,14 @@ public: ACE_EventChannel *channel_; }; -// ************************************************************ - class TAO_ORBSVCS_Export Flush_Queue_ACT : public ACE_Command_Base -// = TITLE -// Flush Queue Asynchronous Completion Token -// -// = DESCRIPTION -// Carries a single dispatch request through the ReactorEx. -// Deletes itself when execute is called. { + // = TITLE + // Flush Queue Asynchronous Completion Token + // + // = DESCRIPTION + // Carries a single dispatch request through the ReactorEx. + // Deletes itself when execute is called. public: Flush_Queue_ACT (ACE_ES_Dispatch_Request *request, ACE_ES_Dispatching_Module *dispatching_module) : @@ -255,31 +323,29 @@ public: dispatching_module_ (dispatching_module) { } virtual int execute (void* /* arg = 0 */) - { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - ACE_ES_Dispatch_Request *request = request_; - dispatching_module_->push (request, ACE_TRY_ENV); - ACE_TRY_CHECK; - delete this; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Flush_Queue_ACT::execute, " - "unexpected exception"); - } - ACE_ENDTRY; - return 0; - } + { + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + ACE_ES_Dispatch_Request *request = request_; + dispatching_module_->push (request, ACE_TRY_ENV); + ACE_TRY_CHECK; + delete this; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Flush_Queue_ACT::execute, " + "unexpected exception"); + } + ACE_ENDTRY; + return 0; + } ACE_ES_Dispatch_Request *request_; ACE_ES_Dispatching_Module *dispatching_module_; }; -// ************************************************************ - void dump_event (const RtecEventComm::Event &event) { @@ -292,8 +358,6 @@ dump_event (const RtecEventComm::Event &event) ORBSVCS_Time::to_hrtime (event.header.creation_time) / 1)); } -// ************************************************************ - ACE_Push_Supplier_Proxy::ACE_Push_Supplier_Proxy (ACE_ES_Supplier_Module *sm) : supplier_module_ (sm), push_supplier_ (0) @@ -401,8 +465,6 @@ ACE_Push_Supplier_Proxy::shutdown (void) ACE_ENDTRY; } -// ************************************************************ - ACE_Push_Consumer_Proxy::ACE_Push_Consumer_Proxy (ACE_ES_Consumer_Module *cm) : push_consumer_ (0), consumer_module_ (cm) @@ -499,8 +561,6 @@ ACE_Push_Consumer_Proxy::shutdown (void) ACE_ENDTRY; } -// ************************************************************ - ACE_EventChannel::ACE_EventChannel (RtecScheduler::Scheduler_ptr scheduler, CORBA::Boolean activate_threads, u_long type, @@ -906,8 +966,6 @@ ACE_EventChannel::schedule_timer (RtecScheduler::handle_t rt_info, tv_interval); } -// **************************************************************** - ACE_EventChannel::Observer_Entry::Observer_Entry (void) : handle (0) { @@ -920,9 +978,6 @@ ACE_EventChannel::Observer_Entry::Observer_Entry (RtecEventChannelAdmin::Observe { } - -// **************************************************************** - ACE_ES_Disjunction_Group::~ACE_ES_Disjunction_Group (void) { } @@ -931,8 +986,6 @@ ACE_ES_Conjunction_Group::~ACE_ES_Conjunction_Group (void) { } -// ************************************************************ - ACE_ES_Subscription_Info::~ACE_ES_Subscription_Info (void) { Subscriber_Map_Iterator iter (type_subscribers_); @@ -1069,7 +1122,6 @@ ACE_ES_Subscription_Info::remove (SourceID_Map &source_subscribers, return 0; } - void ACE_ES_Subscription_Info::append_subscribers (Subscriber_Set &dest, Subscriber_Set &src) @@ -1178,8 +1230,6 @@ ACE_ES_Subscription_Info::insert_or_fail (Subscriber_Map &type_map, return 0; } -// ************************************************************ - ACE_ES_Consumer_Module::ACE_ES_Consumer_Module (ACE_EventChannel* channel) : lock_ (), all_consumers_ (), @@ -1547,8 +1597,6 @@ ACE_ES_Consumer_Module::fill_qos (RtecEventChannelAdmin::ConsumerQOS& c_qos) // ACE_DEBUG ((LM_DEBUG, "EC (%t) Consumer::fill_qos - %d\n", cc)); } -// ************************************************************ - ACE_ES_Correlation_Module::ACE_ES_Correlation_Module (ACE_EventChannel *channel) : channel_ (channel), up_ (0), @@ -1718,8 +1766,6 @@ ACE_ES_Correlation_Module::shutdown (void) up_->shutdown (); } -// ************************************************************ - ACE_ES_Consumer_Correlation::ACE_ES_Consumer_Correlation (void) : correlation_module_ (0), type_id_index_ (0), @@ -2265,9 +2311,6 @@ ACE_ES_Consumer_Correlation::correlate (ACE_ES_Consumer_Rep *cr, return request; } - -// ************************************************************ - ACE_ES_Consumer_Rep::~ACE_ES_Consumer_Rep (void) { } @@ -2279,8 +2322,6 @@ ACE_ES_Consumer_Rep::execute (void* /* arg */) return -1; } -// ************************************************************ - int ACE_ES_Consumer_Rep_Timeout::execute (void* /* arg */) { @@ -2308,8 +2349,6 @@ ACE_ES_Consumer_Rep_Timeout::execute (void* /* arg */) return 0; } -// ************************************************************ - ACE_ES_Subscription_Module::ACE_ES_Subscription_Module (ACE_EventChannel *channel) : channel_ (channel), up_ (0), @@ -3256,8 +3295,6 @@ ACE_ES_Subscription_Module::shutdown (void) up_->shutdown (); } -// ************************************************************ - ACE_ES_Supplier_Module::ACE_ES_Supplier_Module (ACE_EventChannel *channel) : all_suppliers_ (), lock_ (), @@ -3483,81 +3520,3 @@ ACE_ES_Supplier_Module::fill_qos (RtecEventChannelAdmin::SupplierQOS& s_qos) } pub.length (sc); } - -// ************************************************************ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Atomic_Op<ACE_ES_MUTEX, int>; -template class ACE_Map_Entry<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT>; -template class ACE_Map_Entry<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT>; -template class ACE_Map_Entry<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry>; -template class ACE_Map_Manager<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; -template class ACE_Map_Manager<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; -template class ACE_Map_Manager<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex>; -template class ACE_Map_Iterator_Base<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; -template class ACE_Map_Iterator_Base<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; -template class ACE_Map_Iterator_Base<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex>; -template class ACE_Map_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; -template class ACE_Map_Iterator<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex>; -template class ACE_Map_Reverse_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; -template class ACE_Map_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; -template class ACE_Map_Reverse_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; -template class ACE_Map_Reverse_Iterator<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex>; -template class ACE_Node<ACE_ES_Consumer_Rep *>; -template class ACE_Node<ACE_Push_Consumer_Proxy *>; -template class ACE_Node<ACE_Push_Supplier_Proxy *>; -template class ACE_Unbounded_Set<ACE_ES_Consumer_Rep *>; -template class ACE_Unbounded_Set<ACE_Push_Consumer_Proxy *>; -template class ACE_Unbounded_Set<ACE_Push_Supplier_Proxy *>; -template class ACE_Unbounded_Set_Iterator<ACE_ES_Consumer_Rep *>; -template class ACE_Unbounded_Set_Iterator<ACE_Push_Consumer_Proxy *>; -template class ACE_Unbounded_Set_Iterator<ACE_Push_Supplier_Proxy *>; - -template class ACE_Auto_Basic_Ptr<ACE_Push_Supplier_Proxy>; -template class ACE_Auto_Basic_Ptr<ACE_Push_Consumer_Proxy>; -template class auto_ptr<ACE_Push_Supplier_Proxy>; -template class auto_ptr<ACE_Push_Consumer_Proxy>; - -template class ACE_Array<TAO_EC_Event>; -template class ACE_Array_Base<TAO_EC_Event>; -template class ACE_Array_Iterator<TAO_EC_Event>; - -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_Atomic_Op<ACE_ES_MUTEX, int> -#pragma instantiate ACE_Map_Entry<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT> -#pragma instantiate ACE_Map_Entry<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT> -#pragma instantiate ACE_Map_Entry<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry> -#pragma instantiate ACE_Map_Manager<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH> -#pragma instantiate ACE_Map_Manager<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH> -#pragma instantiate ACE_Map_Manager<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex> -#pragma instantiate ACE_Map_Iterator_Base<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH> -#pragma instantiate ACE_Map_Iterator_Base<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH> -#pragma instantiate ACE_Map_Iterator_Base<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex> -#pragma instantiate ACE_Map_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH> -#pragma instantiate ACE_Map_Iterator<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH> -#pragma instantiate ACE_Map_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH> -#pragma instantiate ACE_Map_Reverse_Iterator<RtecEventChannelAdmin::Observer_Handle, ACE_EventChannel::Observer_Entry, ACE_Null_Mutex> -#pragma instantiate ACE_Node<ACE_ES_Consumer_Rep *> -#pragma instantiate ACE_Node<ACE_Push_Consumer_Proxy *> -#pragma instantiate ACE_Node<ACE_Push_Supplier_Proxy *> -#pragma instantiate ACE_Unbounded_Set<ACE_ES_Consumer_Rep *> -#pragma instantiate ACE_Unbounded_Set<ACE_Push_Consumer_Proxy *> -#pragma instantiate ACE_Unbounded_Set<ACE_Push_Supplier_Proxy *> -#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_ES_Consumer_Rep *> -#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_Push_Consumer_Proxy *> -#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_Push_Supplier_Proxy *> - -#pragma instantiate ACE_Auto_Basic_Ptr<ACE_Push_Supplier_Proxy> -#pragma instantiate ACE_Auto_Basic_Ptr<ACE_Push_Consumer_Proxy> -#pragma instantiate auto_ptr<ACE_Push_Supplier_Proxy> -#pragma instantiate auto_ptr<ACE_Push_Consumer_Proxy> - -#pragma instantiate ACE_Array<TAO_EC_Event> -#pragma instantiate ACE_Array_Base<TAO_EC_Event> -#pragma instantiate ACE_Array_Iterator<TAO_EC_Event> - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp index e72b7058052..7325cae1356 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Context_Index.cpp @@ -4,6 +4,40 @@ #include "Persistent_Naming_Context.h" #include "ace/Auto_Ptr.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Auto_Basic_Ptr<TAO_Naming_Context>; +template class ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX>; +template class ACE_Allocator_Adapter<ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> >; +template class ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId>; +template class ACE_Hash_Map_Manager<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Entry<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId>; +template class ACE_Hash<TAO_Persistent_Index_ExtId>; +template class ACE_Equal_To<TAO_Persistent_Index_ExtId>; +template class ACE_Hash_Map_Iterator_Base_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex>; +template class ACE_Auto_Basic_Ptr<ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId>::ITERATOR>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Naming_Context> +#pragma instantiate ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> +#pragma instantiate ACE_Allocator_Adapter<ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> > +#pragma instantiate ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId> +#pragma instantiate ACE_Hash_Map_Manager<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Entry<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId> +#pragma instantiate ACE_Hash<TAO_Persistent_Index_ExtId> +#pragma instantiate ACE_Equal_To<TAO_Persistent_Index_ExtId> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex> +#pragma instantiate ACE_Auto_Basic_Ptr<ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId>::ITERATOR> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + int TAO_Persistent_Context_Index::unbind (const char *poa_id) { @@ -301,37 +335,3 @@ TAO_Persistent_Context_Index::create_index_helper (void *buffer) -1); return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Auto_Basic_Ptr<TAO_Naming_Context>; -template class ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX>; -template class ACE_Allocator_Adapter<ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> >; -template class ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId>; -template class ACE_Hash_Map_Manager<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Entry<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId>; -template class ACE_Hash<TAO_Persistent_Index_ExtId>; -template class ACE_Equal_To<TAO_Persistent_Index_ExtId>; -template class ACE_Hash_Map_Iterator_Base_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex>; -template class ACE_Auto_Basic_Ptr<ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId>::ITERATOR>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_Naming_Context> -#pragma instantiate ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> -#pragma instantiate ACE_Allocator_Adapter<ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> > -#pragma instantiate ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId> -#pragma instantiate ACE_Hash_Map_Manager<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Entry<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId> -#pragma instantiate ACE_Hash<TAO_Persistent_Index_ExtId> -#pragma instantiate ACE_Equal_To<TAO_Persistent_Index_ExtId> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Null_Mutex> -#pragma instantiate ACE_Auto_Basic_Ptr<ACE_Hash_Map_With_Allocator<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId>::ITERATOR> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_Persistent_Index_ExtId, TAO_Persistent_Index_IntId, ACE_Hash<TAO_Persistent_Index_ExtId>, ACE_Equal_To<TAO_Persistent_Index_ExtId>, ACE_Null_Mutex> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp index e3c6feb2609..b5a97485073 100644 --- a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp +++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECM_Supplier.cpp @@ -14,14 +14,11 @@ ACE_RCSID(EC_Custom_Marshal, ECM_Supplier, "$Id$") -int -main (int argc, char *argv []) -{ - ECMS_Driver driver; - return driver.run (argc, argv); -} - -// **************************************************************** +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_PushSupplier_Adapter<Test_Supplier>; +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_PushSupplier_Adapter<Test_Supplier> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ ECMS_Driver::ECMS_Driver (void) : n_suppliers_ (1), @@ -184,7 +181,7 @@ ECMS_Driver::run (int argc, char* argv[]) int ECMS_Driver::supplier_task (Test_Supplier *supplier, - void* /* cookie */) + void* /* cookie */) { ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY @@ -204,7 +201,7 @@ ECMS_Driver::supplier_task (Test_Supplier *supplier, for (CORBA::ULong j = 0; j < n; ++j) { info.trajectory[j].x = j; - info.trajectory[j].y = j*j; + info.trajectory[j].y = j * j; other.inventory.bind (j, j + 1); } @@ -287,7 +284,7 @@ ECMS_Driver::supplier_task (Test_Supplier *supplier, void ECMS_Driver::connect_suppliers (RtecEventChannelAdmin::EventChannel_ptr channel, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Environment &ACE_TRY_ENV) { for (int i = 0; i < this->n_suppliers_; ++i) { @@ -413,8 +410,6 @@ ECMS_Driver::parse_args (int argc, char *argv []) return 0; } -// **************************************************************** - Test_Supplier::Test_Supplier (ECMS_Driver *driver) : driver_ (driver), supplier_ (this) @@ -498,10 +493,9 @@ Test_Supplier::consumer_proxy (void) return this->consumer_proxy_.in (); } -// **************************************************************** - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_PushSupplier_Adapter<Test_Supplier>; -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_PushSupplier_Adapter<Test_Supplier> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ +int +main (int argc, char *argv []) +{ + ECMS_Driver driver; + return driver.run (argc, argv); +} diff --git a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp index 65590386122..3472e18943f 100644 --- a/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp +++ b/TAO/orbsvcs/tests/EC_Mcast/EC_Mcast.cpp @@ -20,6 +20,12 @@ ACE_RCSID(EC_Mcast, EC_Mcast, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_PushConsumer_Adapter<ECM_Supplier>; +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_PushConsumer_Adapter<ECM_Supplier> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + ECM_Driver::ECM_Driver (void) : event_period_ (250000), event_count_ (100), @@ -1120,9 +1126,6 @@ ECM_Local_Federation::subscribed_bit (int i) const return this->subscription_subset_[i]; } - -// **************************************************************** - int main (int argc, char *argv []) { @@ -1131,9 +1134,3 @@ main (int argc, char *argv []) ECM_Driver driver; return driver.run (argc, argv); } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_PushConsumer_Adapter<ECM_Supplier>; -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_PushConsumer_Adapter<ECM_Supplier> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp index 04271691c56..06c84e12c58 100644 --- a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp +++ b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp @@ -24,6 +24,16 @@ ACE_RCSID(EC_Multiple, EC_Multiple, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Auto_Basic_Ptr<POA_RtecScheduler::Scheduler>; +template class ACE_PushConsumer_Adapter<Test_Supplier>; +template class auto_ptr<POA_RtecScheduler::Scheduler>; +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Auto_Basic_Ptr<POA_RtecScheduler::Scheduler> +#pragma instantiate ACE_PushConsumer_Adapter<Test_Supplier> +#pragma instantiate auto_ptr<POA_RtecScheduler::Scheduler> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + Test_ECG::Test_ECG (void) : lcl_name_ ("Test_ECG"), rmt_name_ (0), @@ -56,8 +66,6 @@ Test_ECG::Test_ECG (void) { } - - void print_priority_info (const char *const name) { @@ -1276,8 +1284,6 @@ Test_ECG::parse_args (int argc, char *argv []) return 0; } -// **************************************************************** - Test_Supplier::Test_Supplier (Test_ECG *test, void *cookie) : test_ (test), @@ -1524,8 +1530,6 @@ int Test_Supplier::supplier_id (void) const return this->supplier_id_; } -// **************************************************************** - Test_Consumer::Test_Consumer (Test_ECG *test, void *cookie) : test_ (test), @@ -1613,28 +1617,19 @@ Test_Consumer::disconnect_push_consumer (CORBA::Environment &) { } -// **************************************************************** - int main (int argc, char *argv []) { Test_ECG *test; + // Dynamically allocate the Test_ECG instance so that we don't have // to worry about running out of stack space if it's large. - ACE_NEW_RETURN (test, Test_ECG, -1); + ACE_NEW_RETURN (test, + Test_ECG, + -1); const int status = test->run (argc, argv); delete test; return status; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Auto_Basic_Ptr<POA_RtecScheduler::Scheduler>; -template class ACE_PushConsumer_Adapter<Test_Supplier>; -template class auto_ptr<POA_RtecScheduler::Scheduler>; -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Auto_Basic_Ptr<POA_RtecScheduler::Scheduler> -#pragma instantiate ACE_PushConsumer_Adapter<Test_Supplier> -#pragma instantiate auto_ptr<POA_RtecScheduler::Scheduler> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp index 3c9c6306667..28de5b5bfcd 100644 --- a/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp +++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Supplier.cpp @@ -14,6 +14,12 @@ ACE_RCSID(EC_Throughput, ECT_Supplier, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_PushSupplier_Adapter<Test_Supplier>; +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_PushSupplier_Adapter<Test_Supplier> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + Test_Supplier::Test_Supplier (ECT_Driver *driver) : driver_ (driver), supplier_ (this), @@ -244,11 +250,3 @@ Test_Supplier::accumulate (ACE_Throughput_Stats& stats) const { stats.accumulate (this->throughput_); } - -// **************************************************************** - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_PushSupplier_Adapter<Test_Supplier>; -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_PushSupplier_Adapter<Test_Supplier> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/Event/Basic/Timeout.cpp b/TAO/orbsvcs/tests/Event/Basic/Timeout.cpp index 2999b667ffb..e5e5343fa72 100644 --- a/TAO/orbsvcs/tests/Event/Basic/Timeout.cpp +++ b/TAO/orbsvcs/tests/Event/Basic/Timeout.cpp @@ -9,6 +9,205 @@ ACE_RCSID(EC_Tests, Timeout, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_PushConsumer_Adapter<Supplier>; +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_PushConsumer_Adapter<Supplier> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +Consumer::Consumer (const char* name) + : event_count (0), + name_ (name) +{ +} + +void +Consumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin, + const RtecEventChannelAdmin::ConsumerQOS &qos, + CORBA::Environment &ACE_TRY_ENV) +{ + // The canonical protocol to connect to the EC + + RtecEventComm::PushConsumer_var consumer = + this->_this (ACE_TRY_ENV); + ACE_CHECK; + + this->supplier_proxy_ = + consumer_admin->obtain_push_supplier (ACE_TRY_ENV); + ACE_CHECK; + + this->supplier_proxy_->connect_push_consumer (consumer.in (), + qos, + ACE_TRY_ENV); + ACE_CHECK; +} + +void +Consumer::disconnect (CORBA::Environment &ACE_TRY_ENV) +{ + this->supplier_proxy_->disconnect_push_supplier (ACE_TRY_ENV); + ACE_CHECK; + + PortableServer::POA_var consumer_poa = + this->_default_POA (ACE_TRY_ENV); + ACE_CHECK; + PortableServer::ObjectId_var consumer_id = + consumer_poa->servant_to_id (this, ACE_TRY_ENV); + ACE_CHECK; + consumer_poa->deactivate_object (consumer_id.in (), ACE_TRY_ENV); + ACE_CHECK; +} + +void +Consumer::push (const RtecEventComm::EventSet& events, + CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (events.length () == 0) + { + ACE_DEBUG ((LM_DEBUG, + "%s (%P|%t) no events\n", this->name_)); + return; + } + + this->event_count ++; +#if 0 + if (this->event_count % 10 == 0) + { + ACE_DEBUG ((LM_DEBUG, + "%s (%P|%t): %d events received\n", + this->name_, + this->event_count)); + } +#endif /* 0 */ +} + +void +Consumer::disconnect_push_consumer (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +// **************************************************************** + +Supplier::Supplier (void) + : consumer_adapter_ (this), + event_type_ (ACE_ES_EVENT_UNDEFINED) +{ +} + +void +Supplier::connect (RtecEventChannelAdmin::EventChannel_ptr event_channel, + int milliseconds, + int event_type, + CORBA::Environment &ACE_TRY_ENV) +{ + this->event_type_ = event_type; + + // The canonical protocol to connect to the EC + RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin = + event_channel->for_consumers (ACE_TRY_ENV); + ACE_CHECK; + + RtecEventComm::PushConsumer_var consumer = + this->consumer_adapter_._this (ACE_TRY_ENV); + ACE_CHECK; + + this->supplier_proxy_ = + consumer_admin->obtain_push_supplier (ACE_TRY_ENV); + ACE_CHECK; + + // Let's say that the execution time for event 2 is 1 + // milliseconds... + ACE_Time_Value tv (0, milliseconds * 1000); + TimeBase::TimeT time; + ORBSVCS_Time::Time_Value_to_TimeT (time, tv); + + ACE_ConsumerQOS_Factory consumer_qos; + consumer_qos.start_disjunction_group (); + consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT, + time, + 0); + + this->supplier_proxy_->connect_push_consumer (consumer.in (), + consumer_qos.get_ConsumerQOS (), + ACE_TRY_ENV); + ACE_CHECK; + + RtecEventChannelAdmin::SupplierAdmin_var supplier_admin = + event_channel->for_suppliers (ACE_TRY_ENV); + ACE_CHECK; + + RtecEventComm::PushSupplier_var supplier = + this->_this (ACE_TRY_ENV); + ACE_CHECK; + + this->consumer_proxy_ = + supplier_admin->obtain_push_consumer (ACE_TRY_ENV); + ACE_CHECK; + + ACE_SupplierQOS_Factory supplier_qos; + supplier_qos.insert (1, this->event_type_, 0, 1); + + this->consumer_proxy_->connect_push_supplier (supplier.in (), + supplier_qos.get_SupplierQOS (), + ACE_TRY_ENV); + ACE_CHECK; +} + +void +Supplier::disconnect (CORBA::Environment &ACE_TRY_ENV) +{ + this->supplier_proxy_->disconnect_push_supplier (ACE_TRY_ENV); + ACE_CHECK; + + PortableServer::POA_var consumer_poa = + this->consumer_adapter_._default_POA (ACE_TRY_ENV); + ACE_CHECK; + PortableServer::ObjectId_var consumer_id = + consumer_poa->servant_to_id (&this->consumer_adapter_, ACE_TRY_ENV); + ACE_CHECK; + consumer_poa->deactivate_object (consumer_id.in (), ACE_TRY_ENV); + ACE_CHECK; + + this->consumer_proxy_->disconnect_push_consumer (ACE_TRY_ENV); + ACE_CHECK; + + PortableServer::POA_var supplier_poa = + this->_default_POA (ACE_TRY_ENV); + ACE_CHECK; + PortableServer::ObjectId_var supplier_id = + supplier_poa->servant_to_id (this, ACE_TRY_ENV); + ACE_CHECK; + supplier_poa->deactivate_object (supplier_id.in (), ACE_TRY_ENV); + ACE_CHECK; +} + +void +Supplier::push (const RtecEventComm::EventSet&, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + RtecEventComm::EventSet event (1); + event.length (1); + event[0].header.type = this->event_type_; + event[0].header.source = 0; + + this->consumer_proxy_->push (event, ACE_TRY_ENV); +} + +void +Supplier::disconnect_push_consumer (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Supplier::disconnect_push_supplier (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + int main (int argc, char* argv[]) { @@ -227,210 +426,3 @@ main (int argc, char* argv[]) ACE_ENDTRY; return 0; } - -// **************************************************************** - -Consumer::Consumer (const char* name) - : event_count (0), - name_ (name) -{ -} - -void -Consumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin, - const RtecEventChannelAdmin::ConsumerQOS &qos, - CORBA::Environment &ACE_TRY_ENV) -{ - // The canonical protocol to connect to the EC - - RtecEventComm::PushConsumer_var consumer = - this->_this (ACE_TRY_ENV); - ACE_CHECK; - - this->supplier_proxy_ = - consumer_admin->obtain_push_supplier (ACE_TRY_ENV); - ACE_CHECK; - - this->supplier_proxy_->connect_push_consumer (consumer.in (), - qos, - ACE_TRY_ENV); - ACE_CHECK; -} - -void -Consumer::disconnect (CORBA::Environment &ACE_TRY_ENV) -{ - this->supplier_proxy_->disconnect_push_supplier (ACE_TRY_ENV); - ACE_CHECK; - - PortableServer::POA_var consumer_poa = - this->_default_POA (ACE_TRY_ENV); - ACE_CHECK; - PortableServer::ObjectId_var consumer_id = - consumer_poa->servant_to_id (this, ACE_TRY_ENV); - ACE_CHECK; - consumer_poa->deactivate_object (consumer_id.in (), ACE_TRY_ENV); - ACE_CHECK; -} - -void -Consumer::push (const RtecEventComm::EventSet& events, - CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (events.length () == 0) - { - ACE_DEBUG ((LM_DEBUG, - "%s (%P|%t) no events\n", this->name_)); - return; - } - - this->event_count ++; -#if 0 - if (this->event_count % 10 == 0) - { - ACE_DEBUG ((LM_DEBUG, - "%s (%P|%t): %d events received\n", - this->name_, - this->event_count)); - } -#endif /* 0 */ -} - -void -Consumer::disconnect_push_consumer (CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -// **************************************************************** - -Supplier::Supplier (void) - : consumer_adapter_ (this), - event_type_ (ACE_ES_EVENT_UNDEFINED) -{ -} - -void -Supplier::connect (RtecEventChannelAdmin::EventChannel_ptr event_channel, - int milliseconds, - int event_type, - CORBA::Environment &ACE_TRY_ENV) -{ - this->event_type_ = event_type; - - // The canonical protocol to connect to the EC - RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin = - event_channel->for_consumers (ACE_TRY_ENV); - ACE_CHECK; - - RtecEventComm::PushConsumer_var consumer = - this->consumer_adapter_._this (ACE_TRY_ENV); - ACE_CHECK; - - this->supplier_proxy_ = - consumer_admin->obtain_push_supplier (ACE_TRY_ENV); - ACE_CHECK; - - // Let's say that the execution time for event 2 is 1 - // milliseconds... - ACE_Time_Value tv (0, milliseconds * 1000); - TimeBase::TimeT time; - ORBSVCS_Time::Time_Value_to_TimeT (time, tv); - - ACE_ConsumerQOS_Factory consumer_qos; - consumer_qos.start_disjunction_group (); - consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT, - time, - 0); - - this->supplier_proxy_->connect_push_consumer (consumer.in (), - consumer_qos.get_ConsumerQOS (), - ACE_TRY_ENV); - ACE_CHECK; - - RtecEventChannelAdmin::SupplierAdmin_var supplier_admin = - event_channel->for_suppliers (ACE_TRY_ENV); - ACE_CHECK; - - RtecEventComm::PushSupplier_var supplier = - this->_this (ACE_TRY_ENV); - ACE_CHECK; - - this->consumer_proxy_ = - supplier_admin->obtain_push_consumer (ACE_TRY_ENV); - ACE_CHECK; - - ACE_SupplierQOS_Factory supplier_qos; - supplier_qos.insert (1, this->event_type_, 0, 1); - - this->consumer_proxy_->connect_push_supplier (supplier.in (), - supplier_qos.get_SupplierQOS (), - ACE_TRY_ENV); - ACE_CHECK; -} - -void -Supplier::disconnect (CORBA::Environment &ACE_TRY_ENV) -{ - this->supplier_proxy_->disconnect_push_supplier (ACE_TRY_ENV); - ACE_CHECK; - - PortableServer::POA_var consumer_poa = - this->consumer_adapter_._default_POA (ACE_TRY_ENV); - ACE_CHECK; - PortableServer::ObjectId_var consumer_id = - consumer_poa->servant_to_id (&this->consumer_adapter_, ACE_TRY_ENV); - ACE_CHECK; - consumer_poa->deactivate_object (consumer_id.in (), ACE_TRY_ENV); - ACE_CHECK; - - this->consumer_proxy_->disconnect_push_consumer (ACE_TRY_ENV); - ACE_CHECK; - - PortableServer::POA_var supplier_poa = - this->_default_POA (ACE_TRY_ENV); - ACE_CHECK; - PortableServer::ObjectId_var supplier_id = - supplier_poa->servant_to_id (this, ACE_TRY_ENV); - ACE_CHECK; - supplier_poa->deactivate_object (supplier_id.in (), ACE_TRY_ENV); - ACE_CHECK; -} - -void -Supplier::push (const RtecEventComm::EventSet&, - CORBA::Environment &ACE_TRY_ENV) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - RtecEventComm::EventSet event (1); - event.length (1); - event[0].header.type = this->event_type_; - event[0].header.source = 0; - - this->consumer_proxy_->push (event, ACE_TRY_ENV); -} - -void -Supplier::disconnect_push_consumer (CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Supplier::disconnect_push_supplier (CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -// **************************************************************** - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_PushConsumer_Adapter<Supplier>; - -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_PushConsumer_Adapter<Supplier> - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/Event/Basic/Wildcard.cpp b/TAO/orbsvcs/tests/Event/Basic/Wildcard.cpp index 78b57c87ed0..707257855c7 100644 --- a/TAO/orbsvcs/tests/Event/Basic/Wildcard.cpp +++ b/TAO/orbsvcs/tests/Event/Basic/Wildcard.cpp @@ -9,6 +9,240 @@ ACE_RCSID(EC_Tests, Wildcard, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_PushConsumer_Adapter<Supplier>; +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_PushConsumer_Adapter<Supplier> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +Consumer::Consumer (const char* name) + : event_count (0), + name_ (name) +{ +} + +void +Consumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin, + const RtecEventChannelAdmin::ConsumerQOS &qos, + CORBA::Environment &ACE_TRY_ENV) +{ + // The canonical protocol to connect to the EC + + RtecEventComm::PushConsumer_var consumer = + this->_this (ACE_TRY_ENV); + ACE_CHECK; + + this->supplier_proxy_ = + consumer_admin->obtain_push_supplier (ACE_TRY_ENV); + ACE_CHECK; + + this->supplier_proxy_->connect_push_consumer (consumer.in (), + qos, + ACE_TRY_ENV); + ACE_CHECK; +} + +void +Consumer::disconnect (CORBA::Environment &ACE_TRY_ENV) +{ + this->supplier_proxy_->disconnect_push_supplier (ACE_TRY_ENV); + ACE_CHECK; + + PortableServer::POA_var consumer_poa = + this->_default_POA (ACE_TRY_ENV); + ACE_CHECK; + PortableServer::ObjectId_var consumer_id = + consumer_poa->servant_to_id (this, ACE_TRY_ENV); + ACE_CHECK; + consumer_poa->deactivate_object (consumer_id.in (), ACE_TRY_ENV); + ACE_CHECK; +} + +void +Consumer::dump_results (int expected_count, int tolerance) +{ + int diff = this->event_count - expected_count; + if (diff > tolerance || diff < -tolerance) + { + ACE_DEBUG ((LM_DEBUG, + "ERROR - %s unexpected number of events <%d>\n", + this->name_, + this->event_count)); + } + else + { + ACE_DEBUG ((LM_DEBUG, + "%s - number of events <%d> within margins\n", + this->name_, + this->event_count)); + } +} + +void +Consumer::push (const RtecEventComm::EventSet& events, + CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (events.length () == 0) + { + ACE_DEBUG ((LM_DEBUG, + "%s (%P|%t) no events\n", this->name_)); + return; + } + + this->event_count ++; +#if 0 + if (this->event_count % 10 == 0) + { + ACE_DEBUG ((LM_DEBUG, + "%s (%P|%t): %d events received\n", + this->name_, + this->event_count)); + } +#endif /* 0 */ +} + +void +Consumer::disconnect_push_consumer (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +Supplier::Supplier (void) + : consumer_adapter_ (this), + event_source_ (-1), + event_type_ (ACE_ES_EVENT_UNDEFINED) +{ +} + +void +Supplier::connect (RtecEventChannelAdmin::EventChannel_ptr event_channel, + int milliseconds, + int published_source, + int published_type, + int event_source, + int event_type, + CORBA::Environment &ACE_TRY_ENV) +{ + this->event_source_ = event_source; + this->event_type_ = event_type; + + // The canonical protocol to connect to the EC + RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin = + event_channel->for_consumers (ACE_TRY_ENV); + ACE_CHECK; + + RtecEventComm::PushConsumer_var consumer = + this->consumer_adapter_._this (ACE_TRY_ENV); + ACE_CHECK; + + this->supplier_proxy_ = + consumer_admin->obtain_push_supplier (ACE_TRY_ENV); + ACE_CHECK; + + // Let's say that the execution time for event 2 is 1 + // milliseconds... + ACE_Time_Value tv (0, milliseconds * 1000); + TimeBase::TimeT time; + ORBSVCS_Time::Time_Value_to_TimeT (time, tv); + + ACE_ConsumerQOS_Factory consumer_qos; + consumer_qos.start_disjunction_group (); + consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT, + time, + 0); + + this->supplier_proxy_->connect_push_consumer (consumer.in (), + consumer_qos.get_ConsumerQOS (), + ACE_TRY_ENV); + ACE_CHECK; + + RtecEventChannelAdmin::SupplierAdmin_var supplier_admin = + event_channel->for_suppliers (ACE_TRY_ENV); + ACE_CHECK; + + RtecEventComm::PushSupplier_var supplier = + this->_this (ACE_TRY_ENV); + ACE_CHECK; + + this->consumer_proxy_ = + supplier_admin->obtain_push_consumer (ACE_TRY_ENV); + ACE_CHECK; + + ACE_SupplierQOS_Factory supplier_qos; + supplier_qos.insert (published_source, + published_type, + 0, 1); + + this->consumer_proxy_->connect_push_supplier (supplier.in (), + supplier_qos.get_SupplierQOS (), + ACE_TRY_ENV); + ACE_CHECK; +} + +void +Supplier::disconnect (CORBA::Environment &ACE_TRY_ENV) +{ + this->supplier_proxy_->disconnect_push_supplier (ACE_TRY_ENV); + ACE_CHECK; + + PortableServer::POA_var consumer_poa = + this->consumer_adapter_._default_POA (ACE_TRY_ENV); + ACE_CHECK; + PortableServer::ObjectId_var consumer_id = + consumer_poa->servant_to_id (&this->consumer_adapter_, ACE_TRY_ENV); + ACE_CHECK; + consumer_poa->deactivate_object (consumer_id.in (), ACE_TRY_ENV); + ACE_CHECK; + + this->consumer_proxy_->disconnect_push_consumer (ACE_TRY_ENV); + ACE_CHECK; + + PortableServer::POA_var supplier_poa = + this->_default_POA (ACE_TRY_ENV); + ACE_CHECK; + PortableServer::ObjectId_var supplier_id = + supplier_poa->servant_to_id (this, ACE_TRY_ENV); + ACE_CHECK; + supplier_poa->deactivate_object (supplier_id.in (), ACE_TRY_ENV); + ACE_CHECK; +} + +void +Supplier::push (const RtecEventComm::EventSet&, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + RtecEventComm::EventSet event (1); + event.length (1); + event[0].header.source = this->event_source_; + event[0].header.type = this->event_type_; + + this->consumer_proxy_->push (event, ACE_TRY_ENV); + +#if 0 + static int event_count = 0; + event_count++; + if (event_count % 10 == 0) + { + ACE_DEBUG ((LM_DEBUG, + "Supplier (%P|%t): %d events sent\n", + event_count)); + } +#endif /* 0 */ +} + +void +Supplier::disconnect_push_consumer (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Supplier::disconnect_push_supplier (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} int main (int argc, char* argv[]) { @@ -257,248 +491,3 @@ main (int argc, char* argv[]) ACE_ENDTRY; return 0; } - -// **************************************************************** - -Consumer::Consumer (const char* name) - : event_count (0), - name_ (name) -{ -} - -void -Consumer::connect (RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin, - const RtecEventChannelAdmin::ConsumerQOS &qos, - CORBA::Environment &ACE_TRY_ENV) -{ - // The canonical protocol to connect to the EC - - RtecEventComm::PushConsumer_var consumer = - this->_this (ACE_TRY_ENV); - ACE_CHECK; - - this->supplier_proxy_ = - consumer_admin->obtain_push_supplier (ACE_TRY_ENV); - ACE_CHECK; - - this->supplier_proxy_->connect_push_consumer (consumer.in (), - qos, - ACE_TRY_ENV); - ACE_CHECK; -} - -void -Consumer::disconnect (CORBA::Environment &ACE_TRY_ENV) -{ - this->supplier_proxy_->disconnect_push_supplier (ACE_TRY_ENV); - ACE_CHECK; - - PortableServer::POA_var consumer_poa = - this->_default_POA (ACE_TRY_ENV); - ACE_CHECK; - PortableServer::ObjectId_var consumer_id = - consumer_poa->servant_to_id (this, ACE_TRY_ENV); - ACE_CHECK; - consumer_poa->deactivate_object (consumer_id.in (), ACE_TRY_ENV); - ACE_CHECK; -} - -void -Consumer::dump_results (int expected_count, int tolerance) -{ - int diff = this->event_count - expected_count; - if (diff > tolerance || diff < -tolerance) - { - ACE_DEBUG ((LM_DEBUG, - "ERROR - %s unexpected number of events <%d>\n", - this->name_, - this->event_count)); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "%s - number of events <%d> within margins\n", - this->name_, - this->event_count)); - } -} - -void -Consumer::push (const RtecEventComm::EventSet& events, - CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (events.length () == 0) - { - ACE_DEBUG ((LM_DEBUG, - "%s (%P|%t) no events\n", this->name_)); - return; - } - - this->event_count ++; -#if 0 - if (this->event_count % 10 == 0) - { - ACE_DEBUG ((LM_DEBUG, - "%s (%P|%t): %d events received\n", - this->name_, - this->event_count)); - } -#endif /* 0 */ -} - -void -Consumer::disconnect_push_consumer (CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -// **************************************************************** - -Supplier::Supplier (void) - : consumer_adapter_ (this), - event_source_ (-1), - event_type_ (ACE_ES_EVENT_UNDEFINED) -{ -} - -void -Supplier::connect (RtecEventChannelAdmin::EventChannel_ptr event_channel, - int milliseconds, - int published_source, - int published_type, - int event_source, - int event_type, - CORBA::Environment &ACE_TRY_ENV) -{ - this->event_source_ = event_source; - this->event_type_ = event_type; - - // The canonical protocol to connect to the EC - RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin = - event_channel->for_consumers (ACE_TRY_ENV); - ACE_CHECK; - - RtecEventComm::PushConsumer_var consumer = - this->consumer_adapter_._this (ACE_TRY_ENV); - ACE_CHECK; - - this->supplier_proxy_ = - consumer_admin->obtain_push_supplier (ACE_TRY_ENV); - ACE_CHECK; - - // Let's say that the execution time for event 2 is 1 - // milliseconds... - ACE_Time_Value tv (0, milliseconds * 1000); - TimeBase::TimeT time; - ORBSVCS_Time::Time_Value_to_TimeT (time, tv); - - ACE_ConsumerQOS_Factory consumer_qos; - consumer_qos.start_disjunction_group (); - consumer_qos.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT, - time, - 0); - - this->supplier_proxy_->connect_push_consumer (consumer.in (), - consumer_qos.get_ConsumerQOS (), - ACE_TRY_ENV); - ACE_CHECK; - - RtecEventChannelAdmin::SupplierAdmin_var supplier_admin = - event_channel->for_suppliers (ACE_TRY_ENV); - ACE_CHECK; - - RtecEventComm::PushSupplier_var supplier = - this->_this (ACE_TRY_ENV); - ACE_CHECK; - - this->consumer_proxy_ = - supplier_admin->obtain_push_consumer (ACE_TRY_ENV); - ACE_CHECK; - - ACE_SupplierQOS_Factory supplier_qos; - supplier_qos.insert (published_source, - published_type, - 0, 1); - - this->consumer_proxy_->connect_push_supplier (supplier.in (), - supplier_qos.get_SupplierQOS (), - ACE_TRY_ENV); - ACE_CHECK; -} - -void -Supplier::disconnect (CORBA::Environment &ACE_TRY_ENV) -{ - this->supplier_proxy_->disconnect_push_supplier (ACE_TRY_ENV); - ACE_CHECK; - - PortableServer::POA_var consumer_poa = - this->consumer_adapter_._default_POA (ACE_TRY_ENV); - ACE_CHECK; - PortableServer::ObjectId_var consumer_id = - consumer_poa->servant_to_id (&this->consumer_adapter_, ACE_TRY_ENV); - ACE_CHECK; - consumer_poa->deactivate_object (consumer_id.in (), ACE_TRY_ENV); - ACE_CHECK; - - this->consumer_proxy_->disconnect_push_consumer (ACE_TRY_ENV); - ACE_CHECK; - - PortableServer::POA_var supplier_poa = - this->_default_POA (ACE_TRY_ENV); - ACE_CHECK; - PortableServer::ObjectId_var supplier_id = - supplier_poa->servant_to_id (this, ACE_TRY_ENV); - ACE_CHECK; - supplier_poa->deactivate_object (supplier_id.in (), ACE_TRY_ENV); - ACE_CHECK; -} - -void -Supplier::push (const RtecEventComm::EventSet&, - CORBA::Environment &ACE_TRY_ENV) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - RtecEventComm::EventSet event (1); - event.length (1); - event[0].header.source = this->event_source_; - event[0].header.type = this->event_type_; - - this->consumer_proxy_->push (event, ACE_TRY_ENV); - -#if 0 - static int event_count = 0; - event_count++; - if (event_count % 10 == 0) - { - ACE_DEBUG ((LM_DEBUG, - "Supplier (%P|%t): %d events sent\n", - event_count)); - } -#endif /* 0 */ -} - -void -Supplier::disconnect_push_consumer (CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -void -Supplier::disconnect_push_supplier (CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ -} - -// **************************************************************** - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_PushConsumer_Adapter<Supplier>; - -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_PushConsumer_Adapter<Supplier> - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/DynUnion_i.cpp b/TAO/tao/DynUnion_i.cpp index 99b0e42a76b..0968f9fff90 100644 --- a/TAO/tao/DynUnion_i.cpp +++ b/TAO/tao/DynUnion_i.cpp @@ -1,17 +1,5 @@ /* -*- C++ -*- */ // $Id$ -// ==================================================================== -// -// = LIBRARY -// TAO -// -// = FILENAME -// DynUnion_i.cpp -// -// = AUTHOR -// Jeff Parsons <parsons@cs.wustl.edu> -// -// ==================================================================== #include "tao/DynAny_i.h" @@ -20,6 +8,32 @@ #include "tao/DynUnion_i.h" #include "tao/InconsistentTypeCodeC.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class DU_Extractor<CORBA::Short>; +template class DU_Extractor<CORBA::Long>; +template class DU_Extractor<CORBA::UShort>; +template class DU_Extractor<CORBA::ULong>; + +// For platforms without native 64-bit ints . . . +#if !defined (ACE_LACKS_LONGLONG_T) +template class DU_Extractor<CORBA::LongLong>; +#endif /* ACE_LACKS_LONGLONG_T */ + +template class DU_Extractor<CORBA::ULongLong>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate DU_Extractor<CORBA::Short> +#pragma instantiate DU_Extractor<CORBA::Long> +#pragma instantiate DU_Extractor<CORBA::UShort> +#pragma instantiate DU_Extractor<CORBA::ULong> + +// For platforms without native 64-bit ints . . . +#if !defined (ACE_LACKS_LONGLONG_T) +#pragma instantiate DU_Extractor<CORBA::LongLong> +#endif /* ACE_LACKS_LONGLONG_T */ + +#pragma instantiate DU_Extractor<CORBA::ULongLong> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + // Constructors and destructor TAO_DynUnion_i::TAO_DynUnion_i (const CORBA_Any& any) @@ -41,9 +55,7 @@ TAO_DynUnion_i::TAO_DynUnion_i (const CORBA_Any& any) ACE_TRY_CHECK; } else - { - ACE_THROW (CORBA_ORB_InconsistentTypeCode ()); - } + ACE_THROW (CORBA_ORB_InconsistentTypeCode ()); } ACE_CATCHANY { @@ -65,23 +77,24 @@ TAO_DynUnion_i::TAO_DynUnion_i (CORBA_TypeCode_ptr tc) if (tk == CORBA::tk_union) { // Initialize the typecode holder - this->type_ = CORBA::TypeCode::_duplicate (tc); + this->type_ = + CORBA::TypeCode::_duplicate (tc); - CORBA::TypeCode_ptr disc_tc = tc->discriminator_type (ACE_TRY_ENV); + CORBA::TypeCode_ptr disc_tc = + tc->discriminator_type (ACE_TRY_ENV); ACE_TRY_CHECK; // Get a typecode into the discriminator holder. - this->discriminator_ = TAO_DynAny_i::create_dyn_any (disc_tc, - ACE_TRY_ENV); + this->discriminator_ = + TAO_DynAny_i::create_dyn_any (disc_tc, + ACE_TRY_ENV); ACE_TRY_CHECK; // To be filled in by from_any() or assign(). this->member_ = 0; } else - { - ACE_THROW (CORBA_ORB_InconsistentTypeCode ()); - } + ACE_THROW (CORBA_ORB_InconsistentTypeCode ()); } ACE_CATCHANY { @@ -180,9 +193,7 @@ TAO_DynUnion_i::member_name (const char* member_name, // No sense doing anything if we're just "resetting" to the // current member. if (i == this->current_index_) - { - return; - } + return; else { CORBA_TypeCode_ptr member_type = @@ -2194,30 +2205,4 @@ TAO_DynUnion_i::set_from_any (const CORBA_Any& any, } } -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class DU_Extractor<CORBA::Short>; -template class DU_Extractor<CORBA::Long>; -template class DU_Extractor<CORBA::UShort>; -template class DU_Extractor<CORBA::ULong>; - -// For platforms without native 64-bit ints . . . -#if !defined (ACE_LACKS_LONGLONG_T) -template class DU_Extractor<CORBA::LongLong>; -#endif /* ACE_LACKS_LONGLONG_T */ - -template class DU_Extractor<CORBA::ULongLong>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate DU_Extractor<CORBA::Short> -#pragma instantiate DU_Extractor<CORBA::Long> -#pragma instantiate DU_Extractor<CORBA::UShort> -#pragma instantiate DU_Extractor<CORBA::ULong> - -// For platforms without native 64-bit ints . . . -#if !defined (ACE_LACKS_LONGLONG_T) -#pragma instantiate DU_Extractor<CORBA::LongLong> -#endif /* ACE_LACKS_LONGLONG_T */ - -#pragma instantiate DU_Extractor<CORBA::ULongLong> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - #endif /* TAO_HAS_MINIMUM_CORBA */ diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp index 1ea3a5283bc..06b5301ef62 100644 --- a/TAO/tao/IIOP_Acceptor.cpp +++ b/TAO/tao/IIOP_Acceptor.cpp @@ -1,18 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ -// ============================================================================ -// -// = LIBRARY -// -// = FILENAME -// -// = DESCRIPTION -// -// = AUTHOR -// -// ============================================================================ - #include "tao/IIOP_Acceptor.h" #include "tao/IIOP_Profile.h" #include "tao/MProfile.h" @@ -27,7 +15,31 @@ ACE_RCSID(tao, IIOP_Acceptor, "$Id$") -// **************************************************************** +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_Acceptor<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Strategy_Acceptor<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Creation_Strategy<TAO_IIOP_Server_Connection_Handler>; +template class ACE_Concurrency_Strategy<TAO_IIOP_Server_Connection_Handler>; +template class ACE_Scheduling_Strategy<TAO_IIOP_Server_Connection_Handler>; +template class TAO_Creation_Strategy<TAO_IIOP_Server_Connection_Handler>; +template class TAO_Concurrency_Strategy<TAO_IIOP_Server_Connection_Handler>; +template class TAO_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_Acceptor<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Strategy_Acceptor<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Creation_Strategy<TAO_IIOP_Server_Connection_Handler> +#pragma instantiate ACE_Concurrency_Strategy<TAO_IIOP_Server_Connection_Handler> +#pragma instantiate ACE_Scheduling_Strategy<TAO_IIOP_Server_Connection_Handler> +#pragma instantiate TAO_Creation_Strategy<TAO_IIOP_Server_Connection_Handler> +#pragma instantiate TAO_Concurrency_Strategy<TAO_IIOP_Server_Connection_Handler> +#pragma instantiate TAO_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ TAO_IIOP_Acceptor::TAO_IIOP_Acceptor (void) : TAO_Acceptor (TAO_IOP_TAG_INTERNET_IOP), @@ -59,11 +71,9 @@ TAO_IIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, { // @@ we only make one for now int count = mprofile.profile_count (); - if ((mprofile.size () - count) < 1) - { - if (mprofile.grow (count + 1) == -1) - return -1; - } + if ((mprofile.size () - count) < 1 + && mprofile.grow (count + 1) == -1) + return -1; TAO_IIOP_Profile *pfile = 0; ACE_NEW_RETURN (pfile, @@ -88,8 +98,10 @@ TAO_IIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, pfile->tagged_components ().set_orb_type (TAO_ORB_TYPE); CONV_FRAME::CodeSetComponentInfo code_set_info; - code_set_info.ForCharData.native_code_set = TAO_DEFAULT_CHAR_CODESET_ID; - code_set_info.ForWcharData.native_code_set = TAO_DEFAULT_WCHAR_CODESET_ID; + code_set_info.ForCharData.native_code_set = + TAO_DEFAULT_CHAR_CODESET_ID; + code_set_info.ForWcharData.native_code_set = + TAO_DEFAULT_WCHAR_CODESET_ID; pfile->tagged_components ().set_code_sets (code_set_info); pfile->tagged_components ().set_tao_priority (this->priority ()); @@ -98,10 +110,11 @@ TAO_IIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, } int -TAO_IIOP_Acceptor::is_collocated (const TAO_Profile* pfile) +TAO_IIOP_Acceptor::is_collocated (const TAO_Profile *pfile) { const TAO_IIOP_Profile *profile = - ACE_dynamic_cast(const TAO_IIOP_Profile*, pfile); + ACE_dynamic_cast(const TAO_IIOP_Profile *, + pfile); // compare the port and sin_addr (numeric host address) return profile->object_addr () == this->address_; @@ -130,22 +143,25 @@ TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core, return -1; if (major >=0 && minor >= 0) - this->version_.set_version (ACE_static_cast (CORBA::Octet,major), - ACE_static_cast (CORBA::Octet,minor)); - + this->version_.set_version (ACE_static_cast (CORBA::Octet, + major), + ACE_static_cast (CORBA::Octet, + minor)); // Parse options if (this->parse_options (options) == -1) return -1; ACE_INET_Addr addr; - if (ACE_OS::strchr (address, ':') == 0) + if (ACE_OS::strchr (address, + ':') == 0) { // Assume the address is a port number or port name and obtain // the fully qualified domain name. char buffer[MAXHOSTNAMELEN + 1]; - if (addr.get_host_name (buffer, sizeof (buffer)) != 0) + if (addr.get_host_name (buffer, + sizeof (buffer)) != 0) return -1; // First convert the port into a usable form. @@ -159,9 +175,7 @@ TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core, return -1; } else if (addr.set (address) != 0) - { - return -1; - } + return -1; return this->open_i (orb_core, addr); } @@ -180,15 +194,19 @@ TAO_IIOP_Acceptor::open_default (TAO_ORB_Core *orb_core, ACE_INET_Addr addr; char buffer[MAXHOSTNAMELEN + 1]; - if (addr.get_host_name (buffer, sizeof (buffer)) != 0) + if (addr.get_host_name (buffer, + sizeof (buffer)) != 0) return -1; - if (addr.set (u_short(0), buffer, 1) != 0) + if (addr.set (u_short(0), + buffer, + 1) != 0) return -1; this->host_ = buffer; - return this->open_i (orb_core, addr); + return this->open_i (orb_core, + addr); } int @@ -234,8 +252,8 @@ TAO_IIOP_Acceptor::open_i (TAO_ORB_Core* orb_core, if (orb_core->orb_params ()->use_dotted_decimal_addresses ()) { - const char *tmp; - if ((tmp = addr.get_host_addr ()) == 0) + const char *tmp = addr.get_host_addr (); + if (tmp == 0) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, @@ -248,7 +266,8 @@ TAO_IIOP_Acceptor::open_i (TAO_ORB_Core* orb_core, else { char tmp_host[MAXHOSTNAMELEN+1]; - if (addr.get_host_name (tmp_host, sizeof(tmp_host)) != 0) + if (addr.get_host_name (tmp_host, + sizeof tmp_host) != 0) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, @@ -267,7 +286,6 @@ TAO_IIOP_Acceptor::open_i (TAO_ORB_Core* orb_core, this->host_.c_str (), this->address_.get_port_number ())); } - return 0; } @@ -294,7 +312,6 @@ TAO_IIOP_Acceptor::parse_options (const char *str) size_t len = options.length (); - const char option_delimiter = '&'; // Count the number of options. @@ -305,11 +322,8 @@ TAO_IIOP_Acceptor::parse_options (const char *str) // Only check for endpoints after the protocol specification and // before the object key. for (size_t i = 0; i < len; ++i) - { - if (options[i] == option_delimiter) - option_count++; - } - + if (options[i] == option_delimiter) + option_count++; // The idea behind the following loop is to split the options into // (option, name) pairs. @@ -332,37 +346,31 @@ TAO_IIOP_Acceptor::parse_options (const char *str) end = len - begin; // Handle last endpoint differently if (end == begin) - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) Zero length IIOP option.\n"), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) Zero length IIOP option.\n"), + -1); else if (end != ACE_CString::npos) { ACE_CString opt = options.substring (begin, end); int slot = opt.find ("="); - if (slot == ACE_static_cast (int, len - 1) || - slot == ACE_CString::npos) - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) IIOP option <%s> is " - "missing a value.\n", - opt.c_str ()), - -1); - } + if (slot == ACE_static_cast (int, len - 1) + || slot == ACE_CString::npos) + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) IIOP option <%s> is " + "missing a value.\n", + opt.c_str ()), + -1); ACE_CString name = opt.substring (0, slot); ACE_CString value = opt.substring (slot + 1); if (name.length () == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) Zero length IIOP " - "option name.\n"), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) Zero length IIOP " + "option name.\n"), + -1); if (name == "priority") { @@ -372,57 +380,23 @@ TAO_IIOP_Acceptor::parse_options (const char *str) if (corba_priority >= 0 /* && corba_priority < 32768 */) - { - // priority_ and corba_priority will always be less - // than 32768 since CORBA::Short is a signed 16 bit - // integer. - - this->priority_ = corba_priority; - } + // priority_ and corba_priority will always be less + // than 32768 since CORBA::Short is a signed 16 bit + // integer. + this->priority_ = corba_priority; else - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) Invalid IIOP endpoint " - "priority: <%s>\n", - value.c_str ()), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) Invalid IIOP endpoint " + "priority: <%s>\n", + value.c_str ()), + -1); } else - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) Invalid IIOP option: <%s>\n", - name.c_str ()), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) Invalid IIOP option: <%s>\n", + name.c_str ()), + -1); } } - return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Acceptor<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Strategy_Acceptor<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Creation_Strategy<TAO_IIOP_Server_Connection_Handler>; -template class ACE_Concurrency_Strategy<TAO_IIOP_Server_Connection_Handler>; -template class ACE_Scheduling_Strategy<TAO_IIOP_Server_Connection_Handler>; -template class TAO_Creation_Strategy<TAO_IIOP_Server_Connection_Handler>; -template class TAO_Concurrency_Strategy<TAO_IIOP_Server_Connection_Handler>; -template class TAO_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR>; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_Acceptor<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Strategy_Acceptor<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Creation_Strategy<TAO_IIOP_Server_Connection_Handler> -#pragma instantiate ACE_Concurrency_Strategy<TAO_IIOP_Server_Connection_Handler> -#pragma instantiate ACE_Scheduling_Strategy<TAO_IIOP_Server_Connection_Handler> -#pragma instantiate TAO_Creation_Strategy<TAO_IIOP_Server_Connection_Handler> -#pragma instantiate TAO_Concurrency_Strategy<TAO_IIOP_Server_Connection_Handler> -#pragma instantiate TAO_Accept_Strategy<TAO_IIOP_Server_Connection_Handler, ACE_SOCK_ACCEPTOR> - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 4fdf8a00906..2a237f26c99 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -12,7 +12,204 @@ ACE_RCSID(tao, IIOP_Connector, "$Id$") -// **************************************************************** +#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) +#define TAO_SVC_TUPLE ACE_Svc_Tuple<TAO_IIOP_Client_Connection_Handler> +#define CACHED_CONNECT_STRATEGY ACE_Cached_Connect_Strategy<TAO_IIOP_Client_Connection_Handler, ACE_SOCK_CONNECTOR, TAO_Cached_Connector_Lock> +#define TAO_ADDR ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> +#define TAO_HANDLER TAO_IIOP_Client_Connection_Handler +#define TAO_HASH_KEY ACE_Hash<TAO_ADDR> +#define TAO_COMPARE_KEYS ACE_Equal_To<TAO_ADDR> +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr>; +template class ACE_Auto_Basic_Array_Ptr<TAO_IIOP_Client_Connection_Handler*>; +template class auto_ptr<TAO_IIOP_Connect_Creation_Strategy>; +template class ACE_Auto_Basic_Ptr<TAO_IIOP_Connect_Creation_Strategy>; + +template class ACE_Node<ACE_INET_Addr>; +template class ACE_Unbounded_Stack<ACE_INET_Addr>; +template class ACE_Unbounded_Stack_Iterator<ACE_INET_Addr>; + +#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) +template class CACHED_CONNECT_STRATEGY; +template class TAO_ADDR; +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; +template class ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr>; +template class ACE_NOOP_Creation_Strategy<TAO_HANDLER>; +template class ACE_Concurrency_Strategy<TAO_HANDLER>; +template class ACE_Connect_Strategy<TAO_HANDLER, ACE_SOCK_CONNECTOR>; +template class ACE_Connector<TAO_HANDLER, ACE_SOCK_CONNECTOR>; +template class ACE_Creation_Strategy<TAO_HANDLER>; +template class ACE_Hash_Map_Entry<TAO_ADDR, TAO_HANDLER *>; +template class ACE_Hash<ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> >; +template class ACE_Equal_To<ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> >; +template class ACE_Map_Entry<ACE_HANDLE, TAO_SVC_TUPLE *>; +template class ACE_Map_Manager<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator_Base<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; +template class ACE_NOOP_Concurrency_Strategy<TAO_HANDLER>; +template class ACE_Recycling_Strategy<TAO_HANDLER>; +template class ACE_Strategy_Connector<TAO_HANDLER, ACE_SOCK_CONNECTOR>; +template class TAO_SVC_TUPLE; + +template class ACE_Hash_Map_Manager<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; + +#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) +template class ACE_Pair<TAO_HANDLER *, TAO_ATTRIBUTES>; +template class ACE_Reference_Pair<TAO_ADDR, TAO_HANDLER *>; +template class ACE_Hash_Map_Entry<TAO_ADDR, TAO_CACHED_HANDLER>; + +template class ACE_Hash_Map_Manager<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; + +// = Caching_Strategy +template class ACE_Hash_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; + +template class ACE_LRU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; + +#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) + +template class ACE_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; +template class ACE_LFU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; +template class ACE_FIFO_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; +template class ACE_Null_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; + +template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_LRU_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_LFU_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_FIFO_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_NULL_CACHING_STRATEGY>; + +template class ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; +template class ACE_Cache_Map_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; +template class ACE_Cache_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; + +#else + +template class ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; + +#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ + +template class ACE_Cached_Connect_Strategy_Ex<TAO_HANDLER, ACE_SOCK_CONNECTOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES, TAO_Cached_Connector_Lock>; +template class ACE_Cached_Connect_Strategy<TAO_HANDLER, ACE_SOCK_CONNECTOR, TAO_Cached_Connector_Lock>; + +template class ACE_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP>; +template class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP>; +template class ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_ATTRIBUTES>; +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr> +#pragma instantiate ACE_Auto_Basic_Array_Ptr<TAO_IIOP_Client_Connection_Handler*> +#pragma instantiate auto_ptr<TAO_IIOP_Connect_Creation_Strategy> +#pragma instantiate ACE_Auto_Basic_Ptr<TAO_IIOP_Connect_Creation_Strategy> + +#pragma instantiate ACE_Node<ACE_INET_Addr> +#pragma instantiate ACE_Unbounded_Stack<ACE_INET_Addr> +#pragma instantiate ACE_Unbounded_Stack_Iterator<ACE_INET_Addr> + +#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) +#pragma instantiate CACHED_CONNECT_STRATEGY; +#pragma instantiate TAO_ADDR; +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> +#pragma instantiate ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> +#pragma instantiate ACE_NOOP_Creation_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Concurrency_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Connect_Strategy<TAO_HANDLER, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Connector<TAO_HANDLER, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Creation_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Hash_Map_Entry<TAO_ADDR, TAO_HANDLER *> +#pragma instantiate ACE_Hash<ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> > +#pragma instantiate ACE_Equal_To<ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> > +#pragma instantiate ACE_Map_Entry<ACE_HANDLE, TAO_SVC_TUPLE *> +#pragma instantiate ACE_Map_Manager<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_NOOP_Concurrency_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Recycling_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Strategy_Connector<TAO_HANDLER, ACE_SOCK_CONNECTOR> +#pragma instantiate TAO_SVC_TUPLE + +#pragma instantiate ACE_Hash_Map_Manager<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> + +#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) +#pragma instantiate ACE_Pair<TAO_HANDLER *, TAO_ATTRIBUTES> +#pragma instantiate ACE_Reference_Pair<TAO_ADDR, TAO_HANDLER *> +#pragma instantiate ACE_Hash_Map_Entry<TAO_ADDR, TAO_CACHED_HANDLER> + +#pragma instantiate ACE_Hash_Map_Manager<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> + +// = Caching_Strategy +#pragma instantiate ACE_Hash_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> + +#pragma instantiate ACE_LRU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> + +#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) + +#pragma instantiate ACE_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> +#pragma instantiate ACE_LFU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> +#pragma instantiate ACE_FIFO_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> +#pragma instantiate ACE_Null_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> + +#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_LRU_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_LFU_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_FIFO_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_NULL_CACHING_STRATEGY> + +#pragma instantiate ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> +#pragma instantiate ACE_Cache_Map_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> +#pragma instantiate ACE_Cache_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> + +#else + +#pragma instantiate ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> + +#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ + +#pragma instantiate ACE_Cached_Connect_Strategy_Ex<TAO_HANDLER, ACE_SOCK_CONNECTOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES, TAO_Cached_Connector_Lock> +#pragma instantiate ACE_Cached_Connect_Strategy<TAO_HANDLER, ACE_SOCK_CONNECTOR, TAO_Cached_Connector_Lock> + +#pragma instantiate ACE_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP> +#pragma instantiate ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP> +#pragma instantiate ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_ATTRIBUTES> +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ TAO_IIOP_Connect_Creation_Strategy:: TAO_IIOP_Connect_Creation_Strategy (ACE_Thread_Manager* t, @@ -23,18 +220,15 @@ TAO_IIOP_Connect_Creation_Strategy:: } int -TAO_IIOP_Connect_Creation_Strategy::make_svc_handler ( - TAO_IIOP_Client_Connection_Handler *&sh) +TAO_IIOP_Connect_Creation_Strategy::make_svc_handler + (TAO_IIOP_Client_Connection_Handler *&sh) { if (sh == 0) - { - ACE_NEW_RETURN (sh, - TAO_IIOP_Client_Connection_Handler ( - this->orb_core_->thr_mgr (), - this->orb_core_), - -1); - } - + ACE_NEW_RETURN (sh, + TAO_IIOP_Client_Connection_Handler + (this->orb_core_->thr_mgr (), + this->orb_core_), + -1); return 0; } @@ -47,7 +241,6 @@ typedef ACE_Cached_Connect_Strategy<TAO_IIOP_Client_Connection_Handler, TAO_CACHED_CONNECT_STRATEGY; #endif /* ! TAO_USES_ROBUST_CONNECTION_MGMT */ - TAO_IIOP_Connector::TAO_IIOP_Connector (void) : TAO_Connector (TAO_IOP_TAG_INTERNET_IOP), base_connector_ (), @@ -73,9 +266,9 @@ TAO_IIOP_Connector::open (TAO_ORB_Core *orb_core) TAO_IIOP_Connect_Creation_Strategy *connect_creation_strategy = 0; ACE_NEW_RETURN (connect_creation_strategy, - TAO_IIOP_Connect_Creation_Strategy ( - this->orb_core_->thr_mgr (), - this->orb_core_), + TAO_IIOP_Connect_Creation_Strategy + (this->orb_core_->thr_mgr (), + this->orb_core_), -1); auto_ptr<TAO_IIOP_Connect_Creation_Strategy> @@ -100,19 +293,21 @@ TAO_IIOP_Connector::open (TAO_ORB_Core *orb_core) #else /* TAO_USES_ROBUST_CONNECTION_MGMT */ TAO_CACHED_CONNECT_STRATEGY *cached_connect_strategy = 0; ACE_NEW_RETURN (cached_connect_strategy, - TAO_CACHED_CONNECT_STRATEGY ( - new_connect_creation_strategy.get (), - 0, - 0, - new_connector_lock.get (), - 1), + TAO_CACHED_CONNECT_STRATEGY + (new_connect_creation_strategy.get (), + 0, + 0, + new_connector_lock.get (), + 1), -1); #endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ // Finally everything is fine. Make sure to take ownership away // from the auto pointer. - connect_creation_strategy = new_connect_creation_strategy.release (); - connector_lock = new_connector_lock.release (); + connect_creation_strategy = + new_connect_creation_strategy.release (); + connector_lock = + new_connector_lock.release (); #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) return this->base_connector_.open (this->orb_core_->reactor (), @@ -125,7 +320,6 @@ TAO_IIOP_Connector::open (TAO_ORB_Core *orb_core) cached_connect_strategy, &this->null_activation_strategy_); #endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - } int @@ -152,30 +346,29 @@ TAO_IIOP_Connector::close (void) int TAO_IIOP_Connector::connect (TAO_Profile *profile, - TAO_Transport *& transport, + TAO_Transport *&transport, ACE_Time_Value *max_wait_time) { if (profile->tag () != TAO_IOP_TAG_INTERNET_IOP) return -1; TAO_IIOP_Profile *iiop_profile = - ACE_dynamic_cast (TAO_IIOP_Profile *, profile); - + ACE_dynamic_cast (TAO_IIOP_Profile *, + profile); if (iiop_profile == 0) return -1; - const ACE_INET_Addr &oa = iiop_profile->object_addr (); + const ACE_INET_Addr &oa = + iiop_profile->object_addr (); ACE_Synch_Options synch_options; if (max_wait_time != 0) - { - synch_options.set (ACE_Synch_Options::USE_TIMEOUT, - *max_wait_time); - } + synch_options.set (ACE_Synch_Options::USE_TIMEOUT, + *max_wait_time); TAO_IIOP_Client_Connection_Handler* result; - // the connect call will set the hint () stored in the Profile + // The connect call will set the hint () stored in the Profile // object; but we obtain the transport in the <result> // variable. Other threads may modify the hint, but we are not // affected. @@ -187,8 +380,10 @@ TAO_IIOP_Connector::connect (TAO_Profile *profile, if (TAO_orbdebug) { char buffer [MAXNAMELEN * 2]; - profile->addr_to_string (buffer, (MAXNAMELEN * 2) - 1); - ACE_DEBUG ((LM_ERROR, "(%P|%t) %s:%u, connection to " + profile->addr_to_string (buffer, + (MAXNAMELEN * 2) - 1); + ACE_DEBUG ((LM_ERROR, + "(%P|%t) %s:%u, connection to " "%s failed (%p)\n", __FILE__, __LINE__, @@ -196,23 +391,22 @@ TAO_IIOP_Connector::connect (TAO_Profile *profile, "errno")); } // @@ Without this reset_hint() call the ORB crashes after - // several attempts to reconnect, apparently because the - // cached connector already destroyed the object. - // Using reset_hint() seems to eliminate the problem, and - // actually purify is happy with it, but i have some doubts - // about it: wasn't the hint destroyed already by the - // connector? We (Fred and Carlos) thought about just - // setting the hint to 0, but that would not be thread-safe - // (other threads may be touching the same profile). - // At this point (the day before 1.0) i'm reluctant to change - // ACE, and this fix passes all the TAO tests (including the - // new ping/pong test in the tests/Faults directory). + // several attempts to reconnect, apparently because the cached + // connector already destroyed the object. Using reset_hint() + // seems to eliminate the problem, and actually purify is happy + // with it, but i have some doubts about it: wasn't the hint + // destroyed already by the connector? We (Fred and Carlos) + // thought about just setting the hint to 0, but that would not + // be thread-safe (other threads may be touching the same + // profile). At this point (the day before 1.0) i'm reluctant + // to change ACE, and this fix passes all the TAO tests + // (including the new ping/pong test in the tests/Faults + // directory). iiop_profile->reset_hint (); return -1; } transport = result->transport (); - return 0; } @@ -223,10 +417,13 @@ TAO_IIOP_Connector::preconnect (const char *preconnects) if (this->check_prefix (preconnects) != 0) return 0; // Failure: zero successful preconnections - const char *protocol_removed = ACE_OS::strstr (preconnects, "://") + 3; + const char *protocol_removed = + ACE_OS::strstr (preconnects, + "://") + 3; // "+ 3" since strlen of "://" is 3. - char *preconnections = ACE_OS::strdup (protocol_removed); + char *preconnections = + ACE_OS::strdup (protocol_removed); int successes = 0; if (preconnections) @@ -339,45 +536,35 @@ TAO_IIOP_Connector::preconnect (const char *preconnects) successes++; if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) Preconnection <%s:%d> " - "succeeded.\n", - remote_addrs[slot].get_host_name (), - remote_addrs[slot].get_port_number ())); - } - } - else - { - if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) Preconnection <%s:%d> failed.\n", - remote_addrs[slot].get_host_name (), - remote_addrs[slot].get_port_number ())); - } + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) Preconnection <%s:%d> " + "succeeded.\n", + remote_addrs[slot].get_host_name (), + remote_addrs[slot].get_port_number ())); } + else if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) Preconnection <%s:%d> failed.\n", + remote_addrs[slot].get_host_name (), + remote_addrs[slot].get_port_number ())); } ACE_OS::free (preconnections); if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) IIOP preconnections: %d successes and " - "%d failures.\n", - successes, - num_connections - successes)); - } + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) IIOP preconnections: %d successes and " + "%d failures.\n", + successes, + num_connections - successes)); } - return successes; } -TAO_Profile* +TAO_Profile * TAO_IIOP_Connector::create_profile (TAO_InputCDR& cdr) { - TAO_Profile* pfile; + TAO_Profile *pfile; ACE_NEW_RETURN (pfile, TAO_IIOP_Profile (this->orb_core_), 0); @@ -398,11 +585,8 @@ TAO_IIOP_Connector::make_profile (const char *endpoint, CORBA::Environment &ACE_TRY_ENV) { // The endpoint should be of the form: - // // N.n@host:port/object_key - // // or: - // // host:port/object_key ACE_NEW_THROW_EX (profile, @@ -428,19 +612,14 @@ TAO_IIOP_Connector::check_prefix (const char *endpoint) size_t len0 = ACE_OS::strlen (protocol[0]); size_t len1 = ACE_OS::strlen (protocol[1]); - - // Check for the proper prefix in the IOR. If the proper prefix isn't - // in the IOR then it is not an IOR we can use. + // Check for the proper prefix in the IOR. If the proper prefix + // isn't in the IOR then it is not an IOR we can use. if (slot == len0 && ACE_OS::strncasecmp (endpoint, protocol[0], len0) == 0) - { - return 0; - } + return 0; else if (slot == len1 && ACE_OS::strncasecmp (endpoint, protocol[1], len1) == 0) - { - return 0; - } + return 0; return -1; // Failure: not an IIOP IOR @@ -506,13 +685,10 @@ TAO_IIOP_Connector::make_caching_strategy (void) this->orb_core_->resource_factory (); #if defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - ACE_NEW_RETURN (this->caching_strategy_, TAO_IIOP_CACHING_STRATEGY, -1); - #else - switch (resource_factory->connection_caching_strategy_type ()) { case TAO_Resource_Factory::NOOP: @@ -548,206 +724,5 @@ TAO_IIOP_Connector::make_caching_strategy (void) } #endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ -// // The TAO_Cached_Connector_Lock template instantiations are in // Resource_Factory.cpp. -// - -#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) -#define TAO_SVC_TUPLE ACE_Svc_Tuple<TAO_IIOP_Client_Connection_Handler> -#define CACHED_CONNECT_STRATEGY ACE_Cached_Connect_Strategy<TAO_IIOP_Client_Connection_Handler, ACE_SOCK_CONNECTOR, TAO_Cached_Connector_Lock> -#define TAO_ADDR ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> -#define TAO_HANDLER TAO_IIOP_Client_Connection_Handler -#define TAO_HASH_KEY ACE_Hash<TAO_ADDR> -#define TAO_COMPARE_KEYS ACE_Equal_To<TAO_ADDR> -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr>; -template class ACE_Auto_Basic_Array_Ptr<TAO_IIOP_Client_Connection_Handler*>; -template class auto_ptr<TAO_IIOP_Connect_Creation_Strategy>; -template class ACE_Auto_Basic_Ptr<TAO_IIOP_Connect_Creation_Strategy>; - -template class ACE_Node<ACE_INET_Addr>; -template class ACE_Unbounded_Stack<ACE_INET_Addr>; -template class ACE_Unbounded_Stack_Iterator<ACE_INET_Addr>; - -#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) -template class CACHED_CONNECT_STRATEGY; -template class TAO_ADDR; -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -template class ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr>; -template class ACE_NOOP_Creation_Strategy<TAO_HANDLER>; -template class ACE_Concurrency_Strategy<TAO_HANDLER>; -template class ACE_Connect_Strategy<TAO_HANDLER, ACE_SOCK_CONNECTOR>; -template class ACE_Connector<TAO_HANDLER, ACE_SOCK_CONNECTOR>; -template class ACE_Creation_Strategy<TAO_HANDLER>; -template class ACE_Hash_Map_Entry<TAO_ADDR, TAO_HANDLER *>; -template class ACE_Hash<ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> >; -template class ACE_Equal_To<ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> >; -template class ACE_Map_Entry<ACE_HANDLE, TAO_SVC_TUPLE *>; -template class ACE_Map_Manager<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; -template class ACE_NOOP_Concurrency_Strategy<TAO_HANDLER>; -template class ACE_Recycling_Strategy<TAO_HANDLER>; -template class ACE_Strategy_Connector<TAO_HANDLER, ACE_SOCK_CONNECTOR>; -template class TAO_SVC_TUPLE; - -template class ACE_Hash_Map_Manager<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; - -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) -template class ACE_Pair<TAO_HANDLER *, TAO_ATTRIBUTES>; -template class ACE_Reference_Pair<TAO_ADDR, TAO_HANDLER *>; -template class ACE_Hash_Map_Entry<TAO_ADDR, TAO_CACHED_HANDLER>; - -template class ACE_Hash_Map_Manager<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; - -// = Caching_Strategy -template class ACE_Hash_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; - -template class ACE_LRU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -template class ACE_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; -template class ACE_LFU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; -template class ACE_FIFO_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; -template class ACE_Null_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; - -template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_LRU_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_LFU_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_FIFO_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_NULL_CACHING_STRATEGY>; - -template class ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; -template class ACE_Cache_Map_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; -template class ACE_Cache_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; - -#else - -template class ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -template class ACE_Cached_Connect_Strategy_Ex<TAO_HANDLER, ACE_SOCK_CONNECTOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES, TAO_Cached_Connector_Lock>; -template class ACE_Cached_Connect_Strategy<TAO_HANDLER, ACE_SOCK_CONNECTOR, TAO_Cached_Connector_Lock>; - -template class ACE_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP>; -template class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP>; -template class ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_ATTRIBUTES>; -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr> -#pragma instantiate ACE_Auto_Basic_Array_Ptr<TAO_IIOP_Client_Connection_Handler*> -#pragma instantiate auto_ptr<TAO_IIOP_Connect_Creation_Strategy> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_IIOP_Connect_Creation_Strategy> - -#pragma instantiate ACE_Node<ACE_INET_Addr> -#pragma instantiate ACE_Unbounded_Stack<ACE_INET_Addr> -#pragma instantiate ACE_Unbounded_Stack_Iterator<ACE_INET_Addr> - -#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) -#pragma instantiate CACHED_CONNECT_STRATEGY; -#pragma instantiate TAO_ADDR; -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> -#pragma instantiate ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> -#pragma instantiate ACE_NOOP_Creation_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Concurrency_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Connect_Strategy<TAO_HANDLER, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Connector<TAO_HANDLER, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Creation_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Hash_Map_Entry<TAO_ADDR, TAO_HANDLER *> -#pragma instantiate ACE_Hash<ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> > -#pragma instantiate ACE_Equal_To<ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> > -#pragma instantiate ACE_Map_Entry<ACE_HANDLE, TAO_SVC_TUPLE *> -#pragma instantiate ACE_Map_Manager<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_NOOP_Concurrency_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Recycling_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Strategy_Connector<TAO_HANDLER, ACE_SOCK_CONNECTOR> -#pragma instantiate TAO_SVC_TUPLE - -#pragma instantiate ACE_Hash_Map_Manager<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> - -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) -#pragma instantiate ACE_Pair<TAO_HANDLER *, TAO_ATTRIBUTES> -#pragma instantiate ACE_Reference_Pair<TAO_ADDR, TAO_HANDLER *> -#pragma instantiate ACE_Hash_Map_Entry<TAO_ADDR, TAO_CACHED_HANDLER> - -#pragma instantiate ACE_Hash_Map_Manager<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> - -// = Caching_Strategy -#pragma instantiate ACE_Hash_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> - -#pragma instantiate ACE_LRU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -#pragma instantiate ACE_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> -#pragma instantiate ACE_LFU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> -#pragma instantiate ACE_FIFO_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> -#pragma instantiate ACE_Null_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> - -#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_LRU_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_LFU_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_FIFO_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_IIOP_NULL_CACHING_STRATEGY> - -#pragma instantiate ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> -#pragma instantiate ACE_Cache_Map_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> -#pragma instantiate ACE_Cache_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> - -#else - -#pragma instantiate ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -#pragma instantiate ACE_Cached_Connect_Strategy_Ex<TAO_HANDLER, ACE_SOCK_CONNECTOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES, TAO_Cached_Connector_Lock> -#pragma instantiate ACE_Cached_Connect_Strategy<TAO_HANDLER, ACE_SOCK_CONNECTOR, TAO_Cached_Connector_Lock> - -#pragma instantiate ACE_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP> -#pragma instantiate ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP> -#pragma instantiate ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_ATTRIBUTES> -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/UIOP_Acceptor.cpp b/TAO/tao/UIOP_Acceptor.cpp index 94d083eda06..bd227b8998d 100644 --- a/TAO/tao/UIOP_Acceptor.cpp +++ b/TAO/tao/UIOP_Acceptor.cpp @@ -11,9 +11,8 @@ // // = DESCRIPTION // -// // = AUTHOR -// Fred Kuhns <fredk@cs.wustl.edu> +// Fred Kuhns <fredk@cs.wustl.edu> and // Ossama Othman <othman@cs.wustl.edu> // // ============================================================================ @@ -31,7 +30,31 @@ ACE_RCSID(tao, UIOP_Acceptor, "$Id$") -// **************************************************************** +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; +template class ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; +template class ACE_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; +template class ACE_Creation_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class ACE_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class ACE_Scheduling_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler>; +template class TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> +#pragma instantiate ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> +#pragma instantiate ACE_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> +#pragma instantiate ACE_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate ACE_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate ACE_Scheduling_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> +#pragma instantiate TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ TAO_UIOP_Acceptor::TAO_UIOP_Acceptor (void) : TAO_Acceptor (TAO_IOP_TAG_UNIX_IOP), @@ -63,11 +86,9 @@ TAO_UIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, // we only make one int count = mprofile.profile_count (); - if ((mprofile.size () - count) < 1) - { - if (mprofile.grow (count + 1) == -1) - return -1; - } + if ((mprofile.size () - count) < 1 + && mprofile.grow (count + 1) == -1) + return -1; TAO_UIOP_Profile *pfile = 0; ACE_NEW_RETURN (pfile, @@ -100,12 +121,13 @@ TAO_UIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, } int -TAO_UIOP_Acceptor::is_collocated (const TAO_Profile* pfile) +TAO_UIOP_Acceptor::is_collocated (const TAO_Profile *pfile) { const TAO_UIOP_Profile *profile = - ACE_dynamic_cast(const TAO_UIOP_Profile*, pfile); + ACE_dynamic_cast (const TAO_UIOP_Profile *, + pfile); - // for UNIX Files this is relatively cheap + // For UNIX Files this is relatively cheap. ACE_UNIX_Addr address; if (this->base_acceptor_.acceptor ().get_local_addr (address) == -1) return 0; @@ -144,14 +166,15 @@ TAO_UIOP_Acceptor::open (TAO_ORB_Core *orb_core, return -1; if (major >= 0 && minor >= 0) - this->version_.set_version (ACE_static_cast (CORBA::Octet, major), - ACE_static_cast (CORBA::Octet, minor)); - + this->version_.set_version (ACE_static_cast (CORBA::Octet, + major), + ACE_static_cast (CORBA::Octet, + minor)); // Parse options if (this->parse_options (options) == -1) return -1; - - return this->open_i (orb_core, address); + else + return this->open_i (orb_core, address); } int @@ -162,16 +185,18 @@ TAO_UIOP_Acceptor::open_default (TAO_ORB_Core *orb_core, if (this->parse_options (options) == -1) return -1; - ACE_Auto_String_Free tempname (ACE_OS::tempnam (0, "TAO")); + ACE_Auto_String_Free tempname (ACE_OS::tempnam (0, + "TAO")); if (tempname.get () == 0) return -1; - return this->open_i (orb_core, tempname.get ()); + return this->open_i (orb_core, + tempname.get ()); } int -TAO_UIOP_Acceptor::open_i (TAO_ORB_Core* orb_core, +TAO_UIOP_Acceptor::open_i (TAO_ORB_Core *orb_core, const char *rendezvous) { this->orb_core_ = orb_core; @@ -210,13 +235,10 @@ TAO_UIOP_Acceptor::open_i (TAO_ORB_Core* orb_core, // rendezvous point here if (TAO_debug_level > 5) - { - ACE_DEBUG ((LM_DEBUG, - "\nTAO (%P|%t) UIOP_Acceptor::open_i - " - "listening on: <%s>\n", - addr.get_path_name ())); - } - + ACE_DEBUG ((LM_DEBUG, + "\nTAO (%P|%t) UIOP_Acceptor::open_i - " + "listening on: <%s>\n", + addr.get_path_name ())); return 0; } @@ -243,9 +265,9 @@ TAO_UIOP_Acceptor::rendezvous_point (ACE_UNIX_Addr &addr, // be able to communicate with the server since its point of // communication, the rendezvous point, was not found. On the other // hand, if an absolute path was used, the client would know exactly - // where to find the rendezvous point. It is up to the user to - // make sure that a given UIOP endpoint is accessible by both the - // server and the client. + // where to find the rendezvous point. It is up to the user to make + // sure that a given UIOP endpoint is accessible by both the server + // and the client. addr.set (rendezvous); @@ -255,13 +277,11 @@ TAO_UIOP_Acceptor::rendezvous_point (ACE_UNIX_Addr &addr, // most UNIX domain socket rendezvous points can only be less than // 108 characters long. if (length < ACE_OS::strlen (rendezvous)) - { - ACE_DEBUG ((LM_WARNING, - "TAO (%P|%t) UIOP rendezvous point was truncated to <%s>\n" - "since it was longer than %d characters long.\n", - addr.get_path_name (), - length)); - } + ACE_DEBUG ((LM_WARNING, + "TAO (%P|%t) UIOP rendezvous point was truncated to <%s>\n" + "since it was longer than %d characters long.\n", + addr.get_path_name (), + length)); } CORBA::ULong @@ -284,22 +304,18 @@ TAO_UIOP_Acceptor::parse_options (const char *str) size_t len = options.length (); - const char option_delimiter = '&'; // Count the number of options. CORBA::ULong option_count = 1; - // Number of endpoints in the string (initialized to 1). + // Number of endpoints in the string (initialized to 1). // Only check for endpoints after the protocol specification and // before the object key. for (size_t i = 0; i < len; ++i) - { - if (options[i] == option_delimiter) - option_count++; - } - + if (options[i] == option_delimiter) + option_count++; // The idea behind the following loop is to split the options into // (option, name) pairs. @@ -322,37 +338,32 @@ TAO_UIOP_Acceptor::parse_options (const char *str) end = len - begin; // Handle last endpoint differently if (end == begin) - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) Zero length UIOP option.\n"), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) Zero length UIOP option.\n"), + -1); else if (end != ACE_CString::npos) { - ACE_CString opt = options.substring (begin, end); + ACE_CString opt = + options.substring (begin, end); int slot = opt.find ("="); - if (slot == ACE_static_cast (int, len - 1) || - slot == ACE_CString::npos) - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) UIOP option <%s> is " - "missing a value.\n", - opt.c_str ()), - -1); - } + if (slot == ACE_static_cast (int, len - 1) + || slot == ACE_CString::npos) + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) UIOP option <%s> is " + "missing a value.\n", + opt.c_str ()), + -1); ACE_CString name = opt.substring (0, slot); ACE_CString value = opt.substring (slot + 1); if (name.length () == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) Zero length UIOP " - "option name.\n"), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) Zero length UIOP " + "option name.\n"), + -1); if (name == "priority") { @@ -362,61 +373,24 @@ TAO_UIOP_Acceptor::parse_options (const char *str) if (corba_priority >= 0 /* && corba_priority < 32768 */) - { - // priority_ and corba_priority will always be less - // than 32768 since CORBA::Short is a signed 16 bit - // integer. - - this->priority_ = corba_priority; - } + // priority_ and corba_priority will always be less + // than 32768 since CORBA::Short is a signed 16 bit + // integer. + this->priority_ = corba_priority; else - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) Invalid UIOP endpoint " - "priority: <%s>\n", - value.c_str ()), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) Invalid UIOP endpoint " + "priority: <%s>\n", + value.c_str ()), + -1); } else - { - ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) Invalid UIOP option: <%s>\n", - name.c_str ()), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) Invalid UIOP option: <%s>\n", + name.c_str ()), + -1); } } - return 0; } - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; -template class ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; -template class ACE_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; -template class ACE_Creation_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class ACE_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class ACE_Scheduling_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler>; -template class TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR>; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> -#pragma instantiate ACE_Strategy_Acceptor<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> -#pragma instantiate ACE_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> -#pragma instantiate ACE_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate ACE_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate ACE_Scheduling_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate TAO_Creation_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate TAO_Concurrency_Strategy<TAO_UIOP_Server_Connection_Handler> -#pragma instantiate TAO_Accept_Strategy<TAO_UIOP_Server_Connection_Handler, ACE_LSOCK_ACCEPTOR> - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - #endif /* TAO_HAS_UIOP */ diff --git a/TAO/tao/UIOP_Connector.cpp b/TAO/tao/UIOP_Connector.cpp index 32f191d92db..601633e2636 100644 --- a/TAO/tao/UIOP_Connector.cpp +++ b/TAO/tao/UIOP_Connector.cpp @@ -14,7 +14,207 @@ ACE_RCSID(tao, UIOP_Connector, "$Id$") -// **************************************************************** +// The TAO_Cached_Connector_Lock template instantiations are in +// Resource_Factory.cpp. + +#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) +#define TAO_SVC_TUPLE ACE_Svc_Tuple<TAO_UIOP_Client_Connection_Handler> +#define CACHED_CONNECT_STRATEGY ACE_Cached_Connect_Strategy<TAO_UIOP_Client_Connection_Handler, ACE_LSOCK_CONNECTOR, TAO_Cached_Connector_Lock> +#define TAO_ADDR ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> +#define TAO_HANDLER TAO_UIOP_Client_Connection_Handler +#define TAO_HASH_KEY ACE_Hash<TAO_ADDR> +#define TAO_COMPARE_KEYS ACE_Equal_To<TAO_ADDR> +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_Auto_Basic_Array_Ptr<ACE_UNIX_Addr>; +template class ACE_Auto_Basic_Array_Ptr<TAO_UIOP_Client_Connection_Handler*>; +template class auto_ptr<TAO_UIOP_Connect_Creation_Strategy>; +template class ACE_Auto_Basic_Ptr<TAO_UIOP_Connect_Creation_Strategy>; + +template class ACE_Node<ACE_UNIX_Addr>; +template class ACE_Unbounded_Stack<ACE_UNIX_Addr>; +template class ACE_Unbounded_Stack_Iterator<ACE_UNIX_Addr>; + +#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) +template class CACHED_CONNECT_STRATEGY; +template class TAO_ADDR; +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +template class ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH>; +template class ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr>; +template class ACE_NOOP_Creation_Strategy<TAO_HANDLER>; +template class ACE_Concurrency_Strategy<TAO_HANDLER>; +template class ACE_Connect_Strategy<TAO_HANDLER, ACE_LSOCK_CONNECTOR>; +template class ACE_Connector<TAO_HANDLER, ACE_LSOCK_CONNECTOR>; +template class ACE_Creation_Strategy<TAO_HANDLER>; +template class ACE_Hash_Map_Entry<TAO_ADDR, TAO_HANDLER *>; +template class ACE_Hash<ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> >; +template class ACE_Equal_To<ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> >; +template class ACE_Map_Entry<ACE_HANDLE, TAO_SVC_TUPLE *>; +template class ACE_Map_Manager<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator_Base<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; +template class ACE_NOOP_Concurrency_Strategy<TAO_HANDLER>; +template class ACE_Recycling_Strategy<TAO_HANDLER>; +template class ACE_Strategy_Connector<TAO_HANDLER, ACE_LSOCK_CONNECTOR>; +template class TAO_SVC_TUPLE; + +template class ACE_Hash_Map_Manager<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; + +#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) +template class ACE_Pair<TAO_HANDLER *, TAO_ATTRIBUTES>; +template class ACE_Reference_Pair<TAO_ADDR, TAO_HANDLER *>; +template class ACE_Hash_Map_Entry<TAO_ADDR, TAO_CACHED_HANDLER>; + +template class ACE_Hash_Map_Manager<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; + +// = Caching_Strategy +template class ACE_Hash_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; + +template class ACE_LRU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; + +#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) + +template class ACE_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; +template class ACE_LFU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; +template class ACE_FIFO_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; +template class ACE_Null_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; + +template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_LRU_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_LFU_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_FIFO_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_NULL_CACHING_STRATEGY>; + +template class ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; +template class ACE_Cache_Map_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; +template class ACE_Cache_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; + +#else + +template class ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; + +#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ + +template class ACE_Cached_Connect_Strategy_Ex<TAO_HANDLER, ACE_LSOCK_CONNECTOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES, TAO_Cached_Connector_Lock>; +template class ACE_Cached_Connect_Strategy<TAO_HANDLER, ACE_LSOCK_CONNECTOR, TAO_Cached_Connector_Lock>; + +template class ACE_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP>; +template class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP>; +template class ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_ATTRIBUTES>; +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_Auto_Basic_Array_Ptr<ACE_UNIX_Addr> +#pragma instantiate ACE_Auto_Basic_Array_Ptr<TAO_UIOP_Client_Connection_Handler*> +#pragma instantiate auto_ptr<TAO_UIOP_Connect_Creation_Strategy> +#pragma instantiate ACE_Auto_Basic_Ptr<TAO_UIOP_Connect_Creation_Strategy> + +#pragma instantiate ACE_Node<ACE_UNIX_Addr> +#pragma instantiate ACE_Unbounded_Stack<ACE_UNIX_Addr> +#pragma instantiate ACE_Unbounded_Stack_Iterator<ACE_UNIX_Addr> + +#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) +#pragma instantiate CACHED_CONNECT_STRATEGY; +#pragma instantiate TAO_ADDR; +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +#pragma instantiate ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH> +#pragma instantiate ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> +#pragma instantiate ACE_NOOP_Creation_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Concurrency_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Connect_Strategy<TAO_HANDLER, ACE_LSOCK_CONNECTOR> +#pragma instantiate ACE_Connector<TAO_HANDLER, ACE_LSOCK_CONNECTOR> +#pragma instantiate ACE_Creation_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Hash_Map_Entry<TAO_ADDR, TAO_HANDLER *> +#pragma instantiate ACE_Hash<ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> > +#pragma instantiate ACE_Equal_To<ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> > +#pragma instantiate ACE_Map_Entry<ACE_HANDLE, TAO_SVC_TUPLE *> +#pragma instantiate ACE_Map_Manager<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_NOOP_Concurrency_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Recycling_Strategy<TAO_HANDLER> +#pragma instantiate ACE_Strategy_Connector<TAO_HANDLER, ACE_LSOCK_CONNECTOR> +#pragma instantiate TAO_SVC_TUPLE + +#pragma instantiate ACE_Hash_Map_Manager<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> + +#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) +#pragma instantiate ACE_Pair<TAO_HANDLER *, TAO_ATTRIBUTES> +#pragma instantiate ACE_Reference_Pair<TAO_ADDR, TAO_HANDLER *> +#pragma instantiate ACE_Hash_Map_Entry<TAO_ADDR, TAO_CACHED_HANDLER> + +#pragma instantiate ACE_Hash_Map_Manager<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> + +// = Caching_Strategy +#pragma instantiate ACE_Hash_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> + +#pragma instantiate ACE_LRU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> + +#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) + +#pragma instantiate ACE_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> +#pragma instantiate ACE_LFU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> +#pragma instantiate ACE_FIFO_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> +#pragma instantiate ACE_Null_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> + +#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_LRU_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_LFU_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_FIFO_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_NULL_CACHING_STRATEGY> + +#pragma instantiate ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> +#pragma instantiate ACE_Cache_Map_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> +#pragma instantiate ACE_Cache_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> + +#else + +#pragma instantiate ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> + +#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ + +#pragma instantiate ACE_Cached_Connect_Strategy_Ex<TAO_HANDLER, ACE_LSOCK_CONNECTOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES, TAO_Cached_Connector_Lock> +#pragma instantiate ACE_Cached_Connect_Strategy<TAO_HANDLER, ACE_LSOCK_CONNECTOR, TAO_Cached_Connector_Lock> + +#pragma instantiate ACE_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP> +#pragma instantiate ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP> +#pragma instantiate ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_ATTRIBUTES> +#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ TAO_UIOP_Connect_Creation_Strategy:: TAO_UIOP_Connect_Creation_Strategy (ACE_Thread_Manager* t, @@ -25,22 +225,18 @@ TAO_UIOP_Connect_Creation_Strategy:: } int -TAO_UIOP_Connect_Creation_Strategy::make_svc_handler ( - TAO_UIOP_Client_Connection_Handler *&sh) +TAO_UIOP_Connect_Creation_Strategy::make_svc_handler + (TAO_UIOP_Client_Connection_Handler *&sh) { if (sh == 0) - { - ACE_NEW_RETURN (sh, - TAO_UIOP_Client_Connection_Handler ( - this->orb_core_->thr_mgr (), - this->orb_core_), - -1); - } - + ACE_NEW_RETURN (sh, + TAO_UIOP_Client_Connection_Handler + (this->orb_core_->thr_mgr (), + this->orb_core_), + -1); return 0; } -// **************************************************************** #if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) typedef ACE_Cached_Connect_Strategy<TAO_UIOP_Client_Connection_Handler, ACE_LSOCK_CONNECTOR, @@ -72,9 +268,9 @@ TAO_UIOP_Connector::open (TAO_ORB_Core *orb_core) TAO_UIOP_Connect_Creation_Strategy *connect_creation_strategy = 0; ACE_NEW_RETURN (connect_creation_strategy, - TAO_UIOP_Connect_Creation_Strategy ( - this->orb_core_->thr_mgr (), - this->orb_core_), + TAO_UIOP_Connect_Creation_Strategy + (this->orb_core_->thr_mgr (), + this->orb_core_), -1); auto_ptr<TAO_UIOP_Connect_Creation_Strategy> @@ -99,19 +295,21 @@ TAO_UIOP_Connector::open (TAO_ORB_Core *orb_core) #else /* TAO_USES_ROBUST_CONNECTION_MGMT */ TAO_CACHED_CONNECT_STRATEGY *cached_connect_strategy = 0; ACE_NEW_RETURN (cached_connect_strategy, - TAO_CACHED_CONNECT_STRATEGY ( - new_connect_creation_strategy.get (), - 0, - 0, - new_connector_lock.get (), - 1), + TAO_CACHED_CONNECT_STRATEGY + (new_connect_creation_strategy.get (), + 0, + 0, + new_connector_lock.get (), + 1), -1); #endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ // Finally everything is fine. Make sure to take ownership away // from the auto pointer. - connect_creation_strategy = new_connect_creation_strategy.release (); - connector_lock = new_connector_lock.release (); + connect_creation_strategy = + new_connect_creation_strategy.release (); + connector_lock = + new_connector_lock.release (); #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) return this->base_connector_.open (this->orb_core_->reactor (), @@ -131,7 +329,7 @@ TAO_UIOP_Connector::close (void) { this->base_connector_.close (); - // Zap the creation strategy that we created earlier + // Zap the creation strategy that we created earlier. #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) delete this->cached_connect_strategy_->creation_strategy (); delete this->cached_connect_strategy_; @@ -157,23 +355,22 @@ TAO_UIOP_Connector::connect (TAO_Profile *profile, return -1; TAO_UIOP_Profile *uiop_profile = - ACE_dynamic_cast (TAO_UIOP_Profile *, profile); - + ACE_dynamic_cast (TAO_UIOP_Profile *, + profile); if (uiop_profile == 0) return -1; - const ACE_UNIX_Addr &oa = uiop_profile->object_addr (); + const ACE_UNIX_Addr &oa = + uiop_profile->object_addr (); ACE_Synch_Options synch_options; if (max_wait_time != 0) - { - synch_options.set (ACE_Synch_Options::USE_TIMEOUT, - *max_wait_time); - } + synch_options.set (ACE_Synch_Options::USE_TIMEOUT, + *max_wait_time); TAO_UIOP_Client_Connection_Handler* result; - // the connect call will set the hint () stored in the Profile + // The connect call will set the hint () stored in the Profile // object; but we obtain the transport in the <result> // variable. Other threads may modify the hint, but we are not // affected. @@ -186,7 +383,8 @@ TAO_UIOP_Connector::connect (TAO_Profile *profile, { char buffer [MAXPATHLEN + 1]; profile->addr_to_string (buffer, MAXPATHLEN); - ACE_DEBUG ((LM_ERROR, "(%P|%t) %s:%u, connection to " + ACE_DEBUG ((LM_ERROR, + "(%P|%t) %s:%u, connection to " "%s failed (%p)\n", __FILE__, __LINE__, @@ -194,17 +392,17 @@ TAO_UIOP_Connector::connect (TAO_Profile *profile, "errno")); } // @@ Without this reset_hint() call the ORB crashes after - // several attempts to reconnect, apparently because the - // cached connector already destroyed the object. - // Using reset_hint() seems to eliminate the problem, and - // actually purify is happy with it, but i have some doubts - // about it: wasn't the hint destroyed already by the - // connector? We (Fred and Carlos) thought about just - // setting the hint to 0, but that would not be thread-safe - // (other threads may be touching the same profile). - // At this point (the day before 1.0) i'm reluctant to change - // ACE, and this fix passes all the TAO tests (including the - // new ping/pong test in the tests/Faults directory). + // several attempts to reconnect, apparently because the cached + // connector already destroyed the object. Using reset_hint() + // seems to eliminate the problem, and actually purify is happy + // with it, but i have some doubts about it: wasn't the hint + // destroyed already by the connector? We (Fred and Carlos) + // thought about just setting the hint to 0, but that would not + // be thread-safe (other threads may be touching the same + // profile). At this point (the day before 1.0) i'm reluctant + // to change ACE, and this fix passes all the TAO tests + // (including the new ping/pong test in the tests/Faults + // directory). uiop_profile->reset_hint (); return -1; } @@ -221,10 +419,12 @@ TAO_UIOP_Connector::preconnect (const char *preconnects) if (this->check_prefix (preconnects) != 0) return 0; // Failure: zero successful preconnections - const char *protocol_removed = ACE_OS::strstr (preconnects, "://") + 3; + const char *protocol_removed = + ACE_OS::strstr (preconnects, "://") + 3; // "+ 3" since strlen of "://" is 3. - char *preconnections = ACE_OS::strdup (protocol_removed); + char *preconnections = + ACE_OS::strdup (protocol_removed); int successes = 0; if (preconnections) @@ -236,6 +436,7 @@ TAO_UIOP_Connector::preconnect (const char *preconnects) char *nextptr = 0; char *where = 0; + for (where = ACE::strsplit_r (preconnections, ",", nextptr); where != 0; where = ACE::strsplit_r (0, ",", nextptr)) @@ -243,7 +444,8 @@ TAO_UIOP_Connector::preconnect (const char *preconnects) char *rendezvous_point = where; int version_offset = 0; - // Additional offset to remove version from preconnect, if it exists. + // Additional offset to remove version from preconnect, if + // it exists. if (isdigit (rendezvous_point[0]) && rendezvous_point[1] == '.' && @@ -252,7 +454,7 @@ TAO_UIOP_Connector::preconnect (const char *preconnects) version_offset = 4; // @@ For now, we just drop the version prefix. However, at - // some point in the future the version may become useful. + // some point in the future the version may become useful. dest.set (rendezvous_point + version_offset); @@ -298,6 +500,7 @@ TAO_UIOP_Connector::preconnect (const char *preconnects) handlers, remote_addrs, failures); + // Loop over all the failures and set the handlers that // succeeded to idle state. for (slot = 0; @@ -310,42 +513,33 @@ TAO_UIOP_Connector::preconnect (const char *preconnects) ++successes; if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) Preconnection <%s> succeeded.\n", - remote_addrs[slot].get_path_name ())); - } - } - else - { - if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) Preconnection <%s> failed.\n", - remote_addrs[slot].get_path_name ())); - } + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) Preconnection <%s> succeeded.\n", + remote_addrs[slot].get_path_name ())); } + else if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) Preconnection <%s> failed.\n", + remote_addrs[slot].get_path_name ())); } ACE_OS::free (preconnections); if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) UIOP preconnections: %d successes and " - "%d failures.\n", - successes, - num_connections - successes)); - } + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) UIOP preconnections: %d successes and " + "%d failures.\n", + successes, + num_connections - successes)); } return successes; } -TAO_Profile* +TAO_Profile * TAO_UIOP_Connector::create_profile (TAO_InputCDR& cdr) { - TAO_Profile* pfile; + TAO_Profile *pfile; ACE_NEW_RETURN (pfile, TAO_UIOP_Profile (this->orb_core_), 0); @@ -366,11 +560,8 @@ TAO_UIOP_Connector::make_profile (const char *endpoint, CORBA::Environment &ACE_TRY_ENV) { // The endpoint should be of the form: - // // N.n@rendezvous_point|object_key - // // or: - // // rendezvous_point|object_key ACE_NEW_THROW_EX (profile, @@ -396,23 +587,21 @@ TAO_UIOP_Connector::check_prefix (const char *endpoint) size_t len0 = ACE_OS::strlen (protocol[0]); size_t len1 = ACE_OS::strlen (protocol[1]); - - // Check for the proper prefix in the IOR. If the proper prefix isn't - // in the IOR then it is not an IOR we can use. + // Check for the proper prefix in the IOR. If the proper prefix + // isn't in the IOR then it is not an IOR we can use. if (slot == len0 - && ACE_OS::strncasecmp (endpoint, protocol[0], len0) == 0) - { - return 0; - } + && ACE_OS::strncasecmp (endpoint, + protocol[0], + len0) == 0) + return 0; else if (slot == len1 - && ACE_OS::strncasecmp (endpoint, protocol[1], len1) == 0) - { - return 0; - } + && ACE_OS::strncasecmp (endpoint, + protocol[1], + len1) == 0) + return 0; return -1; - // Failure: not an UIOP IOR - // DO NOT throw an exception here. + // Failure: not an UIOP IOR DO NOT throw an exception here. } char @@ -475,13 +664,10 @@ TAO_UIOP_Connector::make_caching_strategy (void) this->orb_core_->resource_factory (); #if defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - ACE_NEW_RETURN (this->caching_strategy_, TAO_UIOP_CACHING_STRATEGY, -1); - #else - switch (resource_factory->connection_caching_strategy_type ()) { case TAO_Resource_Factory::NOOP: @@ -509,7 +695,6 @@ TAO_UIOP_Connector::make_caching_strategy (void) -1); break; } - #endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ this->caching_strategy_->purge_percent (resource_factory->purge_percentage ()); @@ -517,207 +702,4 @@ TAO_UIOP_Connector::make_caching_strategy (void) } #endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ -// -// The TAO_Cached_Connector_Lock template instantiations are in -// Resource_Factory.cpp. -// -#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) -#define TAO_SVC_TUPLE ACE_Svc_Tuple<TAO_UIOP_Client_Connection_Handler> -#define CACHED_CONNECT_STRATEGY ACE_Cached_Connect_Strategy<TAO_UIOP_Client_Connection_Handler, ACE_LSOCK_CONNECTOR, TAO_Cached_Connector_Lock> -#define TAO_ADDR ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> -#define TAO_HANDLER TAO_UIOP_Client_Connection_Handler -#define TAO_HASH_KEY ACE_Hash<TAO_ADDR> -#define TAO_COMPARE_KEYS ACE_Equal_To<TAO_ADDR> -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Auto_Basic_Array_Ptr<ACE_UNIX_Addr>; -template class ACE_Auto_Basic_Array_Ptr<TAO_UIOP_Client_Connection_Handler*>; -template class auto_ptr<TAO_UIOP_Connect_Creation_Strategy>; -template class ACE_Auto_Basic_Ptr<TAO_UIOP_Connect_Creation_Strategy>; - -template class ACE_Node<ACE_UNIX_Addr>; -template class ACE_Unbounded_Stack<ACE_UNIX_Addr>; -template class ACE_Unbounded_Stack_Iterator<ACE_UNIX_Addr>; - -#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) -template class CACHED_CONNECT_STRATEGY; -template class TAO_ADDR; -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -template class ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH>; -template class ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr>; -template class ACE_NOOP_Creation_Strategy<TAO_HANDLER>; -template class ACE_Concurrency_Strategy<TAO_HANDLER>; -template class ACE_Connect_Strategy<TAO_HANDLER, ACE_LSOCK_CONNECTOR>; -template class ACE_Connector<TAO_HANDLER, ACE_LSOCK_CONNECTOR>; -template class ACE_Creation_Strategy<TAO_HANDLER>; -template class ACE_Hash_Map_Entry<TAO_ADDR, TAO_HANDLER *>; -template class ACE_Hash<ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> >; -template class ACE_Equal_To<ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> >; -template class ACE_Map_Entry<ACE_HANDLE, TAO_SVC_TUPLE *>; -template class ACE_Map_Manager<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX>; -template class ACE_NOOP_Concurrency_Strategy<TAO_HANDLER>; -template class ACE_Recycling_Strategy<TAO_HANDLER>; -template class ACE_Strategy_Connector<TAO_HANDLER, ACE_LSOCK_CONNECTOR>; -template class TAO_SVC_TUPLE; - -template class ACE_Hash_Map_Manager<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; - -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) -template class ACE_Pair<TAO_HANDLER *, TAO_ATTRIBUTES>; -template class ACE_Reference_Pair<TAO_ADDR, TAO_HANDLER *>; -template class ACE_Hash_Map_Entry<TAO_ADDR, TAO_CACHED_HANDLER>; - -template class ACE_Hash_Map_Manager<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex>; - -// = Caching_Strategy -template class ACE_Hash_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; - -template class ACE_LRU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -template class ACE_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; -template class ACE_LFU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; -template class ACE_FIFO_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; -template class ACE_Null_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY>; - -template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_LRU_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_LFU_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_FIFO_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_NULL_CACHING_STRATEGY>; - -template class ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; -template class ACE_Cache_Map_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; -template class ACE_Cache_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; - -#else - -template class ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES>; - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -template class ACE_Cached_Connect_Strategy_Ex<TAO_HANDLER, ACE_LSOCK_CONNECTOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES, TAO_Cached_Connector_Lock>; -template class ACE_Cached_Connect_Strategy<TAO_HANDLER, ACE_LSOCK_CONNECTOR, TAO_Cached_Connector_Lock>; - -template class ACE_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP>; -template class ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP>; -template class ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_ATTRIBUTES>; -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate ACE_Auto_Basic_Array_Ptr<ACE_UNIX_Addr> -#pragma instantiate ACE_Auto_Basic_Array_Ptr<TAO_UIOP_Client_Connection_Handler*> -#pragma instantiate auto_ptr<TAO_UIOP_Connect_Creation_Strategy> -#pragma instantiate ACE_Auto_Basic_Ptr<TAO_UIOP_Connect_Creation_Strategy> - -#pragma instantiate ACE_Node<ACE_UNIX_Addr> -#pragma instantiate ACE_Unbounded_Stack<ACE_UNIX_Addr> -#pragma instantiate ACE_Unbounded_Stack_Iterator<ACE_UNIX_Addr> - -#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) -#pragma instantiate CACHED_CONNECT_STRATEGY; -#pragma instantiate TAO_ADDR; -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -#pragma instantiate ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH> -#pragma instantiate ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> -#pragma instantiate ACE_NOOP_Creation_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Concurrency_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Connect_Strategy<TAO_HANDLER, ACE_LSOCK_CONNECTOR> -#pragma instantiate ACE_Connector<TAO_HANDLER, ACE_LSOCK_CONNECTOR> -#pragma instantiate ACE_Creation_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Hash_Map_Entry<TAO_ADDR, TAO_HANDLER *> -#pragma instantiate ACE_Hash<ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> > -#pragma instantiate ACE_Equal_To<ACE_Refcounted_Hash_Recyclable<ACE_UNIX_Addr> > -#pragma instantiate ACE_Map_Entry<ACE_HANDLE, TAO_SVC_TUPLE *> -#pragma instantiate ACE_Map_Manager<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, TAO_SVC_TUPLE *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_NOOP_Concurrency_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Recycling_Strategy<TAO_HANDLER> -#pragma instantiate ACE_Strategy_Connector<TAO_HANDLER, ACE_LSOCK_CONNECTOR> -#pragma instantiate TAO_SVC_TUPLE - -#pragma instantiate ACE_Hash_Map_Manager<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> - -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) -#pragma instantiate ACE_Pair<TAO_HANDLER *, TAO_ATTRIBUTES> -#pragma instantiate ACE_Reference_Pair<TAO_ADDR, TAO_HANDLER *> -#pragma instantiate ACE_Hash_Map_Entry<TAO_ADDR, TAO_CACHED_HANDLER> - -#pragma instantiate ACE_Hash_Map_Manager<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_KEY, TAO_COMPARE_KEYS, ACE_Null_Mutex> - -// = Caching_Strategy -#pragma instantiate ACE_Hash_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_KEY, TAO_COMPARE_KEYS, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> - -#pragma instantiate ACE_LRU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -#pragma instantiate ACE_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> -#pragma instantiate ACE_LFU_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> -#pragma instantiate ACE_FIFO_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> -#pragma instantiate ACE_Null_Caching_Strategy<TAO_ATTRIBUTES, TAO_CACHING_UTILITY> - -#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_LRU_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_LFU_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_FIFO_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<TAO_ATTRIBUTES, TAO_CACHING_UTILITY, TAO_UIOP_NULL_CACHING_STRATEGY> - -#pragma instantiate ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> -#pragma instantiate ACE_Cache_Map_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> -#pragma instantiate ACE_Cache_Map_Reverse_Iterator<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP_REVERSE_ITERATOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> - -#else - -#pragma instantiate ACE_Cache_Map_Manager<TAO_ADDR, TAO_HANDLER *, TAO_HASH_MAP, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES> - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -#pragma instantiate ACE_Cached_Connect_Strategy_Ex<TAO_HANDLER, ACE_LSOCK_CONNECTOR, TAO_CACHING_STRATEGY, TAO_ATTRIBUTES, TAO_Cached_Connector_Lock> -#pragma instantiate ACE_Cached_Connect_Strategy<TAO_HANDLER, ACE_LSOCK_CONNECTOR, TAO_Cached_Connector_Lock> - -#pragma instantiate ACE_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP> -#pragma instantiate ACE_Refcounted_Recyclable_Handler_Cleanup_Strategy<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP> -#pragma instantiate ACE_Refcounted_Recyclable_Handler_Caching_Utility<TAO_ADDR, TAO_CACHED_HANDLER, TAO_HASH_MAP, TAO_HASH_MAP_ITERATOR, TAO_ATTRIBUTES> -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - #endif /* TAO_HAS_UIOP */ @@ -738,6 +738,7 @@ Krishnakumar B. <kitty@neo.shinko.co.jp> David Sunwall <das@planet8.tds-eagan.lmco.com> Brian Wright <bwright@paladyne.com> Yosi Sarusi <yosi@appstream.com> +Robert Shewan <rshew@peri.com> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson. Paul devised the recursive Makefile scheme that diff --git a/examples/Connection/misc/test_upipe.cpp b/examples/Connection/misc/test_upipe.cpp index f6fbc5c1dda..8775512c8ad 100644 --- a/examples/Connection/misc/test_upipe.cpp +++ b/examples/Connection/misc/test_upipe.cpp @@ -17,11 +17,45 @@ ACE_RCSID(misc, test_upipe, "$Id$") #include "test_upipe.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Accept_Strategy<Server_Service, ACE_UPIPE_ACCEPTOR>; +template class ACE_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR>; +template class ACE_Concurrency_Strategy<Server_Service>; +template class ACE_Connector<Client_Service, ACE_UPIPE_CONNECTOR>; +template class ACE_Creation_Strategy<Server_Service>; +template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *>; +template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Scheduling_Strategy<Server_Service>; +template class ACE_Strategy_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR>; +template class ACE_Svc_Handler<ACE_UPIPE_STREAM, ACE_NULL_SYNCH>; +template class ACE_Svc_Tuple<Client_Service>; +template class ACE_Thread_Strategy<Server_Service>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Accept_Strategy<Server_Service, ACE_UPIPE_ACCEPTOR> +#pragma instantiate ACE_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR> +#pragma instantiate ACE_Concurrency_Strategy<Server_Service> +#pragma instantiate ACE_Connector<Client_Service, ACE_UPIPE_CONNECTOR> +#pragma instantiate ACE_Creation_Strategy<Server_Service> +#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *> +#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Scheduling_Strategy<Server_Service> +#pragma instantiate ACE_Strategy_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR> +#pragma instantiate ACE_Svc_Handler<ACE_UPIPE_STREAM, ACE_NULL_SYNCH> +#pragma instantiate ACE_Svc_Tuple<Client_Service> +#pragma instantiate ACE_Thread_Strategy<Server_Service> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + class Server : public ACE_Strategy_Acceptor <Server_Service, ACE_UPIPE_ACCEPTOR> +{ // = TITLE // Defines the interface for a factory that accepts connections // and creates/activates Server_Service objects. -{ public: Server (ACE_Thread_Manager *thr_mgr, ACE_Reactor *reactor) @@ -61,10 +95,10 @@ private: }; class Client : public ACE_Connector <Client_Service, ACE_UPIPE_CONNECTOR> +{ // = TITLE // Defines the interface for a factory that connects // a Client_Service with a Server. -{ public: Client (ACE_Thread_Manager *thr_mgr) : thr_mgr_ (thr_mgr) @@ -91,9 +125,8 @@ private: ACE_Thread_Manager *thr_mgr_; }; -//---------------------------------------- - -int main (int argc, char *argv[]) +int +main (int argc, char *argv[]) { ACE_Service_Config svc_conf; ACE_Thread_Manager thr_mgr; @@ -112,46 +145,12 @@ int main (int argc, char *argv[]) thr_mgr.wait (); return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Accept_Strategy<Server_Service, ACE_UPIPE_ACCEPTOR>; -template class ACE_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR>; -template class ACE_Concurrency_Strategy<Server_Service>; -template class ACE_Connector<Client_Service, ACE_UPIPE_CONNECTOR>; -template class ACE_Creation_Strategy<Server_Service>; -template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *>; -template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Scheduling_Strategy<Server_Service>; -template class ACE_Strategy_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR>; -template class ACE_Svc_Handler<ACE_UPIPE_STREAM, ACE_NULL_SYNCH>; -template class ACE_Svc_Tuple<Client_Service>; -template class ACE_Thread_Strategy<Server_Service>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Accept_Strategy<Server_Service, ACE_UPIPE_ACCEPTOR> -#pragma instantiate ACE_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR> -#pragma instantiate ACE_Concurrency_Strategy<Server_Service> -#pragma instantiate ACE_Connector<Client_Service, ACE_UPIPE_CONNECTOR> -#pragma instantiate ACE_Creation_Strategy<Server_Service> -#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *> -#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Client_Service> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Scheduling_Strategy<Server_Service> -#pragma instantiate ACE_Strategy_Acceptor<Server_Service, ACE_UPIPE_ACCEPTOR> -#pragma instantiate ACE_Svc_Handler<ACE_UPIPE_STREAM, ACE_NULL_SYNCH> -#pragma instantiate ACE_Svc_Tuple<Client_Service> -#pragma instantiate ACE_Thread_Strategy<Server_Service> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - #else int main (int, char *[]) { - ACE_ERROR_RETURN ((LM_ERROR, "your platform does not support threads\n"), 1); + ACE_ERROR_RETURN ((LM_ERROR, + "your platform does not support threads\n"), + 1); } #endif /* ACE_HAS_THREADS */ diff --git a/examples/Reactor/Misc/pingpong.cpp b/examples/Reactor/Misc/pingpong.cpp index 1d96df7d8df..13683c0ab33 100644 --- a/examples/Reactor/Misc/pingpong.cpp +++ b/examples/Reactor/Misc/pingpong.cpp @@ -39,6 +39,12 @@ #include "ace/Reactor.h" #include "ace/Pipe.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Test_and_Set<ACE_Null_Mutex, sig_atomic_t>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Test_and_Set<ACE_Null_Mutex, sig_atomic_t> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + ACE_RCSID(Misc, pingpong, "$Id$") class Ping_Pong : public ACE_Test_and_Set<ACE_Null_Mutex, sig_atomic_t> @@ -284,10 +290,3 @@ main (int argc, char *argv[]) "close")); return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Test_and_Set<ACE_Null_Mutex, sig_atomic_t>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Test_and_Set<ACE_Null_Mutex, sig_atomic_t> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - diff --git a/examples/Threads/tss1.cpp b/examples/Threads/tss1.cpp index cac098e607d..691150577b8 100644 --- a/examples/Threads/tss1.cpp +++ b/examples/Threads/tss1.cpp @@ -17,7 +17,7 @@ // own unique TSS object. // // = AUTHOR -// Detlef Becker +// Detlef Becker <Detlef.Becker@med.siemens.de> // // ============================================================================ @@ -31,10 +31,17 @@ ACE_RCSID(Threads, tss1, "$Id$") #include "thread_specific.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_TSS<Errno>; +template class Tester<ACE_MT_SYNCH>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_TSS<Errno> +#pragma instantiate Tester<ACE_MT_SYNCH> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + // (Sun C++ 4.2 with -O3 won't link if the following is not const.) static const int iterations = 100; - // Static variables. ACE_MT (ACE_Thread_Mutex Errno::lock_); int Errno::flags_; @@ -71,14 +78,16 @@ public: template <ACE_SYNCH_DECL> int Tester<ACE_SYNCH_USE>::svc (void) { - ACE_DEBUG ((LM_DEBUG, "(%t) svc: setting error code to 1\n")); + ACE_DEBUG ((LM_DEBUG, + "(%t) svc: setting error code to 1\n")); TSS_Error->error (1); for (int i = 0; i < iterations; i++) // Print out every tenth iteration. if ((i % 10) == 1) - ACE_DEBUG ((LM_DEBUG, "(%t) error = %d\n", TSS_Error->error ())); - + ACE_DEBUG ((LM_DEBUG, + "(%t) error = %d\n", + TSS_Error->error ())); this->close (); return 0; @@ -94,11 +103,15 @@ Tester<ACE_SYNCH_USE>::open (void *) template <ACE_SYNCH_DECL> int Tester<ACE_SYNCH_USE>::close (u_long) { - ACE_DEBUG ((LM_DEBUG, "(%t) close running\n")); + ACE_DEBUG ((LM_DEBUG, + "(%t) close running\n")); close_started = 1; - ACE_DEBUG ((LM_DEBUG, "(%t) close: setting error code to 7\n")); + ACE_DEBUG ((LM_DEBUG, + "(%t) close: setting error code to 7\n")); TSS_Error->error (7); - ACE_DEBUG ((LM_DEBUG, "(%t) close: error = %d\n", TSS_Error->error ())); + ACE_DEBUG ((LM_DEBUG, + "(%t) close: error = %d\n", + TSS_Error->error ())); close_started = 0; return 0; } @@ -108,37 +121,36 @@ main (int, char *[]) { Tester<ACE_MT_SYNCH> tester; - ACE_DEBUG ((LM_DEBUG, "(%t) main: setting error code to 3\n")); + ACE_DEBUG ((LM_DEBUG, + "(%t) main: setting error code to 3\n")); TSS_Error->error (3); - ACE_DEBUG ((LM_DEBUG, "(%t) main: error = %d\n", TSS_Error->error ())); + ACE_DEBUG ((LM_DEBUG, + "(%t) main: error = %d\n", + TSS_Error->error ())); // Spawn off a thread and make test an Active Object. tester.open (); // Keep looping until <Tester::close> is called. while (!close_started) - ACE_DEBUG ((LM_DEBUG, "(%t) error = %d\n", TSS_Error->error ())); + ACE_DEBUG ((LM_DEBUG, + "(%t) error = %d\n", + TSS_Error->error ())); - ACE_DEBUG ((LM_DEBUG, "(%t) main: setting error code to 4\n")); + ACE_DEBUG ((LM_DEBUG, + "(%t) main: setting error code to 4\n")); TSS_Error->error (4); - ACE_DEBUG ((LM_DEBUG, "(%t) main: error = %d\n", TSS_Error->error ())); + ACE_DEBUG ((LM_DEBUG, + "(%t) main: error = %d\n", + TSS_Error->error ())); // Keep looping until <Tester::close> finishes. while (close_started != 0) - ACE_DEBUG ((LM_DEBUG, "(%t) error = %d\n", TSS_Error->error ())); - + ACE_DEBUG ((LM_DEBUG, + "(%t) error = %d\n", + TSS_Error->error ())); return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_TSS<Errno>; -template class Tester<ACE_MT_SYNCH>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_TSS<Errno> -#pragma instantiate Tester<ACE_MT_SYNCH> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - #else int main (int, char *[]) diff --git a/examples/Timer_Queue/Async_Timer_Queue_Test.cpp b/examples/Timer_Queue/Async_Timer_Queue_Test.cpp index e05d11797fb..054dc3d2191 100644 --- a/examples/Timer_Queue/Async_Timer_Queue_Test.cpp +++ b/examples/Timer_Queue/Async_Timer_Queue_Test.cpp @@ -13,8 +13,9 @@ // using an <ACE_Timer_Heap>. // // = AUTHORS -// Douglas C. Schmidt and -// Sergio Flores-Gaitan +// Douglas C. Schmidt <schmidt@cs.wustl.edu> and +// Sergio Flores-Gaitan <sergio@cs.wustl.edu> +// // ============================================================================ #include "ace/Signal.h" @@ -23,12 +24,22 @@ #include "Async_Timer_Queue_Test.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Async_Timer_Queue_Adapter<ACE_Timer_Heap>; +template class Command<Async_Timer_Queue, Async_Timer_Queue::ACTION>; +template class Timer_Queue_Test_Driver<Async_Timer_Queue *, Async_Timer_Queue, Async_Timer_Queue::ACTION>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Async_Timer_Queue_Adapter<ACE_Timer_Heap> +#pragma instantiate Command<Async_Timer_Queue, Async_Timer_Queue::ACTION> +#pragma instantiate Timer_Queue_Test_Driver<Async_Timer_Queue *, Async_Timer_Queue, Async_Timer_Queue::ACTION> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + ACE_RCSID(Timer_Queue, Async_Timer_Queue_Test, "$Id$") // Hook method that is called to handle the expiration of a timer. int Async_Timer_Handler::handle_timeout (const ACE_Time_Value &tv, - const void *arg) + const void *arg) { // Print some information here (note that this is not strictly // signal-safe since the ACE logging mechanism uses functions that @@ -89,7 +100,8 @@ Async_Timer_Queue::dump (void) iter.next ()) iter.item ()->dump (); - ACE_DEBUG ((LM_DEBUG, "end dumping timer queue\n")); + ACE_DEBUG ((LM_DEBUG, + "end dumping timer queue\n")); } // Schedule a timer. @@ -102,7 +114,8 @@ Async_Timer_Queue::schedule (u_int microsecs) // Create a new Event_Handler for our timer. ACE_Event_Handler *eh; - ACE_NEW (eh, Async_Timer_Handler); + ACE_NEW (eh, + Async_Timer_Handler); // Schedule the timer to run in the future. long tid = this->tq_.schedule @@ -111,7 +124,9 @@ Async_Timer_Queue::schedule (u_int microsecs) ACE_OS::gettimeofday () + tv); if (tid == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "schedule_timer")); + ACE_ERROR ((LM_ERROR, + "%p\n", + "schedule_timer")); } // Cancel a timer. @@ -119,12 +134,16 @@ Async_Timer_Queue::schedule (u_int microsecs) void Async_Timer_Queue::cancel (long timer_id) { - ACE_DEBUG ((LM_DEBUG, "canceling %d\n", timer_id)); + ACE_DEBUG ((LM_DEBUG, + "canceling %d\n", + timer_id)); const void *act = 0; if (this->tq_.cancel (timer_id, &act) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "cancel_timer")); + ACE_ERROR ((LM_ERROR, + "%p\n", + "cancel_timer")); // In this case, the act will be 0, but it could be a real pointer // in other cases. @@ -161,26 +180,23 @@ Async_Timer_Queue::cancel_timer (void *argument) // signal handler using SIGINT, not from the driver. int -Async_Timer_Queue::list_timer (void *argument) +Async_Timer_Queue::list_timer (void *) { - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (argument); - // Display an error message. - ACE_ERROR_RETURN ((LM_ERROR, "invalid input\n"), 0); + ACE_ERROR_RETURN ((LM_ERROR, + "invalid input\n"), 0); } // Dummy shutdown timer hook method. The shutdown of the timer queue // is done with a signal handler using SIGQUIT, not from the driver. int -Async_Timer_Queue::shutdown_timer (void *argument) +Async_Timer_Queue::shutdown_timer (void *) { - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (argument); - // Display an error message. - ACE_ERROR_RETURN ((LM_ERROR, "invalid input\n"), 0); + ACE_ERROR_RETURN ((LM_ERROR, + "invalid input\n"), + 0); } // Handler for the SIGINT and SIGQUIT signals. @@ -188,7 +204,9 @@ Async_Timer_Queue::shutdown_timer (void *argument) static void signal_handler (int signum) { - ACE_DEBUG ((LM_DEBUG, "handling signal %S\n", signum)); + ACE_DEBUG ((LM_DEBUG, + "handling signal %S\n", + signum)); switch (signum) { @@ -198,7 +216,9 @@ signal_handler (int signum) /* NOTREACHED */ case SIGQUIT: - ACE_ERROR ((LM_ERROR, "shutting down on SIGQUIT%a\n", 1)); + ACE_ERROR ((LM_ERROR, + "shutting down on SIGQUIT%a\n", + 1)); /* NOTREACHED */ break; } @@ -248,8 +268,9 @@ Async_Timer_Queue_Test_Driver::display_menu (void) "^C list timers\n" "^\\ exit program\n"; - ACE_DEBUG ((LM_DEBUG, "%s", menu)); - + ACE_DEBUG ((LM_DEBUG, + "%s", + menu)); return 0; } @@ -263,35 +284,25 @@ Async_Timer_Queue_Test_Driver::init (void) // Initialize <Command> objects with their corresponding <Input_Task> methods. ACE_NEW_RETURN (schedule_cmd_, CMD (*Async_Timer_Queue::instance (), - &Async_Timer_Queue::schedule_timer), + &Async_Timer_Queue::schedule_timer), -1); ACE_NEW_RETURN (cancel_cmd_, CMD (*Async_Timer_Queue::instance (), - &Async_Timer_Queue::cancel_timer), + &Async_Timer_Queue::cancel_timer), -1); ACE_NEW_RETURN (list_cmd_, CMD (*Async_Timer_Queue::instance (), - &Async_Timer_Queue::list_timer), + &Async_Timer_Queue::list_timer), -1); ACE_NEW_RETURN (shutdown_cmd_, CMD (*Async_Timer_Queue::instance (), - &Async_Timer_Queue::shutdown_timer), + &Async_Timer_Queue::shutdown_timer), -1); register_signal_handlers (); return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Async_Timer_Queue_Adapter<ACE_Timer_Heap>; -template class Command<Async_Timer_Queue, Async_Timer_Queue::ACTION>; -template class Timer_Queue_Test_Driver<Async_Timer_Queue *, Async_Timer_Queue, Async_Timer_Queue::ACTION>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Async_Timer_Queue_Adapter<ACE_Timer_Heap> -#pragma instantiate Command<Async_Timer_Queue, Async_Timer_Queue::ACTION> -#pragma instantiate Timer_Queue_Test_Driver<Async_Timer_Queue *, Async_Timer_Queue, Async_Timer_Queue::ACTION> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp b/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp index 819707e5f3e..06d3a643091 100644 --- a/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp +++ b/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp @@ -24,6 +24,14 @@ #include "Driver.h" #include "Reactor_Timer_Queue_Test.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class Timer_Queue_Test_Driver <ACE_Timer_Heap, Input_Handler, Input_Handler::ACTION>; +template class Command<Input_Handler, Input_Handler::ACTION>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate Timer_Queue_Test_Driver <ACE_Timer_Heap, Input_Handler, Input_Handler::ACTION> +#pragma instantiate Command<Input_Handler, Input_Handler::ACTION> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + ACE_RCSID(Timer_Queue, Reactor_Timer_Queue_Test, "$Id$") void @@ -40,8 +48,11 @@ Reactor_Timer_Handler::handle_timeout (const ACE_Time_Value &tv, ACE_UNUSED_ARG (tv); ACE_Time_Value txv = ACE_OS::gettimeofday (); - ACE_DEBUG ((LM_DEBUG, "\nTimer #%d fired at %d.%06d (%T)!\n", - this->tid_, txv.sec (), txv.usec ())); + ACE_DEBUG ((LM_DEBUG, + "\nTimer #%d fired at %d.%06d (%T)!\n", + this->tid_, + txv.sec (), + txv.usec ())); delete this; return 0; @@ -75,7 +86,8 @@ Input_Handler::schedule_timer (void *argument) 0, ACE_Time_Value (0, delay)); if (tid == -1) - ACE_DEBUG ((LM_DEBUG, "Unable to schedule timer\n")); + ACE_DEBUG ((LM_DEBUG, + "Unable to schedule timer\n")); else { ACE_DEBUG ((LM_DEBUG, @@ -86,8 +98,9 @@ Input_Handler::schedule_timer (void *argument) } } else - ACE_ERROR_RETURN ((LM_ERROR, "not enough memory?\n"), -1); - + ACE_ERROR_RETURN ((LM_ERROR, + "not enough memory?\n"), + -1); return tid; } @@ -105,7 +118,8 @@ Input_Handler::shutdown_timer (void *argument) ACE_UNUSED_ARG (argument); this->done_ = 1; - ACE_DEBUG ((LM_DEBUG, "Shutting down event loop\n")); + ACE_DEBUG ((LM_DEBUG, + "Shutting down event loop\n")); return -1; } @@ -116,9 +130,10 @@ Input_Handler::list_timer (void *argument) ACE_UNUSED_ARG (argument); ACE_Timer_Queue_Iterator &iter = this->tq_->iter (); - ACE_DEBUG ((LM_DEBUG, "\n\nTimers in queue:\n")); + ACE_DEBUG ((LM_DEBUG, + "\n\nTimers in queue:\n")); - for (; ! iter.isdone (); iter.next ()) + for (; !iter.isdone (); iter.next ()) { ACE_Timer_Node *tn = iter.item (); ACE_DEBUG ((LM_DEBUG, "Timer #%d: %d.%06d\n", @@ -155,9 +170,10 @@ Reactor_Timer_Queue_Test_Driver::display_menu (void) "4) Shutdown program\n" "Enter selection:"; - ACE_DEBUG ((LM_DEBUG, "%s", menu)); - - return 0; + ACE_DEBUG ((LM_DEBUG, + "%s", + menu)); + return 0; } int @@ -199,7 +215,8 @@ Reactor_Timer_Queue_Test_Driver::init (void) int Reactor_Timer_Queue_Test_Driver::run_test (void) { - ACE_DEBUG ((LM_DEBUG, "TIMER TEST STARTED\n")); + ACE_DEBUG ((LM_DEBUG, + "TIMER TEST STARTED\n")); this->init (); @@ -207,14 +224,7 @@ Reactor_Timer_Queue_Test_Driver::run_test (void) while (thandler_.done () == 0) ACE_Reactor::instance ()->handle_events (); - ACE_DEBUG ((LM_DEBUG, "TIMER TEST ENDED\n")); + ACE_DEBUG ((LM_DEBUG, + "TIMER TEST ENDED\n")); return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class Timer_Queue_Test_Driver <ACE_Timer_Heap, Input_Handler, Input_Handler::ACTION>; -template class Command<Input_Handler, Input_Handler::ACTION>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate Timer_Queue_Test_Driver <ACE_Timer_Heap, Input_Handler, Input_Handler::ACTION> -#pragma instantiate Command<Input_Handler, Input_Handler::ACTION> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp b/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp index c224051cb61..e1a9644c808 100644 --- a/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp +++ b/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp @@ -13,7 +13,8 @@ // using an <ACE_Timer_Heap>. // // = AUTHORS -// Carlos O'Ryan and Douglas C. Schmidt +// Carlos O'Ryan <coryan@cs.wustl.edu> and +// Douglas C. Schmidt <schmidt@cs.wustl.edu> // // ============================================================================ @@ -23,6 +24,43 @@ #include "Thread_Timer_Queue_Test.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Thread_Timer_Queue_Adapter<Timer_Heap>; +template class Timer_Queue_Test_Driver<Thread_Timer_Queue, + Input_Task, + Input_Task::ACTION>; +template class Command<Input_Task, Input_Task::ACTION>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Thread_Timer_Queue_Adapter<Timer_Heap> +#pragma instantiate Timer_Queue_Test_Driver<Thread_Timer_Queue, \ + Input_Task, \ + Input_Task::ACTION> +#pragma instantiate Command<Input_Task, Input_Task::ACTION> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) +// These templates will specialized in libACE.* if the platforms does +// not define ACE_MT_SAFE. + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Thread_Condition<ACE_Thread_Mutex>; +template class ACE_Condition<ACE_Thread_Mutex>; +template class ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>; +template class ACE_Timer_Queue_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex>; +template class ACE_Timer_Heap_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex>; +template class ACE_Timer_Heap_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex>; +template class ACE_Timer_Queue_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Thread_Condition<ACE_Thread_Mutex> +#pragma instantiate ACE_Condition<ACE_Thread_Mutex> +#pragma instantiate ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex> +#pragma instantiate ACE_Timer_Queue_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex> +#pragma instantiate ACE_Timer_Heap_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex> +#pragma instantiate ACE_Timer_Heap_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex> +#pragma instantiate ACE_Timer_Queue_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ +#endif /* ACE_MT_SAFE */ + ACE_RCSID(Timer_Queue, Thread_Timer_Queue_Test, "$Id$") // Administrivia methods... @@ -57,8 +95,8 @@ Handler::handle_timeout (const ACE_Time_Value ¤t_time, this->id_, current_time.sec (), current_time.usec (), - delay.sec (), delay.usec ()); - + delay.sec (), + delay.usec ()); // Notice this delete is protected. delete this; return 0; @@ -96,7 +134,8 @@ Input_Task::svc (void) // we are done. this->queue_->deactivate (); - ACE_DEBUG ((LM_DEBUG, "terminating input thread\n")); + ACE_DEBUG ((LM_DEBUG, + "terminating input thread\n")); return 0; } @@ -106,13 +145,16 @@ Input_Task::svc (void) int Input_Task::add_timer (void *argument) { - u_long useconds = *(int *) argument; - ACE_Time_Value interval (useconds / usecs_, useconds % usecs_); + u_long useconds = *ACE_reinterpret_Cast (int *, argument); + ACE_Time_Value interval (useconds / usecs_, + useconds % usecs_); ACE_Time_Value expire_at = ACE_OS::gettimeofday () + interval; Handler *h; - ACE_NEW_RETURN (h, Handler (expire_at), -1); + ACE_NEW_RETURN (h, + Handler (expire_at), + -1); int id = queue_->schedule (h, 0, expire_at); @@ -125,7 +167,8 @@ Input_Task::add_timer (void *argument) // nicer messages. h->set_id (id); - ACE_OS::printf ("scheduling timer %d\n", id); + ACE_OS::printf ("scheduling timer %d\n", + id); return 0; } @@ -183,14 +226,16 @@ Input_Task::dump (void) { ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->queue_->mutex ()); - ACE_DEBUG ((LM_DEBUG, "begin dumping timer queue\n")); + ACE_DEBUG ((LM_DEBUG, + "begin dumping timer queue\n")); for (Timer_Heap_Iterator i (this->queue_->timer_queue ()); i.item () != 0; i.next ()) i.item ()->dump (); - ACE_DEBUG ((LM_DEBUG, "end dumping timer queue\n")); + ACE_DEBUG ((LM_DEBUG, + "end dumping timer queue\n")); } // constructor @@ -221,8 +266,9 @@ Thread_Timer_Queue_Test_Driver::display_menu (void) "3 : prints timer queue\n" "4 : exit\n"; - ACE_DEBUG ((LM_DEBUG, "%s", menu)); - + ACE_DEBUG ((LM_DEBUG, + "%s", + menu)); return 0; } @@ -250,50 +296,16 @@ Thread_Timer_Queue_Test_Driver::init (void) -1); if (this->input_task_.activate () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "cannot activate input task"), -1); - - if (this->timer_queue_.activate () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "cannot activate timer queue"), -1); - - if (ACE_Thread_Manager::instance ()->wait () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "wait on Thread_Manager failed"),-1); - + ACE_ERROR_RETURN ((LM_ERROR, + "cannot activate input task"), + -1); + else if (this->timer_queue_.activate () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "cannot activate timer queue"), + -1); + else if (ACE_Thread_Manager::instance ()->wait () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "wait on Thread_Manager failed"), + -1); return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Thread_Timer_Queue_Adapter<Timer_Heap>; -template class Timer_Queue_Test_Driver<Thread_Timer_Queue, - Input_Task, - Input_Task::ACTION>; -template class Command<Input_Task, Input_Task::ACTION>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Thread_Timer_Queue_Adapter<Timer_Heap> -#pragma instantiate Timer_Queue_Test_Driver<Thread_Timer_Queue, \ - Input_Task, \ - Input_Task::ACTION> -#pragma instantiate Command<Input_Task, Input_Task::ACTION> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - -#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) -// These templates will specialized in libACE.* if the platforms does -// not define ACE_MT_SAFE. - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Thread_Condition<ACE_Thread_Mutex>; -template class ACE_Condition<ACE_Thread_Mutex>; -template class ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>; -template class ACE_Timer_Queue_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex>; -template class ACE_Timer_Heap_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex>; -template class ACE_Timer_Heap_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex>; -template class ACE_Timer_Queue_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Thread_Condition<ACE_Thread_Mutex> -#pragma instantiate ACE_Condition<ACE_Thread_Mutex> -#pragma instantiate ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex> -#pragma instantiate ACE_Timer_Queue_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex> -#pragma instantiate ACE_Timer_Heap_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex> -#pragma instantiate ACE_Timer_Heap_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex> -#pragma instantiate ACE_Timer_Queue_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>, ACE_Null_Mutex> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_MT_SAFE */ diff --git a/netsvcs/lib/Name_Handler.cpp b/netsvcs/lib/Name_Handler.cpp index fa6d14a8eb6..1df0e2b82e3 100644 --- a/netsvcs/lib/Name_Handler.cpp +++ b/netsvcs/lib/Name_Handler.cpp @@ -10,6 +10,26 @@ ACE_RCSID(lib, Name_Handler, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<Naming_Context, ACE_SYNCH_NULL_MUTEX>; +template class ACE_Accept_Strategy<ACE_Name_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Acceptor<ACE_Name_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Concurrency_Strategy<ACE_Name_Handler>; +template class ACE_Creation_Strategy<ACE_Name_Handler>; +template class ACE_Schedule_All_Reactive_Strategy<ACE_Name_Handler>; +template class ACE_Scheduling_Strategy<ACE_Name_Handler>; +template class ACE_Strategy_Acceptor<ACE_Name_Handler, ACE_SOCK_ACCEPTOR>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Singleton<Naming_Context, ACE_SYNCH_NULL_MUTEX> +#pragma instantiate ACE_Accept_Strategy<ACE_Name_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Acceptor<ACE_Name_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Concurrency_Strategy<ACE_Name_Handler> +#pragma instantiate ACE_Creation_Strategy<ACE_Name_Handler> +#pragma instantiate ACE_Schedule_All_Reactive_Strategy<ACE_Name_Handler> +#pragma instantiate ACE_Scheduling_Strategy<ACE_Name_Handler> +#pragma instantiate ACE_Strategy_Acceptor<ACE_Name_Handler, ACE_SOCK_ACCEPTOR> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + // Simple macro that does bitwise AND -- useful in table lookup #define ACE_TABLE_MAP(INDEX, MASK) (INDEX & MASK) @@ -597,23 +617,3 @@ ACE_Name_Handler::~ACE_Name_Handler (void) ACE_DEBUG ((LM_DEBUG, "closing down Handle %d\n", this->get_handle ())); } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Singleton<Naming_Context, ACE_SYNCH_NULL_MUTEX>; -template class ACE_Accept_Strategy<ACE_Name_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Acceptor<ACE_Name_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Concurrency_Strategy<ACE_Name_Handler>; -template class ACE_Creation_Strategy<ACE_Name_Handler>; -template class ACE_Schedule_All_Reactive_Strategy<ACE_Name_Handler>; -template class ACE_Scheduling_Strategy<ACE_Name_Handler>; -template class ACE_Strategy_Acceptor<ACE_Name_Handler, ACE_SOCK_ACCEPTOR>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Singleton<Naming_Context, ACE_SYNCH_NULL_MUTEX> -#pragma instantiate ACE_Accept_Strategy<ACE_Name_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Acceptor<ACE_Name_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Concurrency_Strategy<ACE_Name_Handler> -#pragma instantiate ACE_Creation_Strategy<ACE_Name_Handler> -#pragma instantiate ACE_Schedule_All_Reactive_Strategy<ACE_Name_Handler> -#pragma instantiate ACE_Scheduling_Strategy<ACE_Name_Handler> -#pragma instantiate ACE_Strategy_Acceptor<ACE_Name_Handler, ACE_SOCK_ACCEPTOR> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/netsvcs/lib/TS_Server_Handler.cpp b/netsvcs/lib/TS_Server_Handler.cpp index aa6999cdbec..130afe253bd 100644 --- a/netsvcs/lib/TS_Server_Handler.cpp +++ b/netsvcs/lib/TS_Server_Handler.cpp @@ -9,6 +9,32 @@ ACE_RCSID(lib, TS_Server_Handler, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Accept_Strategy<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Acceptor<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Concurrency_Strategy<ACE_TS_Server_Handler>; +template class ACE_Creation_Strategy<ACE_TS_Server_Handler>; +template class ACE_Schedule_All_Reactive_Strategy<ACE_TS_Server_Handler>; +template class ACE_Scheduling_Strategy<ACE_TS_Server_Handler>; +template class ACE_Strategy_Acceptor<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR>; +#if defined (ACE_HAS_STREAM_PIPES) +template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; +// #else the instantiation in is Client_Logging_Handler.cpp +#endif /* ACE_HAS_STREAM_PIPES */ +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Accept_Strategy<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Acceptor<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Concurrency_Strategy<ACE_TS_Server_Handler> +#pragma instantiate ACE_Creation_Strategy<ACE_TS_Server_Handler> +#pragma instantiate ACE_Schedule_All_Reactive_Strategy<ACE_TS_Server_Handler> +#pragma instantiate ACE_Scheduling_Strategy<ACE_TS_Server_Handler> +#pragma instantiate ACE_Strategy_Acceptor<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR> +#if defined (ACE_HAS_STREAM_PIPES) +#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> +// #else the instantiation in is Client_Logging_Handler.cpp +#endif /* ACE_HAS_STREAM_PIPES */ +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + int ACE_TS_Server_Acceptor::parse_args (int argc, char *argv[]) { @@ -255,29 +281,3 @@ ACE_TS_Server_Handler::~ACE_TS_Server_Handler (void) "closing down Handle %d\n", this->get_handle ())); } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Accept_Strategy<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Acceptor<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Concurrency_Strategy<ACE_TS_Server_Handler>; -template class ACE_Creation_Strategy<ACE_TS_Server_Handler>; -template class ACE_Schedule_All_Reactive_Strategy<ACE_TS_Server_Handler>; -template class ACE_Scheduling_Strategy<ACE_TS_Server_Handler>; -template class ACE_Strategy_Acceptor<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR>; -#if defined (ACE_HAS_STREAM_PIPES) -template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -// #else the instantiation in is Client_Logging_Handler.cpp -#endif /* ACE_HAS_STREAM_PIPES */ -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Accept_Strategy<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Acceptor<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Concurrency_Strategy<ACE_TS_Server_Handler> -#pragma instantiate ACE_Creation_Strategy<ACE_TS_Server_Handler> -#pragma instantiate ACE_Schedule_All_Reactive_Strategy<ACE_TS_Server_Handler> -#pragma instantiate ACE_Scheduling_Strategy<ACE_TS_Server_Handler> -#pragma instantiate ACE_Strategy_Acceptor<ACE_TS_Server_Handler, ACE_SOCK_ACCEPTOR> -#if defined (ACE_HAS_STREAM_PIPES) -#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> -// #else the instantiation in is Client_Logging_Handler.cpp -#endif /* ACE_HAS_STREAM_PIPES */ -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/netsvcs/lib/Token_Handler.cpp b/netsvcs/lib/Token_Handler.cpp index 723fbf64fe1..c61e2825402 100644 --- a/netsvcs/lib/Token_Handler.cpp +++ b/netsvcs/lib/Token_Handler.cpp @@ -7,6 +7,24 @@ ACE_RCSID(lib, Token_Handler, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Acceptor<ACE_Token_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Accept_Strategy<ACE_Token_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Concurrency_Strategy<ACE_Token_Handler>; +template class ACE_Creation_Strategy<ACE_Token_Handler>; +template class ACE_Schedule_All_Reactive_Strategy<ACE_Token_Handler>; +template class ACE_Scheduling_Strategy<ACE_Token_Handler>; +template class ACE_Strategy_Acceptor<ACE_Token_Handler, ACE_SOCK_ACCEPTOR>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Acceptor<ACE_Token_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Accept_Strategy<ACE_Token_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Concurrency_Strategy<ACE_Token_Handler> +#pragma instantiate ACE_Creation_Strategy<ACE_Token_Handler> +#pragma instantiate ACE_Schedule_All_Reactive_Strategy<ACE_Token_Handler> +#pragma instantiate ACE_Scheduling_Strategy<ACE_Token_Handler> +#pragma instantiate ACE_Strategy_Acceptor<ACE_Token_Handler, ACE_SOCK_ACCEPTOR> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + int ACE_Token_Acceptor::parse_args (int argc, char *argv[]) { @@ -636,21 +654,3 @@ ACE_TS_WLock::clone (void) const ACE_NEW_RETURN (temp, ACE_TS_WLock (*this), 0); return temp; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Acceptor<ACE_Token_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Accept_Strategy<ACE_Token_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Concurrency_Strategy<ACE_Token_Handler>; -template class ACE_Creation_Strategy<ACE_Token_Handler>; -template class ACE_Schedule_All_Reactive_Strategy<ACE_Token_Handler>; -template class ACE_Scheduling_Strategy<ACE_Token_Handler>; -template class ACE_Strategy_Acceptor<ACE_Token_Handler, ACE_SOCK_ACCEPTOR>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Acceptor<ACE_Token_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Accept_Strategy<ACE_Token_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Concurrency_Strategy<ACE_Token_Handler> -#pragma instantiate ACE_Creation_Strategy<ACE_Token_Handler> -#pragma instantiate ACE_Schedule_All_Reactive_Strategy<ACE_Token_Handler> -#pragma instantiate ACE_Scheduling_Strategy<ACE_Token_Handler> -#pragma instantiate ACE_Strategy_Acceptor<ACE_Token_Handler, ACE_SOCK_ACCEPTOR> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/tests/Cached_Accept_Conn_Test.cpp b/tests/Cached_Accept_Conn_Test.cpp index ae75d8a000b..87203880b43 100644 --- a/tests/Cached_Accept_Conn_Test.cpp +++ b/tests/Cached_Accept_Conn_Test.cpp @@ -55,6 +55,201 @@ #pragma warning(disable:4503) #endif /* _MSC_VER */ +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \ + defined (ACE_HAS_GNU_REPO) + // The explicit instantiations are necessary with g++ 2.91.66 + // with -frepo, because it misses some of them. + +// = Handle Gobbler +template class ACE_Node<ACE_HANDLE>; +template class ACE_Unbounded_Set<ACE_HANDLE>; +template class ACE_Unbounded_Set_Iterator<ACE_HANDLE>; + +template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; +template class ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr>; +template class ACE_NOOP_Creation_Strategy<Client_Svc_Handler>; +template class ACE_Concurrency_Strategy<Client_Svc_Handler>; +template class ACE_Connect_Strategy<Client_Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Connector<Client_Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Creation_Strategy<Client_Svc_Handler>; +template class ACE_Hash_Map_Entry<ADDR, Client_Svc_Handler *>; +template class ACE_Hash<ADDR>; +template class ACE_Equal_To<ADDR>; +template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *>; +template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_NOOP_Concurrency_Strategy<Client_Svc_Handler>; +template class ACE_Recycling_Strategy<Client_Svc_Handler>; +template class ACE_Strategy_Connector<Client_Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Svc_Tuple<Client_Svc_Handler>; + +template class ACE_Strategy_Acceptor<Server_Svc_Handler, ACE_SOCK_ACCEPTOR>; +template class Accept_Strategy<Server_Svc_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Acceptor<Server_Svc_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Accept_Strategy<Server_Svc_Handler, ACE_SOCK_ACCEPTOR>; +template class ACE_Creation_Strategy<Server_Svc_Handler>; +template class ACE_Concurrency_Strategy<Server_Svc_Handler>; +template class ACE_Scheduling_Strategy<Server_Svc_Handler>; + +template class ACE_Pair<Client_Svc_Handler *, ATTRIBUTES>; +template class ACE_Reference_Pair<ADDR, Client_Svc_Handler *>; +template class ACE_Hash_Map_Entry<ADDR, CACHED_HANDLER>; + +template class ACE_Hash_Map_Manager<ADDR, Client_Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<ADDR, Client_Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<ADDR, Client_Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; + +template class ACE_Hash_Map_Manager<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; + +// = Caching_Strategy +template class ACE_Hash_Cache_Map_Manager<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES>; + +template class ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; + +#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) + +template class ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; +template class ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; +template class ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; +template class ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; + +template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>; + +template class ACE_Cache_Map_Manager<ADDR, Client_Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; +template class ACE_Cache_Map_Iterator<ADDR, Client_Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; +template class ACE_Cache_Map_Reverse_Iterator<ADDR, Client_Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; + +#else + +template class ACE_Cache_Map_Manager<ADDR, Client_Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES>; + +#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ + +template class ACE_Cached_Connect_Strategy_Ex<Client_Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>; +template class ACE_Cached_Connect_Strategy<Client_Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>; + +template class ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>; +template class ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>; +template class ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES>; + +template class ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX>; +template class ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> >; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +// = Handle Gobbler +#pragma instantiate ACE_Node<ACE_HANDLE> +#pragma instantiate ACE_Unbounded_Set<ACE_HANDLE> +#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_HANDLE> + +#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> +#pragma instantiate ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> +#pragma instantiate ACE_NOOP_Creation_Strategy<Client_Svc_Handler> +#pragma instantiate ACE_Concurrency_Strategy<Client_Svc_Handler> +#pragma instantiate ACE_Connect_Strategy<Client_Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Connector<Client_Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Creation_Strategy<Client_Svc_Handler> +#pragma instantiate ACE_Hash_Map_Entry<ADDR, Client_Svc_Handler *> +#pragma instantiate ACE_Hash<ADDR> +#pragma instantiate ACE_Equal_To<ADDR> +#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *> +#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_NOOP_Concurrency_Strategy<Client_Svc_Handler> +#pragma instantiate ACE_Recycling_Strategy<Client_Svc_Handler> +#pragma instantiate ACE_Strategy_Connector<Client_Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Svc_Tuple<Client_Svc_Handler> + +#pragma instantiate ACE_Strategy_Acceptor<Server_Svc_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate Accept_Strategy<Server_Svc_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Acceptor<Server_Svc_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Accept_Strategy<Server_Svc_Handler, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Creation_Strategy<Server_Svc_Handler> +#pragma instantiate ACE_Concurrency_Strategy<Server_Svc_Handler> +#pragma instantiate ACE_Scheduling_Strategy<Server_Svc_Handler> + +#pragma instantiate ACE_Pair<Client_Svc_Handler *, ATTRIBUTES> +#pragma instantiate ACE_Reference_Pair<ADDR, Client_Svc_Handler *> +#pragma instantiate ACE_Hash_Map_Entry<ADDR, CACHED_HANDLER> + +#pragma instantiate ACE_Hash_Map_Manager<ADDR, Client_Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<ADDR, Client_Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, Client_Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> + +#pragma instantiate ACE_Hash_Map_Manager<ADDR, CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> + +// = Caching_Strategy +#pragma instantiate ACE_Hash_Cache_Map_Manager<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES> + +#pragma instantiate ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> + +#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) + +#pragma instantiate ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> +#pragma instantiate ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> +#pragma instantiate ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> +#pragma instantiate ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> + +#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY> + +#pragma instantiate ACE_Cache_Map_Manager<ADDR, Client_Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> +#pragma instantiate ACE_Cache_Map_Iterator<ADDR, Client_Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> +#pragma instantiate ACE_Cache_Map_Reverse_Iterator<ADDR, Client_Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> + +#else + +#pragma instantiate ACE_Cache_Map_Manager<ADDR, Client_Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES> + +#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ + +#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Client_Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX> +#pragma instantiate ACE_Cached_Connect_Strategy<Client_Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX> + +#pragma instantiate ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP> +#pragma instantiate ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP> +#pragma instantiate ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES> + +#pragma instantiate ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> +#pragma instantiate ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> > + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +#endif /* CACHED_CONNECT_TEST */ + ACE_RCSID(tests, Cached_Accept_Conn_Test, "$Id$") #if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 @@ -633,198 +828,3 @@ main (int argc, ACE_END_TEST; return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \ - defined (ACE_HAS_GNU_REPO) - // The explicit instantiations are necessary with g++ 2.91.66 - // with -frepo, because it misses some of them. - -// = Handle Gobbler -template class ACE_Node<ACE_HANDLE>; -template class ACE_Unbounded_Set<ACE_HANDLE>; -template class ACE_Unbounded_Set_Iterator<ACE_HANDLE>; - -template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -template class ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr>; -template class ACE_NOOP_Creation_Strategy<Client_Svc_Handler>; -template class ACE_Concurrency_Strategy<Client_Svc_Handler>; -template class ACE_Connect_Strategy<Client_Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Connector<Client_Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Creation_Strategy<Client_Svc_Handler>; -template class ACE_Hash_Map_Entry<ADDR, Client_Svc_Handler *>; -template class ACE_Hash<ADDR>; -template class ACE_Equal_To<ADDR>; -template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *>; -template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_NOOP_Concurrency_Strategy<Client_Svc_Handler>; -template class ACE_Recycling_Strategy<Client_Svc_Handler>; -template class ACE_Strategy_Connector<Client_Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Svc_Tuple<Client_Svc_Handler>; - -template class ACE_Strategy_Acceptor<Server_Svc_Handler, ACE_SOCK_ACCEPTOR>; -template class Accept_Strategy<Server_Svc_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Acceptor<Server_Svc_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Accept_Strategy<Server_Svc_Handler, ACE_SOCK_ACCEPTOR>; -template class ACE_Creation_Strategy<Server_Svc_Handler>; -template class ACE_Concurrency_Strategy<Server_Svc_Handler>; -template class ACE_Scheduling_Strategy<Server_Svc_Handler>; - -template class ACE_Pair<Client_Svc_Handler *, ATTRIBUTES>; -template class ACE_Reference_Pair<ADDR, Client_Svc_Handler *>; -template class ACE_Hash_Map_Entry<ADDR, CACHED_HANDLER>; - -template class ACE_Hash_Map_Manager<ADDR, Client_Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ADDR, Client_Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ADDR, Client_Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; - -template class ACE_Hash_Map_Manager<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; - -// = Caching_Strategy -template class ACE_Hash_Cache_Map_Manager<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES>; - -template class ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -template class ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; -template class ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; -template class ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; -template class ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; - -template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>; - -template class ACE_Cache_Map_Manager<ADDR, Client_Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; -template class ACE_Cache_Map_Iterator<ADDR, Client_Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; -template class ACE_Cache_Map_Reverse_Iterator<ADDR, Client_Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; - -#else - -template class ACE_Cache_Map_Manager<ADDR, Client_Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES>; - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -template class ACE_Cached_Connect_Strategy_Ex<Client_Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>; -template class ACE_Cached_Connect_Strategy<Client_Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>; - -template class ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>; -template class ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>; -template class ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES>; - -template class ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX>; -template class ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> >; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -// = Handle Gobbler -#pragma instantiate ACE_Node<ACE_HANDLE> -#pragma instantiate ACE_Unbounded_Set<ACE_HANDLE> -#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_HANDLE> - -#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> -#pragma instantiate ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> -#pragma instantiate ACE_NOOP_Creation_Strategy<Client_Svc_Handler> -#pragma instantiate ACE_Concurrency_Strategy<Client_Svc_Handler> -#pragma instantiate ACE_Connect_Strategy<Client_Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Connector<Client_Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Creation_Strategy<Client_Svc_Handler> -#pragma instantiate ACE_Hash_Map_Entry<ADDR, Client_Svc_Handler *> -#pragma instantiate ACE_Hash<ADDR> -#pragma instantiate ACE_Equal_To<ADDR> -#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *> -#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Client_Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_NOOP_Concurrency_Strategy<Client_Svc_Handler> -#pragma instantiate ACE_Recycling_Strategy<Client_Svc_Handler> -#pragma instantiate ACE_Strategy_Connector<Client_Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Svc_Tuple<Client_Svc_Handler> - -#pragma instantiate ACE_Strategy_Acceptor<Server_Svc_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate Accept_Strategy<Server_Svc_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Acceptor<Server_Svc_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Accept_Strategy<Server_Svc_Handler, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Creation_Strategy<Server_Svc_Handler> -#pragma instantiate ACE_Concurrency_Strategy<Server_Svc_Handler> -#pragma instantiate ACE_Scheduling_Strategy<Server_Svc_Handler> - -#pragma instantiate ACE_Pair<Client_Svc_Handler *, ATTRIBUTES> -#pragma instantiate ACE_Reference_Pair<ADDR, Client_Svc_Handler *> -#pragma instantiate ACE_Hash_Map_Entry<ADDR, CACHED_HANDLER> - -#pragma instantiate ACE_Hash_Map_Manager<ADDR, Client_Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<ADDR, Client_Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, Client_Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> - -#pragma instantiate ACE_Hash_Map_Manager<ADDR, CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> - -// = Caching_Strategy -#pragma instantiate ACE_Hash_Cache_Map_Manager<ADDR, Client_Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES> - -#pragma instantiate ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -#pragma instantiate ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> -#pragma instantiate ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> -#pragma instantiate ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> -#pragma instantiate ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> - -#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY> - -#pragma instantiate ACE_Cache_Map_Manager<ADDR, Client_Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> -#pragma instantiate ACE_Cache_Map_Iterator<ADDR, Client_Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> -#pragma instantiate ACE_Cache_Map_Reverse_Iterator<ADDR, Client_Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> - -#else - -#pragma instantiate ACE_Cache_Map_Manager<ADDR, Client_Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES> - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Client_Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX> -#pragma instantiate ACE_Cached_Connect_Strategy<Client_Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX> - -#pragma instantiate ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP> -#pragma instantiate ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP> -#pragma instantiate ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES> - -#pragma instantiate ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> -#pragma instantiate ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> > - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - -#endif /* CACHED_CONNECT_TEST */ diff --git a/tests/Cached_Conn_Test.cpp b/tests/Cached_Conn_Test.cpp index e87f13d9973..e6a8296660e 100644 --- a/tests/Cached_Conn_Test.cpp +++ b/tests/Cached_Conn_Test.cpp @@ -53,6 +53,187 @@ #pragma warning(disable:4503) #endif /* _MSC_VER */ +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \ + defined (ACE_HAS_GNU_REPO) + // The explicit instantiations are necessary with g++ 2.91.66 + // with -frepo, because it misses some of them. + +// = Handle Gobbler +template class ACE_Node<ACE_HANDLE>; +template class ACE_Unbounded_Set<ACE_HANDLE>; +template class ACE_Unbounded_Set_Iterator<ACE_HANDLE>; + +template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; +template class ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr>; +template class ACE_NOOP_Creation_Strategy<Svc_Handler>; +template class ACE_Concurrency_Strategy<Svc_Handler>; +template class ACE_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Creation_Strategy<Svc_Handler>; +template class ACE_Hash_Map_Entry<ADDR, Svc_Handler *>; +template class ACE_Hash<ADDR>; +template class ACE_Equal_To<ADDR>; +template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *>; +template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_NOOP_Concurrency_Strategy<Svc_Handler>; +template class ACE_Recycling_Strategy<Svc_Handler>; +template class ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Svc_Tuple<Svc_Handler>; +template class ACE_Oneshot_Acceptor<Svc_Handler, ACE_SOCK_ACCEPTOR>; + +template class ACE_Pair<Svc_Handler *, ATTRIBUTES>; +template class ACE_Reference_Pair<ADDR, Svc_Handler *>; +template class ACE_Hash_Map_Entry<ADDR, CACHED_HANDLER>; + +template class ACE_Hash_Map_Manager<ADDR, Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; + +template class ACE_Hash_Map_Manager<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; + +// = Caching_Strategy +template class ACE_Hash_Cache_Map_Manager<ADDR, Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES>; + +template class ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; + +#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) + +template class ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; +template class ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; +template class ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; +template class ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; + +template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>; +template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>; + +template class ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; +template class ACE_Cache_Map_Iterator<ADDR, Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; +template class ACE_Cache_Map_Reverse_Iterator<ADDR, Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; + +#else + +template class ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES>; + +#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ + +template class ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>; +template class ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>; + +template class ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>; +template class ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>; +template class ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES>; + +template class ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX>; +template class ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> >; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +// = Handle Gobbler +#pragma instantiate ACE_Node<ACE_HANDLE> +#pragma instantiate ACE_Unbounded_Set<ACE_HANDLE> +#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_HANDLE> + +#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> +#pragma instantiate ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> +#pragma instantiate ACE_NOOP_Creation_Strategy<Svc_Handler> +#pragma instantiate ACE_Concurrency_Strategy<Svc_Handler> +#pragma instantiate ACE_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Connector<Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Creation_Strategy<Svc_Handler> +#pragma instantiate ACE_Hash_Map_Entry<ADDR, Svc_Handler *> +#pragma instantiate ACE_Hash<ADDR> +#pragma instantiate ACE_Equal_To<ADDR> +#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *> +#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_NOOP_Concurrency_Strategy<Svc_Handler> +#pragma instantiate ACE_Recycling_Strategy<Svc_Handler> +#pragma instantiate ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Svc_Tuple<Svc_Handler> +#pragma instantiate ACE_Oneshot_Acceptor<Svc_Handler, ACE_SOCK_ACCEPTOR> + +#pragma instantiate ACE_Pair<Svc_Handler *, ATTRIBUTES> +#pragma instantiate ACE_Reference_Pair<ADDR, Svc_Handler *> +#pragma instantiate ACE_Hash_Map_Entry<ADDR, CACHED_HANDLER> + +#pragma instantiate ACE_Hash_Map_Manager<ADDR, Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> + +#pragma instantiate ACE_Hash_Map_Manager<ADDR, CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> + +// = Caching_Strategy +#pragma instantiate ACE_Hash_Cache_Map_Manager<ADDR, Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES> + +#pragma instantiate ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> + +#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) + +#pragma instantiate ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> +#pragma instantiate ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> +#pragma instantiate ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> +#pragma instantiate ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> + +#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY> +#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY> + +#pragma instantiate ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> +#pragma instantiate ACE_Cache_Map_Iterator<ADDR, Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> +#pragma instantiate ACE_Cache_Map_Reverse_Iterator<ADDR, Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> + +#else + +#pragma instantiate ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES> + +#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ + +#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX> +#pragma instantiate ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX> + +#pragma instantiate ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP> +#pragma instantiate ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP> +#pragma instantiate ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES> + +#pragma instantiate ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> +#pragma instantiate ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> > + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +#endif /* CACHED_CONNECT_TEST */ + ACE_RCSID(tests, Cached_Conn_Test, "$Id$") #if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 @@ -521,185 +702,3 @@ main (int argc, ACE_END_TEST; return 0; } - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \ - defined (ACE_HAS_GNU_REPO) - // The explicit instantiations are necessary with g++ 2.91.66 - // with -frepo, because it misses some of them. - -// = Handle Gobbler -template class ACE_Node<ACE_HANDLE>; -template class ACE_Unbounded_Set<ACE_HANDLE>; -template class ACE_Unbounded_Set_Iterator<ACE_HANDLE>; - -template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -template class ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr>; -template class ACE_NOOP_Creation_Strategy<Svc_Handler>; -template class ACE_Concurrency_Strategy<Svc_Handler>; -template class ACE_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Creation_Strategy<Svc_Handler>; -template class ACE_Hash_Map_Entry<ADDR, Svc_Handler *>; -template class ACE_Hash<ADDR>; -template class ACE_Equal_To<ADDR>; -template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *>; -template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_NOOP_Concurrency_Strategy<Svc_Handler>; -template class ACE_Recycling_Strategy<Svc_Handler>; -template class ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Svc_Tuple<Svc_Handler>; -template class ACE_Oneshot_Acceptor<Svc_Handler, ACE_SOCK_ACCEPTOR>; - -template class ACE_Pair<Svc_Handler *, ATTRIBUTES>; -template class ACE_Reference_Pair<ADDR, Svc_Handler *>; -template class ACE_Hash_Map_Entry<ADDR, CACHED_HANDLER>; - -template class ACE_Hash_Map_Manager<ADDR, Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; - -template class ACE_Hash_Map_Manager<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex>; - -// = Caching_Strategy -template class ACE_Hash_Cache_Map_Manager<ADDR, Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES>; - -template class ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -template class ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; -template class ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; -template class ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; -template class ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY>; - -template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY>; -template class ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY>; - -template class ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; -template class ACE_Cache_Map_Iterator<ADDR, Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; -template class ACE_Cache_Map_Reverse_Iterator<ADDR, Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES>; - -#else - -template class ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES>; - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -template class ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX>; -template class ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX>; - -template class ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>; -template class ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP>; -template class ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES>; - -template class ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX>; -template class ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> >; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -// = Handle Gobbler -#pragma instantiate ACE_Node<ACE_HANDLE> -#pragma instantiate ACE_Unbounded_Set<ACE_HANDLE> -#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_HANDLE> - -#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> -#pragma instantiate ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> -#pragma instantiate ACE_NOOP_Creation_Strategy<Svc_Handler> -#pragma instantiate ACE_Concurrency_Strategy<Svc_Handler> -#pragma instantiate ACE_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Connector<Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Creation_Strategy<Svc_Handler> -#pragma instantiate ACE_Hash_Map_Entry<ADDR, Svc_Handler *> -#pragma instantiate ACE_Hash<ADDR> -#pragma instantiate ACE_Equal_To<ADDR> -#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *> -#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_NOOP_Concurrency_Strategy<Svc_Handler> -#pragma instantiate ACE_Recycling_Strategy<Svc_Handler> -#pragma instantiate ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Svc_Tuple<Svc_Handler> -#pragma instantiate ACE_Oneshot_Acceptor<Svc_Handler, ACE_SOCK_ACCEPTOR> - -#pragma instantiate ACE_Pair<Svc_Handler *, ATTRIBUTES> -#pragma instantiate ACE_Reference_Pair<ADDR, Svc_Handler *> -#pragma instantiate ACE_Hash_Map_Entry<ADDR, CACHED_HANDLER> - -#pragma instantiate ACE_Hash_Map_Manager<ADDR, Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> - -#pragma instantiate ACE_Hash_Map_Manager<ADDR, CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<ADDR, CACHED_HANDLER, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<ADDR, CACHED_HANDLER, H_KEY, C_KEYS, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<ADDR, Svc_Handler *, H_KEY, C_KEYS, ACE_Null_Mutex> - -// = Caching_Strategy -#pragma instantiate ACE_Hash_Cache_Map_Manager<ADDR, Svc_Handler *, H_KEY, C_KEYS, CACHING_STRATEGY, ATTRIBUTES> - -#pragma instantiate ACE_LRU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> - -#if !defined (ACE_HAS_BROKEN_EXTENDED_TEMPLATES) - -#pragma instantiate ACE_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> -#pragma instantiate ACE_LFU_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> -#pragma instantiate ACE_FIFO_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> -#pragma instantiate ACE_Null_Caching_Strategy<ATTRIBUTES, CACHING_UTILITY> - -#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LRU_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, LFU_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, FIFO_CACHING_STRATEGY> -#pragma instantiate ACE_Caching_Strategy_Adapter<ATTRIBUTES, CACHING_UTILITY, NULL_CACHING_STRATEGY> - -#pragma instantiate ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, HASH_MAP_ITERATOR, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> -#pragma instantiate ACE_Cache_Map_Iterator<ADDR, Svc_Handler *, HASH_MAP_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> -#pragma instantiate ACE_Cache_Map_Reverse_Iterator<ADDR, Svc_Handler *, HASH_MAP_REVERSE_ITERATOR, CACHING_STRATEGY, ATTRIBUTES> - -#else - -#pragma instantiate ACE_Cache_Map_Manager<ADDR, Svc_Handler *, HASH_MAP, CACHING_STRATEGY, ATTRIBUTES> - -#endif /* ACE_HAS_BROKEN_EXTENDED_TEMPLATES */ - -#pragma instantiate ACE_Cached_Connect_Strategy_Ex<Svc_Handler, ACE_SOCK_CONNECTOR, CACHING_STRATEGY, ATTRIBUTES, ACE_SYNCH_NULL_MUTEX> -#pragma instantiate ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_NULL_MUTEX> - -#pragma instantiate ACE_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP> -#pragma instantiate ACE_Recyclable_Handler_Cleanup_Strategy<ADDR, CACHED_HANDLER, HASH_MAP> -#pragma instantiate ACE_Recyclable_Handler_Caching_Utility<ADDR, CACHED_HANDLER, HASH_MAP, HASH_MAP_ITERATOR, ATTRIBUTES> - -#pragma instantiate ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> -#pragma instantiate ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_NULL_MUTEX> > - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - -#endif /* CACHED_CONNECT_TEST */ diff --git a/tests/Conn_Test.cpp b/tests/Conn_Test.cpp index 8f5b88a0b02..5e073b3e865 100644 --- a/tests/Conn_Test.cpp +++ b/tests/Conn_Test.cpp @@ -17,7 +17,9 @@ // cache connections on the client. // // = AUTHOR -// Doug Schmidt, Chris Cleeland, and Irfan Pyarali +// Douglas C. Schmidt <schmidt@cs.wustl.edu>, +// Chris Cleeland <cleeland@cs.wustl.edu>, +// and Irfan Pyarali <irfan@cs.wustl.edu> // // ============================================================================ @@ -34,6 +36,123 @@ ACE_RCSID(tests, Conn_Test, "$Id$") +#define CACHED_CONNECT_STRATEGY ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_MUTEX> +#define REFCOUNTED_HASH_RECYCLABLE_ADDR ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class CACHED_CONNECT_STRATEGY; +template class REFCOUNTED_HASH_RECYCLABLE_ADDR; +template class ACE_NOOP_Creation_Strategy<Svc_Handler>; +template class ACE_Concurrency_Strategy<Svc_Handler>; +template class ACE_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Creation_Strategy<Svc_Handler>; +template class ACE_Hash_Map_Entry<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *>; +template class ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>; +template class ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>; + +template class ACE_Reverse_Lock<ACE_SYNCH_MUTEX>; +template class ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_MUTEX> >; + +#if defined (ACE_HAS_THREADS) +template class ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; +#endif /* ACE_HAS_THREADS */ + +template class ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; +template class ACE_LOCK_SOCK_Acceptor<ACCEPTOR_LOCKING>; +template class ACE_Oneshot_Acceptor<Svc_Handler, LOCK_SOCK_ACCEPTOR>; +template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *>; +template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; +template class ACE_NOOP_Concurrency_Strategy<Svc_Handler>; +template class ACE_Recycling_Strategy<Svc_Handler>; +template class ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; +template class ACE_Svc_Tuple<Svc_Handler>; +template class ACE_Auto_Basic_Array_Ptr<pid_t>; + +#if defined (__BORLANDC__) +// Borland C++ doesn't link with these instantiations in the ACE library. +template class ACE_Double_Linked_List<ACE_Thread_Descriptor>; +template class ACE_Unbounded_Queue<ACE_Thread_Descriptor_Base>; +template class ACE_Unbounded_Queue<ACE_Thread_Descriptor*>; +#endif /* defined (__BORLANDC__) */ + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate CACHED_CONNECT_STRATEGY +#pragma instantiate REFCOUNTED_HASH_RECYCLABLE_ADDR +#pragma instantiate ACE_NOOP_Creation_Strategy<Svc_Handler> +#pragma instantiate ACE_Concurrency_Strategy<Svc_Handler> +#pragma instantiate ACE_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Connector<Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Creation_Strategy<Svc_Handler> +#pragma instantiate ACE_Hash_Map_Entry<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *> +#pragma instantiate ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR> +#pragma instantiate ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR> + +#pragma instantiate ACE_Reverse_Lock<ACE_SYNCH_MUTEX> +#pragma instantiate ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_MUTEX> > + +#if defined (ACE_HAS_THREADS) +#pragma instantiate ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> +#endif /* ACE_HAS_THREADS */ + +#pragma instantiate ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_LOCK_SOCK_Acceptor<ACCEPTOR_LOCKING> +#pragma instantiate ACE_Oneshot_Acceptor<Svc_Handler, LOCK_SOCK_ACCEPTOR> +#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *> +#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> +#pragma instantiate ACE_NOOP_Concurrency_Strategy<Svc_Handler> +#pragma instantiate ACE_Recycling_Strategy<Svc_Handler> +#pragma instantiate ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> +#pragma instantiate ACE_Svc_Tuple<Svc_Handler> +#pragma instantiate ACE_Auto_Basic_Array_Ptr<pid_t> + +#if defined (__BORLANDC__) +// Borland C++ doesn't link with these instantiations in the ACE library. +#pragma instantiate ACE_Double_Linked_List<ACE_Thread_Descriptor> +#pragma instantiate ACE_Unbounded_Queue<ACE_Thread_Descriptor_Base> +#pragma instantiate ACE_Unbounded_Queue<ACE_Thread_Descriptor*> +#endif /* defined (__BORLANDC__) */ + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + #if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 USELIB("..\ace\aced.lib"); //--------------------------------------------------------------------------- @@ -749,120 +868,3 @@ main (int argc, ASYS_TCHAR *argv[]) ACE_END_TEST; return status; } - -#define CACHED_CONNECT_STRATEGY ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_MUTEX> -#define REFCOUNTED_HASH_RECYCLABLE_ADDR ACE_Refcounted_Hash_Recyclable<ACE_INET_Addr> - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class CACHED_CONNECT_STRATEGY; -template class REFCOUNTED_HASH_RECYCLABLE_ADDR; -template class ACE_NOOP_Creation_Strategy<Svc_Handler>; -template class ACE_Concurrency_Strategy<Svc_Handler>; -template class ACE_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Creation_Strategy<Svc_Handler>; -template class ACE_Hash_Map_Entry<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *>; -template class ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>; -template class ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>; - -template class ACE_Reverse_Lock<ACE_SYNCH_MUTEX>; -template class ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_MUTEX> >; - -#if defined (ACE_HAS_THREADS) -template class ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex>; -#endif /* ACE_HAS_THREADS */ - -template class ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX>; -template class ACE_LOCK_SOCK_Acceptor<ACCEPTOR_LOCKING>; -template class ACE_Oneshot_Acceptor<Svc_Handler, LOCK_SOCK_ACCEPTOR>; -template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *>; -template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX>; -template class ACE_NOOP_Concurrency_Strategy<Svc_Handler>; -template class ACE_Recycling_Strategy<Svc_Handler>; -template class ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; -template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -template class ACE_Svc_Tuple<Svc_Handler>; -template class ACE_Auto_Basic_Array_Ptr<pid_t>; - -#if defined (__BORLANDC__) -// Borland C++ doesn't link with these instantiations in the ACE library. -template class ACE_Double_Linked_List<ACE_Thread_Descriptor>; -template class ACE_Unbounded_Queue<ACE_Thread_Descriptor_Base>; -template class ACE_Unbounded_Queue<ACE_Thread_Descriptor*>; -#endif /* defined (__BORLANDC__) */ - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -#pragma instantiate CACHED_CONNECT_STRATEGY -#pragma instantiate REFCOUNTED_HASH_RECYCLABLE_ADDR -#pragma instantiate ACE_NOOP_Creation_Strategy<Svc_Handler> -#pragma instantiate ACE_Concurrency_Strategy<Svc_Handler> -#pragma instantiate ACE_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Connector<Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Creation_Strategy<Svc_Handler> -#pragma instantiate ACE_Hash_Map_Entry<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *> -#pragma instantiate ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR> -#pragma instantiate ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR> - -#pragma instantiate ACE_Reverse_Lock<ACE_SYNCH_MUTEX> -#pragma instantiate ACE_Guard<ACE_Reverse_Lock<ACE_SYNCH_MUTEX> > - -#if defined (ACE_HAS_THREADS) -#pragma instantiate ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Null_Mutex> -#endif /* ACE_HAS_THREADS */ - -#pragma instantiate ACE_Hash_Map_Manager<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Manager_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Bucket_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<REFCOUNTED_HASH_RECYCLABLE_ADDR, Svc_Handler *, ACE_Hash<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_Equal_To<REFCOUNTED_HASH_RECYCLABLE_ADDR>, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_LOCK_SOCK_Acceptor<ACCEPTOR_LOCKING> -#pragma instantiate ACE_Oneshot_Acceptor<Svc_Handler, LOCK_SOCK_ACCEPTOR> -#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *> -#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Svc_Handler> *, ACE_SYNCH_RW_MUTEX> -#pragma instantiate ACE_NOOP_Concurrency_Strategy<Svc_Handler> -#pragma instantiate ACE_Recycling_Strategy<Svc_Handler> -#pragma instantiate ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR> -#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> -#pragma instantiate ACE_Svc_Tuple<Svc_Handler> -#pragma instantiate ACE_Auto_Basic_Array_Ptr<pid_t> - -#if defined (__BORLANDC__) -// Borland C++ doesn't link with these instantiations in the ACE library. -#pragma instantiate ACE_Double_Linked_List<ACE_Thread_Descriptor> -#pragma instantiate ACE_Unbounded_Queue<ACE_Thread_Descriptor_Base> -#pragma instantiate ACE_Unbounded_Queue<ACE_Thread_Descriptor*> -#endif /* defined (__BORLANDC__) */ - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/tests/DLList_Test.cpp b/tests/DLList_Test.cpp index e018d3307d0..9da8e645b8d 100644 --- a/tests/DLList_Test.cpp +++ b/tests/DLList_Test.cpp @@ -21,6 +21,18 @@ #include "ace/SString.h" #include "ace/Malloc.h" +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_DLList<STRING>; +template class ACE_DLList_Iterator<STRING>; +template class ACE_DLList_Reverse_Iterator<STRING>; +template class ACE_Static_Allocator<8192>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_DLList<STRING> +#pragma instantiate ACE_DLList_Iterator<STRING> +#pragma instantiate ACE_DLList_Reverse_Iterator<STRING> +#pragma instantiate ACE_Static_Allocator<8192> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + #if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 USELIB("..\ace\aced.lib"); //--------------------------------------------------------------------------- @@ -116,15 +128,3 @@ main (int, ASYS_TCHAR *[]) return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_DLList<STRING>; -template class ACE_DLList_Iterator<STRING>; -template class ACE_DLList_Reverse_Iterator<STRING>; -template class ACE_Static_Allocator<8192>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_DLList<STRING> -#pragma instantiate ACE_DLList_Iterator<STRING> -#pragma instantiate ACE_DLList_Reverse_Iterator<STRING> -#pragma instantiate ACE_Static_Allocator<8192> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/tests/Hash_Map_Manager_Test.cpp b/tests/Hash_Map_Manager_Test.cpp index e320f910072..2d2428d5086 100644 --- a/tests/Hash_Map_Manager_Test.cpp +++ b/tests/Hash_Map_Manager_Test.cpp @@ -27,6 +27,22 @@ ACE_RCSID(tests, Hash_Map_Manager_Test, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Hash_Map_Entry<LPCTSTR, LPCTSTR>; +template class ACE_Hash_Map_Manager_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Base_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; +template class ACE_Hash_Map_Reverse_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; +template class ACE_Static_Allocator<String_Table_size>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Hash_Map_Entry<LPCTSTR, LPCTSTR> +#pragma instantiate ACE_Hash_Map_Manager_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> +#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> +#pragma instantiate ACE_Static_Allocator<String_Table_size> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + #if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 USELIB("..\ace\aced.lib"); //--------------------------------------------------------------------------- @@ -204,19 +220,3 @@ main (int, ASYS_TCHAR *[]) return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Hash_Map_Entry<LPCTSTR, LPCTSTR>; -template class ACE_Hash_Map_Manager_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Reverse_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex>; -template class ACE_Static_Allocator<String_Table_size>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Hash_Map_Entry<LPCTSTR, LPCTSTR> -#pragma instantiate ACE_Hash_Map_Manager_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> -#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<LPCTSTR, LPCTSTR, ACE_Hash<LPCTSTR>, ACE_Equal_To<LPCTSTR>, ACE_Null_Mutex> -#pragma instantiate ACE_Static_Allocator<String_Table_size> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/tests/Process_Strategy_Test.cpp b/tests/Process_Strategy_Test.cpp index 5158987717b..5c35c514979 100644 --- a/tests/Process_Strategy_Test.cpp +++ b/tests/Process_Strategy_Test.cpp @@ -50,6 +50,38 @@ ACE_RCSID(tests, Process_Strategy_Test, "$Id$") +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Accept_Strategy<Counting_Service, ACE_SOCK_ACCEPTOR>; +template class ACE_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR>; +template class ACE_Creation_Strategy<Counting_Service>; +template class ACE_Concurrency_Strategy<Counting_Service>; +template class ACE_Guard<ACE_File_Lock>; +template class ACE_Singleton<Options, ACE_Null_Mutex>; +template class ACE_Process_Strategy<Counting_Service>; +template class ACE_Thread_Strategy<Counting_Service>; +template class ACE_Reactive_Strategy<Counting_Service>; +template class ACE_Read_Guard<ACE_File_Lock>; +template class ACE_Scheduling_Strategy<Counting_Service>; +template class ACE_Strategy_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR>; +template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; +template class ACE_Write_Guard<ACE_File_Lock>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Accept_Strategy<Counting_Service, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Creation_Strategy<Counting_Service> +#pragma instantiate ACE_Concurrency_Strategy<Counting_Service> +#pragma instantiate ACE_Guard<ACE_File_Lock> +#pragma instantiate ACE_Singleton<Options, ACE_Null_Mutex> +#pragma instantiate ACE_Process_Strategy<Counting_Service> +#pragma instantiate ACE_Thread_Strategy<Counting_Service> +#pragma instantiate ACE_Reactive_Strategy<Counting_Service> +#pragma instantiate ACE_Read_Guard<ACE_File_Lock> +#pragma instantiate ACE_Scheduling_Strategy<Counting_Service> +#pragma instantiate ACE_Strategy_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR> +#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> +#pragma instantiate ACE_Write_Guard<ACE_File_Lock> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + #if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 USELIB("..\ace\aced.lib"); //--------------------------------------------------------------------------- @@ -681,35 +713,3 @@ main (int argc, ASYS_TCHAR *argv[]) ACE_END_TEST; return 0; } - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Accept_Strategy<Counting_Service, ACE_SOCK_ACCEPTOR>; -template class ACE_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR>; -template class ACE_Creation_Strategy<Counting_Service>; -template class ACE_Concurrency_Strategy<Counting_Service>; -template class ACE_Guard<ACE_File_Lock>; -template class ACE_Singleton<Options, ACE_Null_Mutex>; -template class ACE_Process_Strategy<Counting_Service>; -template class ACE_Thread_Strategy<Counting_Service>; -template class ACE_Reactive_Strategy<Counting_Service>; -template class ACE_Read_Guard<ACE_File_Lock>; -template class ACE_Scheduling_Strategy<Counting_Service>; -template class ACE_Strategy_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR>; -template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; -template class ACE_Write_Guard<ACE_File_Lock>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Accept_Strategy<Counting_Service, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Creation_Strategy<Counting_Service> -#pragma instantiate ACE_Concurrency_Strategy<Counting_Service> -#pragma instantiate ACE_Guard<ACE_File_Lock> -#pragma instantiate ACE_Singleton<Options, ACE_Null_Mutex> -#pragma instantiate ACE_Process_Strategy<Counting_Service> -#pragma instantiate ACE_Thread_Strategy<Counting_Service> -#pragma instantiate ACE_Reactive_Strategy<Counting_Service> -#pragma instantiate ACE_Read_Guard<ACE_File_Lock> -#pragma instantiate ACE_Scheduling_Strategy<Counting_Service> -#pragma instantiate ACE_Strategy_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR> -#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> -#pragma instantiate ACE_Write_Guard<ACE_File_Lock> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ |