Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / ace / Event.h
blobf0727003f53c753f1cd0da89b7a6a3bea7b1f2f9
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file Event.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //==========================================================================
11 #ifndef ACE_EVENT_H
12 #define ACE_EVENT_H
13 #include /**/ "ace/pre.h"
15 #include /**/ "ace/ACE_export.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ace/Event_Base.h"
22 #include "ace/Time_Policy.h"
23 #include "ace/Time_Value_T.h"
25 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 /**
28 * @class ACE_Event_T
30 * @brief A wrapper around the Win32 event locking mechanism.
32 * Portable implementation of an Event mechanism, which is native to
33 * Win32, but must be emulated on UNIX. All platforms support
34 * process-scope locking support. However, only Win32 platforms
35 * support global naming and system-scope locking support.
37 template <class TIME_POLICY = ACE_System_Time_Policy>
38 class ACE_Event_T : public ACE_Event_Base
40 public:
41 /// Constructor that creates event.
42 ACE_Event_T (int manual_reset = 0,
43 int initial_state = 0,
44 int type = USYNC_THREAD,
45 const ACE_TCHAR *name = 0,
46 void *arg = 0,
47 LPSECURITY_ATTRIBUTES sa = 0);
49 /// Implicitly destroy the event variable.
50 virtual ~ACE_Event_T () = default;
52 /// Get the current time of day according to the queue's TIME_POLICY.
53 /// Allows users to initialize timeout values using correct time policy.
54 ACE_Time_Value_T<TIME_POLICY> gettimeofday () const;
56 /// Allows applications to control how the event gets the time
57 /// of day.
58 void set_time_policy (TIME_POLICY const & time_policy);
60 /// Declare the dynamic allocation hooks
61 ACE_ALLOC_HOOK_DECLARE;
63 protected:
64 /// The policy to return the current time of day
65 TIME_POLICY time_policy_;
67 private:
68 ACE_Event_T (const ACE_Event_T<TIME_POLICY>& event) = delete;
69 const ACE_Event_T &operator= (const ACE_Event_T<TIME_POLICY> &rhs) = delete;
72 typedef ACE_Event_T<ACE_System_Time_Policy> ACE_Event;
74 ACE_END_VERSIONED_NAMESPACE_DECL
76 #if defined (__ACE_INLINE__)
77 #include "ace/Event.inl"
78 #endif /* __ACE_INLINE__ */
80 #include "ace/Event.cpp"
82 #include /**/ "ace/post.h"
83 #endif /* ACE_EVENT_H */