Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / Kokyu / DSRT_Dispatch_Item_T.h
blobd719f5ec8ff48b1577e069814095f57d389e70ee
1 /* -*- C++ -*- */
2 /**
3 * @file DSRT_Dispatch_Item_T.h
5 * @author Venkita Subramonian (venkita@cs.wustl.edu)
6 */
8 #ifndef DSRT_DISPATCH_ITEM_H
9 #define DSRT_DISPATCH_ITEM_H
10 #include /**/ "ace/pre.h"
11 #include "ace/Bound_Ptr.h"
12 #include "ace/Copy_Disabled.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "Kokyu_dsrt.h"
20 namespace Kokyu
22 /**
23 * @class DSRT_Dispatch_Item
25 * @brief This stores information about a schedulable thread.
28 template <class DSRT_Scheduler_Traits>
29 class DSRT_Dispatch_Item : private ACE_Copy_Disabled
31 typedef typename
32 DSRT_Scheduler_Traits::Guid_t Guid_t;
34 typedef typename
35 DSRT_Scheduler_Traits::QoSDescriptor_t DSRT_QoSDescriptor;
37 protected:
38 ACE_hthread_t thr_handle_;
39 Guid_t guid_;
40 DSRT_QoSDescriptor qos_;
41 ACE_Time_Value insertion_time_;
43 public:
44 DSRT_Dispatch_Item (Guid_t guid, const DSRT_QoSDescriptor&);
46 /// Get the guid.
47 Guid_t guid ();
49 /// Get the associated qos value.
50 DSRT_QoSDescriptor qos ();
52 /// Get the thread handle.
53 ACE_hthread_t thread_handle ();
55 /// Set the thread handle.
56 void thread_handle (ACE_hthread_t &handle);
58 /// Get the insertion time.
59 ACE_Time_Value insertion_time ();
61 /// Set the insertion time.
62 void insertion_time (const ACE_Time_Value&);
65 /**
66 * @class DSRT_Dispatch_Item_var
68 * @brief Smart pointer to dynamically allocated <code>
69 * DSRT_Dispatch_Item </code> objects.
71 template <class DSRT_Scheduler_Traits>
72 class DSRT_Dispatch_Item_var :
73 public ACE_Strong_Bound_Ptr<
74 DSRT_Dispatch_Item<DSRT_Scheduler_Traits>,
75 ACE_SYNCH_MUTEX>
77 public:
78 explicit
79 DSRT_Dispatch_Item_var (DSRT_Dispatch_Item<DSRT_Scheduler_Traits>
80 *p = 0);
82 DSRT_Dispatch_Item_var (
83 const DSRT_Dispatch_Item_var<DSRT_Scheduler_Traits> &r);
87 #if defined (__ACE_INLINE__)
88 #include "DSRT_Dispatch_Item_T.inl"
89 #endif /* __ACE_INLINE__ */
91 #include "DSRT_Dispatch_Item_T.cpp"
93 #include /**/ "ace/post.h"
94 #endif /* DSRT_DISPATCH_ITEM_H */