aboutsummaryrefslogtreecommitdiff
path: root/dep/acelite/ace/Task_T.h
diff options
context:
space:
mode:
Diffstat (limited to 'dep/acelite/ace/Task_T.h')
-rw-r--r--dep/acelite/ace/Task_T.h40
1 files changed, 24 insertions, 16 deletions
diff --git a/dep/acelite/ace/Task_T.h b/dep/acelite/ace/Task_T.h
index 1946f45cfe5..9b0cd9e2c6f 100644
--- a/dep/acelite/ace/Task_T.h
+++ b/dep/acelite/ace/Task_T.h
@@ -4,7 +4,7 @@
/**
* @file Task_T.h
*
- * $Id: Task_T.h 91688 2010-09-09 11:21:50Z johnnyw $
+ * $Id: Task_T.h 96061 2012-08-16 09:36:07Z mcorino $
*
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
@@ -27,7 +27,7 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Forward decls...
-template <ACE_SYNCH_DECL> class ACE_Module;
+template <ACE_SYNCH_DECL, class TIME_POLICY> class ACE_Module;
/**
* @class ACE_Task
@@ -38,11 +38,11 @@ template <ACE_SYNCH_DECL> class ACE_Module;
* This class serves as the basis for passive and active objects
* in ACE.
*/
-template <ACE_SYNCH_DECL>
+template <ACE_SYNCH_DECL, class TIME_POLICY = ACE_System_Time_Policy>
class ACE_Task : public ACE_Task_Base
{
public:
- friend class ACE_Module<ACE_SYNCH_USE>;
+ friend class ACE_Module<ACE_SYNCH_USE, TIME_POLICY>;
friend class ACE_Module_Type;
// = Initialization/termination methods.
@@ -53,16 +53,24 @@ public:
* one passed as a parameter.
*/
ACE_Task (ACE_Thread_Manager *thr_mgr = 0,
- ACE_Message_Queue<ACE_SYNCH_USE> *mq = 0);
+ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *mq = 0);
/// Destructor.
virtual ~ACE_Task (void);
/// Gets the message queue associated with this task.
- ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue (void);
+ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *msg_queue (void);
/// Sets the message queue associated with this task.
- void msg_queue (ACE_Message_Queue<ACE_SYNCH_USE> *);
+ void msg_queue (ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *);
+
+ /// Get the current time of day according to the queue's TIME_POLICY.
+ /// Allows users to initialize timeout values using correct time policy.
+ ACE_Time_Value_T<TIME_POLICY> gettimeofday (void) const;
+
+ /// Allows applications to control how the timer queue gets the time
+ /// of day.
+ void set_time_policy (TIME_POLICY const & time_policy);
public: // Should be protected:
// = Message queue manipulation methods.
@@ -118,17 +126,17 @@ public: // Should be protected:
// = Pointers to next ACE_Task_Base (if ACE is part of an ACE_Stream).
/// Get next Task pointer.
- ACE_Task<ACE_SYNCH_USE> *next (void);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *next (void);
/// Set next Task pointer.
- void next (ACE_Task<ACE_SYNCH_USE> *);
+ void next (ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *);
/// Return the Task's sibling if there's one associated with the
/// Task's Module, else returns 0.
- ACE_Task<ACE_SYNCH_USE> *sibling (void);
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *sibling (void);
/// Return the Task's Module if there is one, else returns 0.
- ACE_Module<ACE_SYNCH_USE> *module (void) const;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *module (void) const;
/**
* Flush the task's queue, i.e., free all of the enqueued
@@ -144,16 +152,16 @@ public: // Should be protected:
void water_marks (ACE_IO_Cntl_Msg::ACE_IO_Cntl_Cmds, size_t);
/// Queue of messages on the ACE_Task..
- ACE_Message_Queue<ACE_SYNCH_USE> *msg_queue_;
+ ACE_Message_Queue<ACE_SYNCH_USE, TIME_POLICY> *msg_queue_;
/// true if should delete Message_Queue, false otherwise.
bool delete_msg_queue_;
/// Back-pointer to the enclosing module.
- ACE_Module<ACE_SYNCH_USE> *mod_;
+ ACE_Module<ACE_SYNCH_USE, TIME_POLICY> *mod_;
/// Pointer to adjacent ACE_Task.
- ACE_Task<ACE_SYNCH_USE> *next_;
+ ACE_Task<ACE_SYNCH_USE, TIME_POLICY> *next_;
/// Dump the state of an object.
void dump (void) const;
@@ -164,8 +172,8 @@ public: // Should be protected:
private:
// = Disallow these operations.
- ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Task<ACE_SYNCH_USE> &))
- ACE_UNIMPLEMENTED_FUNC (ACE_Task (const ACE_Task<ACE_SYNCH_USE> &))
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Task<ACE_SYNCH_USE, TIME_POLICY> &))
+ ACE_UNIMPLEMENTED_FUNC (ACE_Task (const ACE_Task<ACE_SYNCH_USE, TIME_POLICY> &))
};
#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT