/*********************************************************************
 * This file is part of the cpplibs suite.
 *
 * Copyright (C) 2001 Topi Mäenpää
 * All rights reserved.
 *
 * This program is free software. You can redistribute and/or modify
 * it under the terms of the free software licence found in the
 * accompanying file "COPYING". The licence terms must always be
 * redistributed with this source file. The above copyright notice
 * must be reproduced in all modified and unmodified copies of this
 * source file.
 *
 * $Revision: 1.4 $
 *********************************************************************/

#ifndef _OBJECT_H
#define _OBJECT_H

#include <string>

namespace util
{
	/**
	 * A common base class for dynamic types. Does nothing.
	 **/
	class Object
	{
	public:
		/**
		 * Virtual destructor just forces a virtual table for each
		 * inherited type.
		 **/
		virtual ~Object() {}

		/**
		 * Create a clone of this object. Each cloneable class should make
		 * this method to return an exact copy of itself. The default
		 * implementation throws a NotCloneableException.
		 **/
		virtual Object* clone() const; // throw (NotCloneableException&);

		/**
		 * Get the class name of this object.
		 **/
		std::string getClassName() const;
		/**
		 * Convert object to a string.
		 **/
		virtual std::string toString() const { return getClassName(); }

	protected:
		Object() {}
	};
}

#endif
