fd_watcher.h
Go to the documentation of this file.
1 // Watches a set of file descriptors for changes
2 // Author: Max Schwarz <max.schwarz@uni-bonn.de>
3 
4 #ifndef FD_WATCHER_H
5 #define FD_WATCHER_H
6 
7 #include <ros/time.h>
8 
9 #include <map>
10 
11 #include <boost/function.hpp>
12 
13 namespace rosmon
14 {
15 
16 class FDWatcher
17 {
18 public:
20 
21  FDWatcher();
22 
23  void registerFD(int fd, const boost::function<void(int)>& cb);
24  void removeFD(int fd);
25 
26  void wait(const ros::WallDuration& duration);
27 private:
28  std::map<int, boost::function<void(int)>> m_fds;
29 };
30 
31 }
32 
33 #endif
void wait(const ros::WallDuration &duration)
Definition: fd_watcher.cpp:37
std::map< int, boost::function< void(int)> > m_fds
Definition: fd_watcher.h:28
void registerFD(int fd, const boost::function< void(int)> &cb)
Definition: fd_watcher.cpp:27
void removeFD(int fd)
Definition: fd_watcher.cpp:32
boost::shared_ptr< FDWatcher > Ptr
Definition: fd_watcher.h:19


rosmon_core
Author(s): Max Schwarz
autogenerated on Sat Jan 9 2021 03:35:43