Skip to content

Instantly share code, notes, and snippets.

@ifknot
Created May 24, 2014 21:01
portal class
namespace fbp {
struct portal {
portal(std::string name): name_(name) {}
virtual void connect(connectable* link) {
ports[link->name()] = link;
}
connectable* operator[] (const std::string port_name) {
return ports[port_name];
}
std::string name() {
return name_;
}
virtual ~portal() {}
private:
std::string name_;
std::map<std::string, connectable*> ports;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment