summaryrefslogtreecommitdiff
path: root/examples/Timer_Queue
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-10-21 07:23:14 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-10-21 07:23:14 +0000
commit82c58df7938338a98a3f969f33514686fb4cd153 (patch)
tree7d4427015d69cf467c602e5e2a687ff7dffc3dd5 /examples/Timer_Queue
parent592229ff4c3222c057aa6f0f5e0112456fda3afd (diff)
downloadATCD-82c58df7938338a98a3f969f33514686fb4cd153.tar.gz
*** empty log message ***
Diffstat (limited to 'examples/Timer_Queue')
-rw-r--r--examples/Timer_Queue/Async_Timer_Queue_Test.cpp6
-rw-r--r--examples/Timer_Queue/Driver.cpp10
-rw-r--r--examples/Timer_Queue/Driver.h21
-rw-r--r--examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp5
-rw-r--r--examples/Timer_Queue/Thread_Timer_Queue_Test.cpp26
-rw-r--r--examples/Timer_Queue/main_async.cpp10
-rw-r--r--examples/Timer_Queue/main_reactor.cpp8
-rw-r--r--examples/Timer_Queue/main_thread.cpp5
8 files changed, 61 insertions, 30 deletions
diff --git a/examples/Timer_Queue/Async_Timer_Queue_Test.cpp b/examples/Timer_Queue/Async_Timer_Queue_Test.cpp
index 4979cd4b537..b1af85d4d51 100644
--- a/examples/Timer_Queue/Async_Timer_Queue_Test.cpp
+++ b/examples/Timer_Queue/Async_Timer_Queue_Test.cpp
@@ -286,6 +286,8 @@ Async_Timer_Queue_Test_Driver::init (void)
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Async_Timer_Queue_Adapter<ACE_Timer_Heap>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate 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>;
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/Timer_Queue/Driver.cpp b/examples/Timer_Queue/Driver.cpp
index 621424d3b3f..9d4182050bd 100644
--- a/examples/Timer_Queue/Driver.cpp
+++ b/examples/Timer_Queue/Driver.cpp
@@ -1,3 +1,5 @@
+// $Id$
+
// ============================================================================
// = LIBRARY
// examples
@@ -15,6 +17,9 @@
//
// ============================================================================
+#if !defined (_DRIVER_CPP_)
+#define _DRIVER_CPP_
+
#include "ace/Auto_Ptr.h"
#include "Driver.h"
@@ -25,7 +30,8 @@ Command<RECEIVER, ACTION>::Command (RECEIVER &recvr,
ACTION action)
: receiver_ (recvr),
action_ (action)
-{}
+{
+}
// invokes an operation.
@@ -35,7 +41,6 @@ Command<RECEIVER, ACTION>::execute (void *arg)
return (receiver_.*action_) (arg);
}
-
// gets the next request from the user input.
template <class TQ, class RECEIVER, class ACTION> int
@@ -140,3 +145,4 @@ Timer_Queue_Test_Driver<TQ, RECEIVER, ACTION>::parse_commands (const char *buf)
return 0;
}
+#endif /* _DRIVER_CPP_ */
diff --git a/examples/Timer_Queue/Driver.h b/examples/Timer_Queue/Driver.h
index 34f3645c930..3abaf97377c 100644
--- a/examples/Timer_Queue/Driver.h
+++ b/examples/Timer_Queue/Driver.h
@@ -26,19 +26,6 @@
#include "ace/Timer_Heap_T.h"
#include "ace/Timer_Queue_Adapters.h"
-typedef ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>
- Upcall;
-typedef ACE_Timer_Heap_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>,
- ACE_Null_Mutex>
- Timer_Heap;
-typedef ACE_Timer_Heap_Iterator_T<ACE_Event_Handler *,
- ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex>,
- ACE_Null_Mutex>
- Timer_Heap_Iterator;
-typedef ACE_Thread_Timer_Queue_Adapter<Timer_Heap>
- Thread_Timer_Queue;
-
template <class RECEIVER, class ACTION>
class Command
// = TITLE
@@ -129,4 +116,12 @@ protected:
// shutdown the driver.
};
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "Driver.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Driver.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
#endif /* _DRIVER_H_ */
diff --git a/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp b/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp
index ad444ee3f0a..6e73ae5a6e5 100644
--- a/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp
+++ b/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp
@@ -206,3 +206,8 @@ Reactor_Timer_Queue_Test_Driver::run_test (void)
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>;
+#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 838b4f01681..47091d5c11c 100644
--- a/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp
+++ b/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp
@@ -84,7 +84,7 @@ int
Input_Task::svc (void)
{
for (;;)
- // call bacck to the driver's implementation on how to read and parse input.
+ // call back to the driver's implementation on how to read and parse input.
if (this->driver_.get_next_request () == -1)
break;
@@ -143,16 +143,16 @@ Input_Task::list_timer (void *argument)
// Thread cancellation point, if ACE supports it.
#if !defined (ACE_LACKS_PTHREAD_CANCEL)
- ACE_PTHREAD_CLEANUP_PUSH(&this->queue_->lock ());
-#endif
+ ACE_PTHREAD_CLEANUP_PUSH (&this->queue_->lock ());
+#endif /* ACE_LACKS_PTHREAD_CANCEL */
- // dump the timer queue contents.
+ // Dump the timer queue contents.
this->dump ();
// Thread cancellation point (POP)
#if !defined (ACE_LACKS_PTHREAD_CANCEL)
- ACE_PTHREAD_CLEANUP_POP(1);
-#endif
+ ACE_PTHREAD_CLEANUP_POP (1);
+#endif /* ACE_LACKS_PTHREAD_CANCEL */
return 0;
}
@@ -250,17 +250,23 @@ Thread_Timer_Queue_Test_Driver::init (void)
#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>;
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-#if !defined(ACE_MT_SAFE)
-
-// These templates will specialized in liACE.* if the platforms does
+#if defined (ACE_MT_SAFE)
+// 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>;
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
#endif /* ACE_MT_SAFE */
diff --git a/examples/Timer_Queue/main_async.cpp b/examples/Timer_Queue/main_async.cpp
index 9c46e4293c2..6ac013feab4 100644
--- a/examples/Timer_Queue/main_async.cpp
+++ b/examples/Timer_Queue/main_async.cpp
@@ -23,9 +23,9 @@
#include "Driver.h"
#include "Async_Timer_Queue_Test.h"
-typedef Timer_Queue_Test_Driver<Async_Timer_Queue*,
- Async_Timer_Queue,
- Async_Timer_Queue::ACTION>
+typedef Timer_Queue_Test_Driver<Async_Timer_Queue *,
+ Async_Timer_Queue,
+ Async_Timer_Queue::ACTION>
ASYNC_TIMER_QUEUE_TEST_DRIVER;
int
@@ -42,5 +42,9 @@ main (int, char *[])
return driver->run_test ();
}
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+template class auto_ptr <ASYNC_TIMER_QUEUE_TEST_DRIVER>;
+template class ACE_Auto_Basic_Ptr <ASYNC_TIMER_QUEUE_TEST_DRIVER>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/Timer_Queue/main_reactor.cpp b/examples/Timer_Queue/main_reactor.cpp
index cf5584e968d..03ab1e39128 100644
--- a/examples/Timer_Queue/main_reactor.cpp
+++ b/examples/Timer_Queue/main_reactor.cpp
@@ -41,3 +41,11 @@ main (int, char *[])
return driver->run_test ();
}
+
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+template class auto_ptr <REACTOR_TIMER_QUEUE_TEST_DRIVER>;
+template class ACE_Auto_Basic_Ptr <REACTOR_TIMER_QUEUE_TEST_DRIVER>;
+template class Timer_Queue_Test_Driver<ACE_Timer_Heap *,
+ Input_Handler,
+ Input_Handler::ACTION>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/examples/Timer_Queue/main_thread.cpp b/examples/Timer_Queue/main_thread.cpp
index b72f0fe7088..e54ae0f3a0e 100644
--- a/examples/Timer_Queue/main_thread.cpp
+++ b/examples/Timer_Queue/main_thread.cpp
@@ -41,3 +41,8 @@ main (int, char *[])
return driver->run_test ();
}
+
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+template class auto_ptr <THREAD_TIMER_QUEUE_TEST_DRIVER>;
+template class ACE_Auto_Basic_Ptr <THREAD_TIMER_QUEUE_TEST_DRIVER>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */