OceanDirect  1.31.0
OceanDirect C++/C API
DeviceFactory.h
1 /*******************************************************
2  * @file DeviceFactory.h
3  * @date February 2018
4  * @author Ocean Optics, Inc.
5  *
6  * Notes:
7  *
8  * This class allows Device class instances to be created
9  * using just the name of the class as a string.
10  */
11  /************************************************************************
12  *
13  * OCEAN INSIGHT CONFIDENTIAL
14  * __________________
15  *
16  * [2018] - [2020] Ocean Insight Incorporated
17  * All Rights Reserved.
18  *
19  * NOTICE: All information contained herein is, and remains
20  * the property of Ocean Insight Incorporated and its suppliers,
21  * if any. The intellectual and technical concepts contained
22  * herein are proprietary to Ocean Insight Incorporated
23  * and its suppliers and may be covered by U.S. and Foreign Patents,
24  * patents in process, and are protected by trade secret or copyright law.
25  * Dissemination of this information or reproduction of this material
26  * is strictly forbidden unless prior written permission is obtained
27  * from Ocean Insight Incorporated.
28  *
29  **************************************************************************/
30 
31 #ifndef OCEANDIRECT_DEVICE_FACTORY_H
32 #define OCEANDIRECT_DEVICE_FACTORY_H
33 
34 #include <string>
35 #include <map>
36 #include "common/devices/Device.h"
37 
38 namespace oceandirect {
39 
40  class DeviceFactory {
41 
42  public:
43  static DeviceFactory* getInstance();
44  static DeviceFactory* instance;
45  static void shutdown();
46 
47  Device *create(const std::string& name);
48  Device *create(int index);
49  int getNumberOfDeviceTypes();
50 
51  private:
52  typedef Device *(*creatorFunction)(void);
53  DeviceFactory();
54  std::map<std::string, creatorFunction> nameToCreator;
55  };
56 
57 }
58 
59 #endif
Definition: DeviceFactory.h:40
This is an interface to OceanDirect that allows the user to connect to devices over USB and other bus...
Definition: DeviceFactory.h:38