// $Id: PluggingController.hh 6142 2007-03-05 10:25:14Z m9710797 $ #ifndef PLUGGINGCONTROLLER_HH #define PLUGGINGCONTROLLER_HH #include "noncopyable.hh" #include #include #include namespace openmsx { class MSXMotherBoard; class Connector; class Pluggable; class MSXCliComm; class PlugCmd; class UnplugCmd; class PluggableInfo; class ConnectorInfo; class ConnectionClassInfo; /** * Central administration of Connectors and Pluggables. */ class PluggingController : private noncopyable { public: explicit PluggingController(MSXMotherBoard& motherBoard); ~PluggingController(); /** Connectors must be (un)registered */ void registerConnector(Connector& connector); void unregisterConnector(Connector& connector); /** * Add a Pluggable to the registry. * PluggingController has ownership of all registered Pluggables. */ void registerPluggable(Pluggable* pluggable); /** * Removes a Pluggable from the registry. * If you attempt to unregister a Pluggable that is not in the registry, * nothing happens. */ void unregisterPluggable(Pluggable* pluggable); private: Connector* getConnector(const std::string& name); Pluggable* getPluggable(const std::string& name); typedef std::vector Connectors; Connectors connectors; typedef std::vector Pluggables; Pluggables pluggables; friend class PlugCmd; friend class UnplugCmd; friend class PluggableInfo; friend class ConnectorInfo; friend class ConnectionClassInfo; const std::auto_ptr plugCmd; const std::auto_ptr unplugCmd; const std::auto_ptr pluggableInfo; const std::auto_ptr connectorInfo; const std::auto_ptr connectionClassInfo; MSXCliComm& cliComm; }; } // namespace openmsx #endif