/**
 * \class TypeSelect
 * \brief Template which results in a const reference for non-basic template parameter types.
 *
 * E.g., "TypeSelect<MyClass>" will expand to "const MyClass &" at compile time while 
 * "TypeSelect<int>" will expand to "int".
 */

/**
 * \class StandardSetterCmd
 * \brief Template for simple setter undo commands.
 *
 * Use it like this:
 * \code
class MyClassSetMyValueCmd: public StandardClassSetterCmd<MyClass::Private, TheValueTypeOrClass> {
	public:
		MyClassSetMyValueCmd(MyClass::Private *target, TypeSelect<TheValueOrClasse>::ParamType newValue, const QString &description)
			: StandardSetterCmd<MyClass::Private, TypeSelect<TheValueOrClasse>::ParamType>(target, &MyClass::Private::myValue, newValue, description) {}
		virtual void initialize() { emit m_target->q->myValueAboutToChange(); }
		virtual void finalize() { emit m_target->q->myValueChanged(); }
};
 * \endcode
 * When instanciating the class, use 
 * \code tr("%1: what the command does") \endcode for the description argument. The "%1" will automatically be replaced by 
 * the aspect name (the private class must implement "QString name() const").
 * Example: \code
class MyClass::Private {
	public:
		Private(MyClass *owner) : q(owner) {
		}

		QString name() const {
			return q->name();
		}

		int myValue;
		MyClass *const q;
};

void MyClass::setMyValue(int value) {
	exec(new MyClassSetMyValueCmd(d, value, tr("%1: set my value")));
}
 * \endcode
 */

/**
 * \class StandardSwapMethodSetterCmd
 * \brief Template for setter undo commands which require a function call.
 *
 * This template is very similar to StandardSetterCmd but it takes a method address
 * instead of a field address. The method must be a setter function which returns the
 * old value. Example: \code
qreal MyClass::Private::setZValue(qreal z) {
	qreal oldZ = calculateMyZValue();
	myZValue = z;
	setZValueForAllChildren(z);
	return oldZ;
}
 * \endcode
 */

