##

IOManager.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _IOMANAGER_HH_
#define _IOMANAGER_HH_
#include <boost/thread/thread.hpp>
#include <boost/asio.hpp>
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace transport
{
class GZ_TRANSPORT_VISIBLE IOManager
{
public: IOManager();
public: ~IOManager();
public: boost::asio::io_service &GetIO();
public: void IncCount();
public: void DecCount();
public: unsigned int GetCount() const;
public: void Stop();
private: boost::asio::io_service *io_service;
// Use io_service::work to keep the io_service running in thread
private: boost::asio::io_service::work *work;
private: unsigned int count;
private: boost::thread *thread;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::IOManager::GetCount
unsigned int GetCount() const
Get the event count.
system.hh
gazebo::transport::IOManager::~IOManager
~IOManager()
Destructor.
gazebo::transport::IOManager::DecCount
void DecCount()
Decrement the event count by 1.
gazebo::transport::IOManager
Manages boost::asio IO.
Definition: IOManager.hh:33
gazebo::transport::IOManager::Stop
void Stop()
Stop the IO service.
transport
transport
Definition: ConnectionManager.hh:35
gazebo::transport::IOManager::IncCount
void IncCount()
Increment the event count by 1.
gazebo::transport::IOManager::GetIO
boost::asio::io_service & GetIO()
Get handle to boost::asio IO service.
gazebo::transport::IOManager::IOManager
IOManager()
Constructor.