Also use Objects as part of an operation but as a result don't generate Any operation...
[ACE_TAO.git] / ACE / ace / Event.h
blobe8c9db91faf5cfc581a9a12106b266cce7131b5b
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file Event.h
7 * Moved from Synch.h.
9 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
11 //==========================================================================
13 #ifndef ACE_EVENT_H
14 #define ACE_EVENT_H
15 #include /**/ "ace/pre.h"
17 #include /**/ "ace/ACE_export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # 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
29 /**
30 * @class ACE_Event_T
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
42 public:
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,
48 void *arg = 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
59 /// of day.
60 void set_time_policy (TIME_POLICY const & time_policy);
62 /// Declare the dynamic allocation hooks
63 ACE_ALLOC_HOOK_DECLARE;
65 protected:
67 /// The policy to return the current time of day
68 TIME_POLICY time_policy_;
70 private:
71 // = Prevent copying.
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 */