3 //==========================================================================
9 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
11 //==========================================================================
15 #include /**/ "ace/pre.h"
17 #include /**/ "ace/ACE_export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "ace/Event_Base.h"
24 #include "ace/Time_Policy.h"
25 #include "ace/Time_Value_T.h"
27 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
32 * @brief A wrapper around the Win32 event locking mechanism.
34 * Portable implementation of an Event mechanism, which is native to
35 * Win32, but must be emulated on UNIX. All platforms support
36 * process-scope locking support. However, only Win32 platforms
37 * support global naming and system-scope locking support.
39 template <class TIME_POLICY
= ACE_System_Time_Policy
>
40 class ACE_Event_T
: public ACE_Event_Base
43 /// Constructor that creates event.
44 ACE_Event_T (int manual_reset
= 0,
45 int initial_state
= 0,
46 int type
= USYNC_THREAD
,
47 const ACE_TCHAR
*name
= 0,
49 LPSECURITY_ATTRIBUTES sa
= 0);
51 /// Implicitly destroy the event variable.
52 virtual ~ACE_Event_T (void);
54 /// Get the current time of day according to the queue's TIME_POLICY.
55 /// Allows users to initialize timeout values using correct time policy.
56 ACE_Time_Value_T
<TIME_POLICY
> gettimeofday (void) const;
58 /// Allows applications to control how the event gets the time
60 void set_time_policy (TIME_POLICY
const & time_policy
);
62 /// Declare the dynamic allocation hooks
63 ACE_ALLOC_HOOK_DECLARE
;
67 /// The policy to return the current time of day
68 TIME_POLICY time_policy_
;
72 ACE_Event_T (const ACE_Event_T
<TIME_POLICY
>& event
);
73 const ACE_Event_T
&operator= (const ACE_Event_T
<TIME_POLICY
> &rhs
);
76 typedef ACE_Event_T
<ACE_System_Time_Policy
> ACE_Event
;
78 ACE_END_VERSIONED_NAMESPACE_DECL
80 #if defined (__ACE_INLINE__)
81 #include "ace/Event.inl"
82 #endif /* __ACE_INLINE__ */
84 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
85 #include "ace/Event.cpp"
86 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
88 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
89 #pragma implementation ("Event.cpp")
90 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
92 #include /**/ "ace/post.h"
93 #endif /* ACE_EVENT_H */