Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / ace / Auto_Event.h
blobc71e46c17be6e62470ab565d3c8077226295ca19
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file Auto_Event.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //==========================================================================
11 #ifndef ACE_AUTO_EVENT_H
12 #define ACE_AUTO_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.h"
23 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 /**
26 * @class ACE_Auto_Event
28 * @brief Auto Events.
30 * Specialization of Event mechanism which wakes up one waiting
31 * thread on @c signal. All platforms support process-scope locking
32 * support. However, only Win32 platforms support global naming and
33 * system-scope locking support.
35 template <class TIME_POLICY = ACE_System_Time_Policy>
36 class ACE_Auto_Event_T : public ACE_Event_T<TIME_POLICY>
38 public:
39 /// Constructor which will create auto event
40 ACE_Auto_Event_T (int initial_state = 0,
41 int type = USYNC_THREAD,
42 const char *name = 0,
43 void *arg = 0);
45 #if defined (ACE_HAS_WCHAR)
46 /// Constructor which will create auto event (wchar_t version)
47 ACE_Auto_Event_T (int initial_state,
48 int type,
49 const wchar_t *name,
50 void *arg = 0);
51 #endif /* ACE_HAS_WCHAR */
53 /// Default dtor.
54 virtual ~ACE_Auto_Event_T () = default;
56 /// Dump the state of an object.
57 void dump () const;
59 /// Declare the dynamic allocation hooks
60 ACE_ALLOC_HOOK_DECLARE;
63 class ACE_Auto_Event :
64 public ACE_Auto_Event_T<ACE_System_Time_Policy>
66 public:
67 /// Constructor which will create auto event
68 ACE_Auto_Event (int initial_state = 0,
69 int type = USYNC_THREAD,
70 const char *name = 0,
71 void *arg = 0)
72 : ACE_Auto_Event_T<ACE_System_Time_Policy> (initial_state, type, name, arg)
76 #if defined (ACE_HAS_WCHAR)
77 /// Constructor which will create auto event (wchar_t version)
78 ACE_Auto_Event (int initial_state,
79 int type,
80 const wchar_t *name,
81 void *arg = 0)
82 : ACE_Auto_Event_T<ACE_System_Time_Policy> (initial_state, type, name, arg)
85 #endif /* ACE_HAS_WCHAR */
87 /// Default dtor.
88 virtual ~ACE_Auto_Event ()
93 ACE_END_VERSIONED_NAMESPACE_DECL
95 #include "ace/Auto_Event.cpp"
97 #include /**/ "ace/post.h"
98 #endif /* ACE_AUTO_EVENT_H */