PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/contrib/boost/asio/detail/null_event.hpp

http://pythonocc.googlecode.com/
C++ Header | 79 lines | 47 code | 17 blank | 15 comment | 2 complexity | 8d687412757952da3741e002c0fc279f MD5 | raw file
 1//
 2// null_event.hpp
 3// ~~~~~~~~~~~~~~
 4//
 5// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 6//
 7// Distributed under the Boost Software License, Version 1.0. (See accompanying
 8// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 9//
10
11#ifndef BOOST_ASIO_DETAIL_NULL_EVENT_HPP
12#define BOOST_ASIO_DETAIL_NULL_EVENT_HPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/push_options.hpp>
19
20#include <boost/asio/detail/push_options.hpp>
21#include <boost/config.hpp>
22#include <boost/asio/detail/pop_options.hpp>
23
24#if !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
25
26#include <boost/asio/detail/noncopyable.hpp>
27
28namespace boost {
29namespace asio {
30namespace detail {
31
32class null_event
33  : private noncopyable
34{
35public:
36  // Constructor.
37  null_event()
38  {
39  }
40
41  // Destructor.
42  ~null_event()
43  {
44  }
45
46  // Signal the event.
47  template <typename Lock>
48  void signal(Lock&)
49  {
50  }
51
52  // Signal the event and unlock the mutex.
53  template <typename Lock>
54  void signal_and_unlock(Lock&)
55  {
56  }
57
58  // Reset the event.
59  template <typename Lock>
60  void clear(Lock&)
61  {
62  }
63
64  // Wait for the event to become signalled.
65  template <typename Lock>
66  void wait(Lock&)
67  {
68  }
69};
70
71} // namespace detail
72} // namespace asio
73} // namespace boost
74
75#endif // !defined(BOOST_HAS_THREADS) || defined(BOOST_ASIO_DISABLE_THREADS)
76
77#include <boost/asio/detail/pop_options.hpp>
78
79#endif // BOOST_ASIO_DETAIL_NULL_EVENT_HPP