/*! * @file object.h * @brief Contains a base class for most of all the classes in meowpp. * * @author cathook */ #ifndef __MEOWPP_UTILITY_OBJECT_H__ #define __MEOWPP_UTILITY_OBJECT_H__ #include namespace meow { /*! * @brief The base class. */ class Object { protected: /*! * @brief A protected constructor to prevent developers create an instance of * Object directly. */ Object() {} /*! * @brief Disable the copy operation. */ Object(Object const& b); public: /*! * @brief Virtual destructor. */ virtual ~Object() {} /*! * @brief Creates a copy of itself and return the pointer to it. * * It will return NULL in default if you don't implement it. */ virtual Object* Copy() const { return NULL; } /*! * @brief Copies data from another object. * @param [in] ptr Points to another object. * * It will return NULL in default if you don't implement it. */ virtual Object* CopyFrom(Object const* ptr) { return NULL; } /*! * @brief Returns whether it equals to another object or not. * @param [in] ptr Points to another object. * * It will always return false if you don't implement it. */ virtual bool Equals(Object const* ptr) const { return false; } /*! * @brief Disable the copy operator. */ Object& operator=(Object const& b); }; } // meow #endif // __MEOWPP_UTILITY_OBJECT_H__