25 #ifndef INCLUDED_RemoteHandlerFactory_h_GUID_3B3394C0_DADA_4BAA_3EDD_6CDA96760D91
26 #define INCLUDED_RemoteHandlerFactory_h_GUID_3B3394C0_DADA_4BAA_3EDD_6CDA96760D91
42 #include <unordered_map>
46 class VRPNConnectionCollection;
49 typedef shared_ptr<RemoteHandler> FactoryProduct;
50 typedef std::function<FactoryProduct(
54 void addFactory(std::string
const &name, SpecificFactory factory) {
55 m_factoriesByInterface[name] = factory;
58 bool isKnownInterfaceType(std::string
const &name)
const {
59 return m_factoriesByInterface.find(name) !=
60 end(m_factoriesByInterface);
64 common::InterfaceList &ifaces,
67 m_factoriesByInterface.find(source.getInterfaceName());
69 if (factory == end(m_factoriesByInterface)) {
71 return FactoryProduct();
74 return (factory->second)(source, ifaces, ctx);
78 std::unordered_map<std::string, SpecificFactory> m_factoriesByInterface;
83 OSVR_CLIENT_EXPORT
void
84 populateRemoteHandlerFactory(RemoteHandlerFactory &factory,
85 VRPNConnectionCollection
const &conns);
89 #endif // INCLUDED_RemoteHandlerFactory_h_GUID_3B3394C0_DADA_4BAA_3EDD_6CDA96760D91
The result of resolving a tree node to a device: either an original source to connect to...
FactoryProduct invokeFactory(common::OriginalSource const &source, common::InterfaceList &ifaces, common::ClientContext &ctx) const
Header to bring shared_ptr into the osvr namespace.
Automatically-generated export header - do not edit!