26 #ifndef _UDEV_CONTROL_H_
27 #define _UDEV_CONTROL_H_
32 #include <sys/types.h>
40 #include <boost/algorithm/string.hpp>
43 using namespace boost;
61 struct udev_list_entry *
devices, *dev_list_entry;
63 struct udev_device *
dev;
65 struct udev_monitor *
mon;
75 map<string,void (*)(string,string,void*)>
actions;
79 map<string,void (*)(string,string,void*)>::iterator
actions_it;
89 bool FilterProperties(
struct udev_device *dev_);
100 string GetProperty(
struct udev_device *dev_,
string name);
131 bool AddSubsystem(
string subsystem);
142 bool AddProperty(
string name,
string value);
154 bool RegistryAction(
string action,
void (*callback)(
string action,
string node,
void*data),
void*data);
162 bool SetUpMonitoring();
173 bool EnumerateDevices();
189 return device_list.size();
212 return device_list[i];
struct udev_list_entry * devices
List entries.
vector< string > device_list
List of all devices that pass the filter.
struct udev * udev
Auxiliary variable.
map< string, string > properties
Map of all properties added.
struct udev_monitor * mon
Udev monitor.
map< string, void(*)(string, string, void *)>::iterator actions_it
Map iterator for the actions handler map.
string GetPath(uint i=0)
Get the path to the device.
string GetId()
Get id of the class.
map< string, void * > user_data
Map of pairs of actions strings and user data parameters.
map< string, string >::iterator properties_it
Properties map iterator.
vector< string > sub_systems
Subsystem vector, these will be used to prefilter the devices.
map< string, void(*)(string, string, void *)> actions
Map of pairs of actions strings and corresponding handler function.
int fd
File descriptor used in the monitoring.
struct udev_enumerate * enumerate
Enumerator auxiliary variable.
uint size()
Get the size of the device list.
struct udev_device * dev
Device auxiliary variable.
string id
Id of the class.
This class simplifies the implementation of the udev library.