#ifndef CPSW_COMMAND_H #define CPSW_COMMAND_H #include #include using boost::static_pointer_cast; using boost::weak_ptr; class CCommandImpl; typedef shared_ptr CommandImpl; class CCommandImpl : public CEntryImpl, public virtual ICommandField { public: virtual void executeCommand( Path pParent ) const; CCommandImpl(Key &k, const char* name); }; class CCommand_Adapt; typedef shared_ptr Command_Adapt; class CCommand_Adapt: public virtual ICommand, public virtual IEntryAdapt { private: Path pParent_; public: CCommand_Adapt(Key &k, Path p, shared_ptr ie); static Command create(Path p); virtual void execute() { asCommandImpl()->executeCommand( pParent_ ); } protected: virtual shared_ptr asCommandImpl() const { return static_pointer_cast(ie_); } }; #endif