Skip to content
Snippets Groups Projects
position.h 776 B
#ifndef LIBWCCL_VALUES_POSITION_H
#define LIBWCCL_VALUES_POSITION_H

#include <libwccl/values/value.h>
#include <cstdlib>
#include <boost/integer_traits.hpp>

namespace Wccl {

class Position : public Value
{
public:
	WCCL_VALUE_PREAMBLE

	explicit Position(int v = 0)
		: val_(v)
	{
	}

	static const int Nowhere = boost::integer_traits<int>::const_min;
	static const int Begin = boost::integer_traits<int>::const_min + 1;
	static const int End = boost::integer_traits<int>::const_max;

	int get_value() const {
		return val_;
	}

	void set_value(int v) {
		val_ = v;
	}

	/// Value override
	std::string to_raw_string() const;

	bool equals(const Position& other) {
		return val_ == other.val_;
	}

private:
	int val_;
};


} /* end ns Wccl */

#endif // LIBWCCL_POSITION_H