#ifndef OPERATION
#define OPERATION

#include <string>

/**
 * An Operation represents an operation in a transaction history. Operations may be read, write,
 * commit and abort. Every operation belows to a particular transaction. Read and write operations
 * operation on data elements.
 */
class Operation
{
	public:
		enum OperationKind
		{
			INVALID = 0,
			READ,
			WRITE,
			COMMIT,
			ABORT
		};

		Operation(OperationKind kind, char element, unsigned short transactionID);
		Operation(const Operation& operation);
		virtual ~Operation();

		/**
		 * Converts an Operation to a textual representation.
		 * @return a textual representation
		 */
		std::string getText() const;

	private:
		OperationKind theKind;
		char theElement;
		unsigned short  theTransactionID;
};

#endif
