/portal.cpp Secret
Created
May 24, 2014 21:01
portal class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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