/*
 * StringBase.h
 *
 *  Created on: Mar 26, 2013
 *      Author: Jan Travnicek
 */

#ifndef STRING_BASE_H_
#define STRING_BASE_H_

#include "../label/LabelBase.h"
#include <ostream>
#include <set>
#include "../alphabet/Symbol.h"
#include "String.h"
	
namespace string {

class LinearString;
class CyclicString;
class Epsilon;

/**
 * Represents string in an alphabet.
 */
class StringBase : public std::elementBase<Epsilon, LinearString, CyclicString> {
public:
	virtual ~StringBase() noexcept;

	virtual StringBase* clone() const = 0;
	virtual StringBase* plunder() && = 0; 

	bool operator>=(const StringBase& other) const;

	bool operator<=(const StringBase& other) const;

	bool operator!=(const StringBase& other) const;

	virtual bool operator==(const StringBase& other) const = 0;
	virtual bool operator==(const LinearString& other) const = 0;
	virtual bool operator==(const CyclicString& other) const = 0;
	virtual bool operator==(const Epsilon& other) const = 0;

	virtual bool operator<(const StringBase& other) const = 0;
	virtual bool operator<(const LinearString& other) const = 0;
	virtual bool operator<(const CyclicString& other) const = 0;
	virtual bool operator<(const Epsilon& other) const = 0;
	virtual bool operator>(const StringBase& other) const = 0;

	/**
	 * Prints XML representation of the String to the output stream.
	 * @param out output stream to which print the String
	 * @param string String to print
	 */
	friend std::ostream& operator<<(std::ostream&, const StringBase&);

	virtual void operator>>(std::ostream& out) const = 0;

	virtual operator std::string () const = 0;
};

} /* namespace string */

#endif /* STRING_BASE_H_ */