All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IOManager.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _IOMANAGER_HH_
18 #define _IOMANAGER_HH_
19 
20 #include <boost/thread/thread.hpp>
21 #include <boost/asio.hpp>
22 #include "gazebo/util/system.hh"
23 
24 namespace gazebo
25 {
26  namespace transport
27  {
30 
34  {
36  public: IOManager();
38  public: ~IOManager();
39 
42  public: boost::asio::io_service &GetIO();
43 
45  public: void IncCount();
46 
48  public: void DecCount();
49 
52  public: unsigned int GetCount() const;
53 
55  public: void Stop();
56 
57  private: boost::asio::io_service *io_service;
58 
59  // Use io_service::work to keep the io_service running in thread
60  private: boost::asio::io_service::work *work;
61  private: unsigned int count;
62 
63  private: boost::thread *thread;
64  };
66  }
67 }
68 
69 #endif
70 
71 
Manages boost::asio IO.
Definition: IOManager.hh:33
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48