From: stephan b. <sg...@us...> - 2004-12-25 17:06:55
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/IO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2716/include/pclasses/IO Added Files: IOManager.h Log Message: First draft of IOPluginManager. Untested. --- NEW FILE: IOManager.h --- #ifndef P_IOMANAGER_HPP_INCLUDED #define P_IOMANAGER_HPP_INCLUDED 1 #include "pclasses/Phoenix.h" #include "pclasses/Plugin/Plugin.h" #include "pclasses/Net/URL.h" namespace P { namespace IO { /** IOManager is a PluginManager intended specifically for use with the P::IO layer. */ template <typename InterfaceT> class IOPluginManager : public ::P::PluginManager<InterfaceT> { public: typdef IOPluginManager<InterfaceT> ThisType; typedef ::P::PluginManager<InterfaceT> ParentType; typedef typename ParentType::factory_type factory_type; typedef typename ParentType::result_type result_type; using ::P::Net::URL; IOPluginManager(){} virtual ~IOPluginManager(){} /** Returns a shared instance of this object. */ static ThisType & instance() { typedef ::P::Phoenix<ThisType, ::P::Sharing::FactoryContext > PHX; return PHX::instance(); } /** Returns this->registerFactory(_protocol.protocol()). */ void registerFactory(const URL &_protocol, factory_type fp) { this->registerFactory( _protocol.protocol(), fp ) } /** Returns this->create(_protocol.protocol()). */ result_type create( const URL & _protocol ) { return this->create( _protocol.protocol() ); } /** Returns this->provides(_protocol.protocol()). */ bool provides(const URL &_protocol) const { return this->provides( _protocol.protocol() ); } }; // class IOPluginManager } } // namespace P::IO #endif // P_IOMANAGER_HPP_INCLUDED |