/* * ManipulableCloneStub.hpp * * Created on: Jan 6, 2011 * Author: heber */ #ifndef MANIPULABLECLONESTUB_HPP_ #define MANIPULABLECLONESTUB_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/ManipulableClone.hpp" struct IManipulablePrototype { virtual ~IManipulablePrototype() {}; virtual void count()=0; virtual int getcount() const =0; virtual void setcount(int const _counter)=0; }; class ManipulableCloneTest; class ManipulablePrototypeFactoryStub; namespace teststubs { class classParameters; } template class ManipulablePrototype : public IManipulablePrototype, public ManipulableClone { /** * Prototype Factory is friend because it needs to access protected cstor * to instantiate prototypes. */ friend class ManipulablePrototypeFactoryStub; /** * Tests are friend such that it can access protected cstor. */ friend class ManipulableCloneTest; friend class ManipulablePrototypeFactoryTest; protected: ManipulablePrototype() { member.setcount(0); } ~ManipulablePrototype() {}; public: void count() { member.count(); } int getcount() const { return member.getcount(); } void setcount(int const _counter) { member.setcount(_counter); } IManipulablePrototype* clone() const; ManipulablePrototype * manipulatedclone(const teststubs::classParameters& _params) const; private: T member; }; #endif /* MANIPULABLECLONESTUB_HPP_ */