SeaBreeze
DeviceFactory.h
Go to the documentation of this file.
1 /***************************************************/
35 #ifndef SEABREEZE_DEVICE_FACTORY_H
36 #define SEABREEZE_DEVICE_FACTORY_H
37 
38 #include <string>
39 #include <map>
40 #include "common/devices/Device.h"
41 
42 namespace seabreeze {
43 
44  class DeviceFactory {
45 
46  public:
47  static DeviceFactory* getInstance();
48  static DeviceFactory* instance;
49  static void shutdown();
50 
51  Device *create(const std::string& name);
52  Device *create(int index);
53  int getNumberOfDeviceTypes();
54 
55  private:
56  typedef Device *(*creatorFunction)(void);
57  DeviceFactory();
58  std::map<std::string, creatorFunction> nameToCreator;
59  };
60 
61 }
62 
63 #endif
Definition: DeviceFactory.h:44
Definition: Device.h:64
Encapsulates all SeaBreeze classes.
Definition: DeviceFactory.h:42