33 #include <rsc/runtime/NoSuchObject.h>
34 #include <rsc/runtime/TypeStringTools.h>
35 #include <rsc/runtime/Printable.h>
36 #include <rsc/patterns/Factory.h>
41 #include "rsb/rsbexports.h"
53 template <
typename Interface>
55 public rsc::patterns::Singleton< ConnectorFactory<Interface> >,
56 public rsc::runtime::Printable {
73 name(name), schemas(schemas), remote(remote), options(options) {
74 this->options.insert(
"enabled");
119 }
else if (this->
name == other.
name) {
139 return "ConnectorInfo";
144 <<
", schemas = " << this->
schemas
145 <<
", remote = " << this->
remote
146 <<
", options = " << this->
options;
151 typedef rsc::patterns::Factory<std::string, Interface>
Factory;
154 typedef std::map<std::string, ConnectorInfo>
InfoMap;
167 typename InfoMap::const_iterator it = this->
infos.find(name);
168 if (it == this->
infos.end()) {
169 throw rsc::runtime::NoSuchObject(name);
175 std::set<ConnectorInfo> result;
177 for (
typename InfoMap::const_iterator it = this->
infos.begin();
178 it != this->
infos.end(); ++it) {
179 result.insert(it->second);
198 const std::set<std::string>& schemas = std::set<std::string>(),
200 const std::set<std::string>& options = std::set<std::string>()) {
201 Factory::impls().register_(name, constructor);
204 this->
infos.insert(std::make_pair(name, info));
210 const std::set<std::string>& options = std::set<std::string>()) {
211 std::set<std::string> schemas;
212 schemas.insert(schema);
219 return "ConnectorFactory<" + rsc::runtime::typeName<Interface>() +
">";
225 for (
typename ImplMapProxy::const_iterator it = implementations.begin(); it
226 != implementations.end(); ++it) {