Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71564 - in sandbox/property: boost boost/property boost/property/detail libs libs/property libs/property/doc libs/property/test
From: eldiener_at_[hidden]
Date: 2011-04-28 11:05:50


Author: eldiener
Date: 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
New Revision: 71564
URL: http://svn.boost.org/trac/boost/changeset/71564

Log:
Initial header files.
Added:
   sandbox/property/boost/
   sandbox/property/boost/property/
   sandbox/property/boost/property/PropertyAll.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyAuto.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyAutoPredicate.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyAutoReference.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyAutoValue.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyBase.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyBasic.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyCallable.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyCallableReference.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyCallableValue.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyClass.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyData.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyDataPredicate.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyDataReference.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyDataValue.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyException.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyFunction.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyFunctionReference.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyFunctionValue.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyFunctor.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyFunctorReference.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyFunctorValue.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyGlobalFunctions.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyIndexInterface.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyIndexMap.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyInterface.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyMemberData.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyMemberDataPredicate.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyMemberDataReference.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyMemberDataValue.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyMemberFunction.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyMemberFunctionReference.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyMemberFunctionValue.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyMixin.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyNotificationBoostSignal.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyOperators.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyOperatorsDetail.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyOperatorsEnabling.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyPredicateFailureRuntimeException.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyReferenceInterface.hpp (contents, props changed)
   sandbox/property/boost/property/PropertyTag.hpp (contents, props changed)
   sandbox/property/boost/property/detail/
   sandbox/property/boost/property/detail/PropertyIndexMapDetail.h (contents, props changed)
   sandbox/property/libs/
   sandbox/property/libs/property/
   sandbox/property/libs/property/doc/
   sandbox/property/libs/property/test/

Added: sandbox/property/boost/property/PropertyAll.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyAll.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "PropertyAuto.h"
+#include "PropertyCallable.h"
+#include "PropertyData.h"
+#include "PropertyFunction.h"
+#include "PropertyFunctor.h"
+#include "PropertyIndexMap.h"
+#include "PropertyMemberData.h"
+#include "PropertyMemberFunction.h"

Added: sandbox/property/boost/property/PropertyAuto.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyAuto.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "PropertyAutoValue.h"
+#include "PropertyAutoPredicate.h"
+#include "PropertyAutoReference.h"

Added: sandbox/property/boost/property/PropertyAutoPredicate.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyAutoPredicate.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,575 @@
+#pragma once
+
+#include "PropertyTag.h"
+#include "PropertyAutoValue.h"
+#include "PropertyOperators.h"
+#include <boost/function.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_const.hpp>
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T,
+ template <class> class NotificationPolicy = DefaultPolicyTag,
+ template <class> class PredicateFailurePolicy = DefaultPolicyTag
+ >
+ struct propAutoPredicate:
+ propAuto<T,NotificationPolicy>,
+ PredicateFailurePolicy<T>
+ {
+
+ BOOST_MPL_ASSERT_NOT((boost::is_const<T>));
+
+ explicit propAutoPredicate(boost::function<bool (T)> f) :
+ fs(f)
+ {
+ }
+
+ propAutoPredicate(const propAutoPredicate & arg) :
+ propAuto<T,NotificationPolicy>(static_cast<const propAuto<T,NotificationPolicy> &>(arg)),
+ fs(arg.fs)
+ {
+ }
+
+ propAutoPredicate(boost::function<bool (T)> f,T arg) :
+ propAuto<T,NotificationPolicy>(init(f,arg)),
+ fs(f)
+ {
+ }
+
+ template<class U>
+ propAutoPredicate(boost::function<bool (T)> f,U arg) :
+ propAuto<T,NotificationPolicy>(init(f,arg)),
+ fs(f)
+ {
+ }
+
+ propAutoPredicate & operator = (const propAutoPredicate & arg)
+ {
+ static_cast<propAuto<T,NotificationPolicy> &>(*this) = static_cast<const propAuto<T,NotificationPolicy> &>(arg);
+ return(*this);
+ }
+
+ propAutoPredicate & operator = (T arg)
+ {
+ static_cast<propAuto<T,NotificationPolicy> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propAutoPredicate & operator = (U arg)
+ {
+ static_cast<propAuto<T,NotificationPolicy> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propAuto<T,NotificationPolicy>::set(arg);
+ }
+ else
+ {
+
+ T t(*this);
+
+ PredicateFailure(*this,fs,boost::optional<T>(t),arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ bool valid(boost::function<bool (T)> f,T arg) const
+ {
+ return(!f || f(arg));
+ }
+
+ template<class U>
+ bool valid(boost::function<bool (T)> f,U arg) const
+ {
+ return(!f || f(static_cast<T>(arg)));
+ }
+
+ T init(boost::function<bool (T)> f,T arg) const
+ {
+ if (valid(f,arg))
+ {
+ return arg;
+ }
+ else
+ {
+
+ boost::initialized<T> d;
+
+ return(boost::get(d));
+ }
+ }
+
+ template<class U>
+ U init(boost::function<bool (T)> f,U arg) const
+ {
+ if (valid(f,arg))
+ {
+ return arg;
+ }
+ else
+ {
+
+ boost::initialized<U> d;
+
+ return(boost::get(d));
+ }
+ }
+
+ };
+
+ template <class T,
+ template <class> class NotificationPolicy
+ >
+ struct propAutoPredicate<T,NotificationPolicy,DefaultPolicyTag> :
+ propAuto<T,NotificationPolicy>
+ {
+
+ BOOST_MPL_ASSERT_NOT((boost::is_const<T>));
+
+ explicit propAutoPredicate(boost::function<bool (T)> f) :
+ fs(f)
+ {
+ }
+
+ propAutoPredicate(const propAutoPredicate & arg) :
+ propAuto<T,NotificationPolicy>(static_cast<const propAuto<T,NotificationPolicy> &>(arg)),
+ fs(arg.fs)
+ {
+ }
+
+ propAutoPredicate(boost::function<bool (T)> f,T arg) :
+ propAuto<T,NotificationPolicy>(init(f,arg)),
+ fs(f)
+ {
+ }
+
+ template<class U>
+ propAutoPredicate(boost::function<bool (T)> f,U arg) :
+ propAuto<T,NotificationPolicy>(init(f,arg)),
+ fs(f)
+ {
+ }
+
+ propAutoPredicate & operator = (const propAutoPredicate & arg)
+ {
+ static_cast<propAuto<T,NotificationPolicy> &>(*this) = static_cast<const propAuto<T,NotificationPolicy> &>(arg);
+ return(*this);
+ }
+
+ propAutoPredicate & operator = (T arg)
+ {
+ static_cast<propAuto<T,NotificationPolicy> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propAutoPredicate & operator = (U arg)
+ {
+ static_cast<propAuto<T,NotificationPolicy> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propAuto<T,NotificationPolicy>::set(arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ bool valid(boost::function<bool (T)> f,T arg) const
+ {
+ return(!f || f(arg));
+ }
+
+ template<class U>
+ bool valid(boost::function<bool (T)> f,U arg) const
+ {
+ return(!f || f(static_cast<T>(arg)));
+ }
+
+ T init(boost::function<bool (T)> f,T arg) const
+ {
+ if (valid(f,arg))
+ {
+ return arg;
+ }
+ else
+ {
+
+ boost::initialized<T> d;
+
+ return(boost::get(d));
+ }
+ }
+
+ template<class U>
+ U init(boost::function<bool (T)> f,U arg) const
+ {
+ if (valid(f,arg))
+ {
+ return arg;
+ }
+ else
+ {
+
+ boost::initialized<U> d;
+
+ return(boost::get(d));
+ }
+ }
+
+ };
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator ++ (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator -- (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator *= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator *= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator /= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator /= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator %= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator %= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator += (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator += (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator -= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator -= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator <<= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator <<= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator >>= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator >>= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator &= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator &= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator ^= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator ^= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator |= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> &
+ >::type
+operator |= (propAutoPredicate<T,NotificationPolicy,PredicateFailurePolicy> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyAutoReference.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyAutoReference.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "PropertyReferenceInterface.h"
+#include <boost/utility/value_init.hpp>
+
+namespace properties
+{
+
+ template <class T>
+ class propAutoReference : public IPropertyReferenceRead<T>
+ {
+
+ public:
+
+ propAutoReference() { }
+ explicit propAutoReference(T arg) : data(arg) { }
+
+ operator const T & () const { return(get()); }
+ operator T & () { return(get()); }
+
+ const T & get() const { return(boost::get(data)); }
+ T & get() { return(boost::get(data)); }
+
+ protected:
+
+ boost::initialized<T> data;
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyAutoValue.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyAutoValue.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,510 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyTag.h"
+#include "PropertyOperators.h"
+#include <boost/utility/value_init.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/optional.hpp>
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T,
+ template <class> class NotificationPolicy = DefaultPolicyTag,
+ class Access = typename boost::mpl::if_
+ <
+ boost::is_const<T>,
+ ReadTag,
+ ReadWriteTag
+ >::type
+ >
+ class propAuto;
+
+ template <class T>
+ class propAuto<T,DefaultPolicyTag,ReadTag> :
+ public virtual IPropertyRead<T>
+ {
+
+ public:
+
+ propAuto()
+ {
+ }
+
+ explicit propAuto(T arg) :
+ data(arg)
+ {
+ }
+
+ template<class U>
+ explicit propAuto(U arg) :
+ data(static_cast<T>(arg))
+ {
+ }
+
+ operator T() const
+ {
+ return(get());
+ }
+
+ T get() const
+ {
+ return(boost::get(data));
+ }
+
+ protected:
+
+ boost::initialized<T> data;
+
+ private:
+
+ propAuto & operator = (const propAuto & arg);
+
+ };
+
+ template <class T>
+ struct propAuto<T,DefaultPolicyTag,ReadWriteTag> :
+ propAuto<T,DefaultPolicyTag,ReadTag>,
+ IPropertyReadWrite<T>
+ {
+
+ propAuto()
+ {
+ }
+
+ propAuto(const propAuto & arg) :
+ propAuto<T,DefaultPolicyTag,ReadTag>(static_cast<const propAuto<T,DefaultPolicyTag,ReadTag> &>(arg))
+ {
+ }
+
+ explicit propAuto(T arg) :
+ propAuto<T,DefaultPolicyTag,ReadTag>(arg)
+ {
+ }
+
+ template<class U>
+ explicit propAuto(U arg) :
+ propAuto<T,DefaultPolicyTag,ReadTag>(arg)
+ {
+ }
+
+ propAuto & operator = (const propAuto & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propAuto & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propAuto & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ boost::get(data) = arg;
+ }
+
+ };
+
+ template <class T,template <class> class NotificationPolicy>
+ struct propAuto<T,NotificationPolicy,ReadWriteTag> :
+ propAuto<T,DefaultPolicyTag,ReadTag>,
+ IPropertyReadWrite<T>,
+ NotificationPolicy<T>
+ {
+
+ propAuto()
+ {
+ }
+
+ propAuto(const propAuto & arg) :
+ propAuto<T,DefaultPolicyTag,ReadTag>(static_cast<const propAuto<T,DefaultPolicyTag,ReadTag> &>(arg))
+ {
+ }
+
+ explicit propAuto(T arg) :
+ propAuto<T,DefaultPolicyTag,ReadTag>(arg)
+ {
+ }
+
+ template<class U>
+ explicit propAuto(U arg) :
+ propAuto<T,DefaultPolicyTag,ReadTag>(arg)
+ {
+ }
+
+ propAuto & operator = (const propAuto & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propAuto & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propAuto & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+
+ T t(*this);
+
+ boost::get(data) = arg;
+ PropertyChanged(*this,boost::optional<T>(t),arg);
+ }
+
+ };
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ++ (propAuto<T,NotificationPolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -- (propAuto<T,NotificationPolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator *= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator *= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator /= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator /= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator %= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator %= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator += (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator += (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator <<= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator <<= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator >>= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator >>= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator &= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator &= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ^= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ^= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator |= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propAuto<T,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator |= (propAuto<T,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyBase.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyBase.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,24 @@
+#pragma once
+
+namespace properties
+{
+
+ template <typename T>
+ class PropertyRead
+ {
+ public:
+
+ virtual T getValue() = 0;
+
+ };
+
+ template <typename T>
+ class PropertyWrite
+ {
+ public:
+
+ virtual void setValue(T) = 0;
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyBasic.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyBasic.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,10 @@
+#pragma once
+
+#include "PropertyAuto.h"
+#include "PropertyCallable.h"
+#include "PropertyData.h"
+#include "PropertyFunction.h"
+#include "PropertyFunctor.h"
+#include "PropertyIndexMap.h"
+#include "PropertyMemberData.h"
+#include "PropertyMemberFunction.h"

Added: sandbox/property/boost/property/PropertyCallable.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyCallable.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,4 @@
+#pragma once
+
+#include "PropertyCallableValue.h"
+#include "PropertyCallableReference.h"

Added: sandbox/property/boost/property/PropertyCallableReference.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyCallableReference.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,55 @@
+#pragma once
+
+#include "PropertyReferenceInterface.h"
+#include "PropertyException.h"
+#include <boost/function.hpp>
+
+namespace properties
+{
+ template <class T>
+ class propCallableReference :
+ public IPropertyReferenceRead<T>
+ {
+
+ public:
+
+ propCallableReference(boost::function<T & ()> g) :
+ fg(g)
+ {
+ }
+
+ operator T & ()
+ {
+ return(get());
+ }
+
+ operator T const & () const
+ {
+ return(get());
+ }
+
+ T const & get() const
+ {
+ if (fg == 0)
+ {
+ throw PropertyReadException();
+ }
+ return(fg());
+ }
+
+ T & get()
+ {
+ if (fg == 0)
+ {
+ throw PropertyReadException();
+ }
+ return(fg());
+ }
+
+ private:
+
+ boost::function<T & ()> fg;
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyCallableValue.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyCallableValue.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,509 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyTag.h"
+#include "PropertyException.h"
+#include "PropertyOperators.h"
+#include <boost/function.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/mpl/if.hpp>
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T,
+ class Access = typename boost::mpl::if_
+ <
+ boost::is_const<T>,
+ ReadTag,
+ ReadWriteTag
+ >::type
+ >
+ class propCallable;
+
+ template <class T>
+ class propCallable<T,ReadTag> :
+ public virtual IPropertyRead<T>
+ {
+
+ public:
+
+ explicit propCallable(boost::function<T ()> g) :
+ fg(g)
+ {
+ }
+
+ operator T() const
+ {
+ return(get());
+ }
+
+ T get() const
+ {
+ if (fg == 0)
+ {
+ throw PropertyReadException();
+ }
+ return(fg());
+ }
+
+ private:
+
+ boost::function<T ()> fg;
+
+ propCallable & operator = (const propCallable & arg);
+
+ };
+
+ template <class T>
+ class propCallable<T,WriteTag> :
+ public virtual IPropertyWrite<T>
+ {
+
+ public:
+
+ explicit propCallable(boost::function<void (T)> s) :
+ fs(s)
+ {
+ }
+
+ propCallable(boost::function<void (T)> s,T arg) :
+ fs(s)
+ {
+ if (fs == 0)
+ {
+ throw PropertyWriteException();
+ }
+ fs(arg);
+ }
+
+ template<class U>
+ propCallable(boost::function<void (T)> s,U arg) :
+ fs(s)
+ {
+ if (fs == 0)
+ {
+ throw PropertyWriteException();
+ }
+ fs(static_cast<T>(arg));
+ }
+
+ propCallable & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propCallable & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (fs == 0)
+ {
+ throw PropertyWriteException();
+ }
+ fs(arg);
+ }
+
+ private:
+
+ boost::function<void (T)> fs;
+
+ propCallable & operator = (const propCallable & arg);
+
+ };
+
+ template <class T>
+ struct propCallable<T,ReadWriteTag> :
+ propCallable<T,ReadTag>,
+ propCallable<T,WriteTag>,
+ IPropertyReadWrite<T>
+ {
+
+ propCallable(const propCallable & arg) :
+ propCallable<T,ReadTag>(arg),
+ propCallable<T,WriteTag>(static_cast<const propCallable<T,WriteTag> &>(arg))
+ {
+ }
+
+ propCallable(boost::function<T ()> g,boost::function<void (T)> s) :
+ propCallable<T,ReadTag>(g),
+ propCallable<T,WriteTag>(s)
+ {
+ }
+
+ propCallable(boost::function<T ()> g,boost::function<void (T)> s,T arg) :
+ propCallable<T,ReadTag>(g),
+ propCallable<T,WriteTag>(s,arg)
+ {
+ }
+
+ template<class U>
+ propCallable(boost::function<T ()> g,boost::function<void (T)> s,U arg) :
+ propCallable<T,ReadTag>(g),
+ propCallable<T,WriteTag>(s,arg)
+ {
+ }
+
+ propCallable & operator = (const propCallable & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propCallable & operator = (T arg)
+ {
+ (static_cast<propCallable<T,WriteTag> &>(*this)) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propCallable & operator = (U arg)
+ {
+ (static_cast<propCallable<T,WriteTag> &>(*this)) = arg;
+ return(*this);
+ }
+
+ };
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator ++ (propCallable<T,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator -- (propCallable<T,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator *= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator *= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator /= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator /= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator %= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator %= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator += (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator += (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator -= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator -= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator <<= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator <<= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator >>= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator >>= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator &= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator &= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator ^= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator ^= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator |= (propCallable<T,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propCallable<T,ReadWriteTag> &
+ >::type
+operator |= (propCallable<T,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyClass.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyClass.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,25 @@
+#pragma once
+#include "Property.h"
+
+class PropertyClass
+{
+ public:
+
+ PropertyClass();
+ virtual ~PropertyClass();
+
+ private:
+
+ int pi;
+
+ public:
+
+ int ReturnPi();
+ void SetPiValue(int val);
+
+ public:
+
+ properties::PropertyMemberFunction<int,PropertyClass,&PropertyClass::ReturnPi,&PropertyClass::SetPiValue> IntMem;
+ properties::PropertyReadMemberFunction<int,PropertyClass,&PropertyClass::ReturnPi> IntMemNoWrite;
+
+};

Added: sandbox/property/boost/property/PropertyData.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyData.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "PropertyDataValue.h"
+#include "PropertyDataPredicate.h"
+#include "PropertyDataReference.h"

Added: sandbox/property/boost/property/PropertyDataPredicate.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyDataPredicate.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,632 @@
+#pragma once
+
+#include "PropertyTag.h"
+#include "PropertyDataValue.h"
+#include "PropertyOperators.h"
+#include <boost/function.hpp>
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+ template <class T,
+ T *d,
+ template <class> class NotificationPolicy = DefaultPolicyTag,
+ template <class> class PredicateFailurePolicy = DefaultPolicyTag,
+ class Access = ReadWriteTag
+ >
+ class propDataPredicate;
+
+ template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+ struct propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,WriteTag> :
+ propData<T,d,NotificationPolicy,WriteTag>,
+ PredicateFailurePolicy<T>
+ {
+
+ explicit propDataPredicate(boost::function<bool (T)> f) :
+ fs(f)
+ {
+ }
+
+ propDataPredicate(const propDataPredicate & arg) :
+ propData<T,d,NotificationPolicy,WriteTag>(static_cast<const propData<T,d,NotificationPolicy,WriteTag> &>(arg)),
+ fs(arg.fs)
+ {
+ }
+
+ propDataPredicate(boost::function<bool (T)> f,T arg) :
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ *d = arg;
+ }
+ }
+
+ template<class U>
+ propDataPredicate(boost::function<bool (T)> f,U arg) :
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ *d = static_cast<T>(arg);
+ }
+ }
+
+ propDataPredicate & operator = (T arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,WriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propDataPredicate & operator = (U arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,WriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propData<T,d,NotificationPolicy,WriteTag>::set(arg);
+ }
+ else
+ {
+ PredicateFailure(*this,fs,boost::optional<T>(),arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ propDataPredicate & operator = (const propDataPredicate & arg);
+
+ };
+
+ template <class T, T *d,template <class> class NotificationPolicy>
+ struct propDataPredicate<T,d,NotificationPolicy,DefaultPolicyTag,WriteTag> :
+ propData<T,d,NotificationPolicy,WriteTag>
+ {
+
+ explicit propDataPredicate(boost::function<bool (T)> f) :
+ fs(f)
+ {
+ }
+
+ propDataPredicate(const propDataPredicate & arg) :
+ propData<T,d,NotificationPolicy,WriteTag>(static_cast<const propData<T,d,NotificationPolicy,WriteTag> &>(arg)),
+ fs(arg.fs)
+ {
+ }
+
+ propDataPredicate(boost::function<bool (T)> f,T arg) :
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ *d = arg;
+ }
+ }
+
+ template<class U>
+ propDataPredicate(boost::function<bool (T)> f,U arg) :
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ *d = static_cast<T>(arg);
+ }
+ }
+
+ propDataPredicate & operator = (T arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,WriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propDataPredicate & operator = (U arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,WriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propData<T,d,NotificationPolicy,WriteTag>::set(arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ propDataPredicate & operator = (const propDataPredicate & arg);
+
+ };
+
+ template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+ struct propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> :
+ propData<T,d,NotificationPolicy,ReadWriteTag>,
+ PredicateFailurePolicy<T>
+ {
+
+ explicit propDataPredicate(boost::function<bool (T)> f) :
+ fs(f)
+ {
+ }
+
+ propDataPredicate(const propDataPredicate & arg) :
+ propData<T,d,NotificationPolicy,ReadWriteTag>(static_cast<const propData<T,d,NotificationPolicy,ReadWriteTag> &>(arg)),
+ fs(arg.fs)
+ {
+ }
+
+ propDataPredicate(boost::function<bool (T)> f,T arg) :
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ *d = arg;
+ }
+ }
+
+ template<class U>
+ propDataPredicate(boost::function<bool (T)> f,U arg) :
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ *d = static_cast<T>(arg);
+ }
+ }
+
+ propDataPredicate & operator = (const propDataPredicate & arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,ReadWriteTag> &>(*this) = static_cast<const propData<T,d,NotificationPolicy,ReadWriteTag> &>(arg);
+ return(*this);
+ }
+
+ propDataPredicate & operator = (T arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,ReadWriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propDataPredicate & operator = (U arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,ReadWriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propData<T,d,NotificationPolicy,ReadWriteTag>::set(arg);
+ }
+ else
+ {
+
+ T t(*this);
+
+ PredicateFailure(*this,fs,boost::optional<T>(t),arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ };
+
+ template <class T, T *d,template <class> class NotificationPolicy>
+ struct propDataPredicate<T,d,NotificationPolicy,DefaultPolicyTag,ReadWriteTag> :
+ propData<T,d,NotificationPolicy,ReadWriteTag>
+ {
+
+ explicit propDataPredicate(boost::function<bool (T)> f) :
+ fs(f)
+ {
+ }
+
+ propDataPredicate(const propDataPredicate & arg) :
+ propData<T,d,NotificationPolicy,ReadWriteTag>(static_cast<const propData<T,d,NotificationPolicy,ReadWriteTag> &>(arg)),
+ fs(arg.fs)
+ {
+ }
+
+ propDataPredicate(boost::function<bool (T)> f,T arg) :
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ *d = arg;
+ }
+ }
+
+ template<class U>
+ propDataPredicate(boost::function<bool (T)> f,U arg) :
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ *d = static_cast<T>(arg);
+ }
+ }
+
+ propDataPredicate & operator = (const propDataPredicate & arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,ReadWriteTag> &>(*this) = static_cast<const propData<T,d,NotificationPolicy,ReadWriteTag> &>(arg);
+ return(*this);
+ }
+
+ propDataPredicate & operator = (T arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,ReadWriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propDataPredicate & operator = (U arg)
+ {
+ static_cast<propData<T,d,NotificationPolicy,ReadWriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propData<T,d,NotificationPolicy,ReadWriteTag>::set(arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ };
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator ++ (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator -- (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator *= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator *= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator /= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator /= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator %= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator %= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator += (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator += (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator -= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator -= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator <<= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator <<= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator >>= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator >>= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator &= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator &= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator ^= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator ^= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator |= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator |= (propDataPredicate<T,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyDataReference.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyDataReference.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,35 @@
+#pragma once
+
+#include "PropertyReferenceInterface.h"
+
+namespace properties
+{
+
+ template <class T, T *d>
+ struct propDataReference :
+ IPropertyReferenceRead<T>
+ {
+
+ operator const T & () const
+ {
+ return(get());
+ }
+
+ operator T & ()
+ {
+ return(get());
+ }
+
+ const T & get() const
+ {
+ return(*d);
+ }
+
+ T & get()
+ {
+ return(*d);
+ }
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyDataValue.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyDataValue.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,577 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyTag.h"
+#include "PropertyException.h"
+#include "PropertyOperators.h"
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/optional.hpp>
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T,
+ T *d,
+ template <class> class NotificationPolicy = DefaultPolicyTag,
+ class Access = typename boost::mpl::if_
+ <
+ boost::is_const<T>,
+ ReadTag,
+ ReadWriteTag
+ >::type
+ >
+ class propData;
+
+ template <class T, T *d>
+ struct propData<T,d,DefaultPolicyTag,ReadTag> :
+ virtual IPropertyRead<T>
+ {
+
+ operator T() const
+ {
+ return(get());
+ }
+
+ T get() const
+ {
+ return(*d);
+ }
+
+ private:
+
+ propData & operator = (const propData &);
+
+ };
+
+ template <class T, T *d>
+ struct propData<T,d,DefaultPolicyTag,WriteTag> :
+ virtual IPropertyWrite<T>
+ {
+
+ propData()
+ {
+ }
+
+ explicit propData(T arg)
+ {
+ *d = arg;
+ }
+
+ template<class U>
+ explicit propData(U arg)
+ {
+ *d = static_cast<T>(arg);
+ }
+
+ propData & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propData & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ *d = arg;
+ }
+
+ private:
+
+ propData & operator = (const propData &);
+
+ };
+
+ template <class T, T *d,template <class> class NotificationPolicy>
+ struct propData<T,d,NotificationPolicy,WriteTag> :
+ virtual IPropertyWrite<T>,
+ NotificationPolicy<T>
+ {
+
+ propData()
+ {
+ }
+
+ explicit propData(T arg)
+ {
+ *d = arg;
+ }
+
+ template<class U>
+ explicit propData(U arg)
+ {
+ *d = static_cast<T>(arg);
+ }
+
+ propData & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propData & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ *d = arg;
+ PropertyChanged(*this,oldT,arg);
+ }
+
+ protected:
+
+ boost::optional<T> oldT;
+
+ private:
+
+ propData & operator = (const propData &);
+
+ };
+
+ template <class T, T *d>
+ struct propData<T,d,DefaultPolicyTag,ReadWriteTag> :
+ propData<T,d,DefaultPolicyTag,ReadTag> ,
+ propData<T,d,DefaultPolicyTag,WriteTag>,
+ IPropertyReadWrite<T>
+ {
+
+ propData()
+ {
+ }
+
+ propData(const propData & arg) :
+ propData<T,d,DefaultPolicyTag,ReadTag>(arg),
+ propData<T,d,DefaultPolicyTag,WriteTag>(static_cast<const propData<T,d,DefaultPolicyTag,WriteTag> &>(arg))
+ {
+ }
+
+ explicit propData(T arg) :
+ propData<T,d,DefaultPolicyTag,WriteTag>(arg)
+ {
+ }
+
+ template<class U>
+ explicit propData(U arg) :
+ propData<T,d,DefaultPolicyTag,WriteTag>(arg)
+ {
+ }
+
+ propData & operator = (const propData & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propData & operator = (T arg)
+ {
+ (static_cast<propData<T,d,DefaultPolicyTag,WriteTag> & >(*this)) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propData & operator = (U arg)
+ {
+ (static_cast<propData<T,d,DefaultPolicyTag,WriteTag> & >(*this)) = arg;
+ return(*this);
+ }
+
+ };
+
+ template <class T, T *d,template <class> class NotificationPolicy>
+ struct propData<T,d,NotificationPolicy,ReadWriteTag> :
+ propData<T,d,NotificationPolicy,ReadTag> ,
+ propData<T,d,NotificationPolicy,WriteTag>,
+ IPropertyReadWrite<T>
+ {
+
+ propData()
+ {
+ }
+
+ propData(const propData & arg) :
+ propData<T,d,DefaultPolicyTag,ReadTag>(arg),
+ propData<T,d,NotificationPolicy,WriteTag>(static_cast<const propData<T,d,NotificationPolicy,WriteTag> &>(arg))
+ {
+ }
+
+ explicit propData(T arg) :
+ propData<T,d,NotificationPolicy,WriteTag>(arg)
+ {
+ }
+
+ template<class U>
+ explicit propData(U arg) :
+ propData<T,d,NotificationPolicy,WriteTag>(arg)
+ {
+ }
+
+ propData & operator = (const propData & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propData & operator = (T arg)
+ {
+ oldT = *this;
+ (static_cast<propData<T,d,NotificationPolicy,WriteTag> & >(*this)) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propData & operator = (U arg)
+ {
+ oldT = *this;
+ (static_cast<propData<T,d,NotificationPolicy,WriteTag> & >(*this)) = arg;
+ return(*this);
+ }
+
+ };
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ++ (propData<T,d,NotificationPolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -- (propData<T,d,NotificationPolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator *= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator *= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator /= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator /= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator %= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator %= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator += (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator += (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator <<= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator <<= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator >>= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator >>= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator &= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator &= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ^= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ^= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator |= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, T *d,template <class> class NotificationPolicy,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propData<T,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator |= (propData<T,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyException.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyException.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <stdexcept>
+
+namespace properties
+{
+
+ class PropertyReadException : std::runtime_error
+ {
+
+ public:
+
+ PropertyReadException() : std::runtime_error("") { }
+ };
+
+ class PropertyWriteException : std::runtime_error
+ {
+
+ public:
+
+ PropertyWriteException() : std::runtime_error("") { }
+ };
+
+ class PropertyIndexException : std::runtime_error
+ {
+
+ public:
+
+ PropertyIndexException() : std::runtime_error("") { }
+ };
+
+}

Added: sandbox/property/boost/property/PropertyFunction.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyFunction.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,4 @@
+#pragma once
+
+#include "PropertyFunctionValue.h"
+#include "PropertyFunctionReference.h"

Added: sandbox/property/boost/property/PropertyFunctionReference.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyFunctionReference.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "PropertyReferenceInterface.h"
+#include "PropertyException.h"
+
+namespace properties
+{
+
+ template <class T, T & (*g)()>
+ struct propFunctionReference :
+ IPropertyReferenceRead<T>
+ {
+
+ operator T const & () const
+ {
+ return(get());
+ }
+
+ operator T & ()
+ {
+ return(get());
+ }
+
+ T const & get() const
+ {
+ if (g == 0)
+ {
+ throw PropertyReadException();
+ }
+ return((*g)());
+ }
+
+ T & get()
+ {
+ if (g == 0)
+ {
+ throw PropertyReadException();
+ }
+ return((*g)());
+ }
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyFunctionValue.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyFunctionValue.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,545 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyTag.h"
+#include "PropertyException.h"
+#include "PropertyOperators.h"
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T, T (*g)()>
+ struct propReadFunction :
+ virtual IPropertyRead<T>
+ {
+
+ operator T() const
+ {
+ return(get());
+ }
+
+ T get() const
+ {
+ if (g == 0)
+ {
+ throw PropertyReadException();
+ }
+ return((*g)());
+ }
+
+ private:
+
+ propReadFunction & operator = (const propReadFunction &);
+
+ };
+
+ template <class T,
+ void (*s)(T)
+ >
+ struct propWriteFunction :
+ virtual IPropertyWrite<T>
+ {
+
+ propWriteFunction()
+ {
+ }
+
+ explicit propWriteFunction(T arg)
+ {
+ if (s == 0)
+ {
+ throw PropertyWriteException();
+ }
+ (*s)(arg);
+ }
+
+ template<class U>
+ explicit propWriteFunction(U arg)
+ {
+ if (s == 0)
+ {
+ throw PropertyWriteException();
+ }
+ (*s)(static_cast<T>(arg));
+ }
+
+ propWriteFunction & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propWriteFunction & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (s == 0)
+ {
+ throw PropertyWriteException();
+ }
+ (*s)(arg);
+ }
+
+ private:
+
+ propWriteFunction & operator = (const propWriteFunction &);
+
+ };
+
+
+ template <class T, T (*g)(), void (*s)(T)>
+ struct propFunction :
+ propReadFunction<T,g>,
+ propWriteFunction<T,s>
+ {
+
+ propFunction()
+ {
+ }
+
+ explicit propFunction(T arg) :
+ propWriteFunction<T,s>(arg)
+ {
+ }
+
+ propFunction(const propFunction & arg) :
+ propReadFunction<T,g>(arg),
+ propWriteFunction<T,s>(static_cast<const propWriteFunction<T,s> &>(arg))
+ {
+ }
+
+ template<class U>
+ explicit propFunction(U arg) :
+ propWriteFunction<T,s>(arg)
+ {
+ }
+
+ propFunction & operator = (const propFunction & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propFunction & operator = (T arg)
+ {
+ (static_cast<propWriteFunction<T,s> &>(*this)) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propFunction & operator = (U arg)
+ {
+ (static_cast<propWriteFunction<T,s> &>(*this)) = arg;
+ return(*this);
+ }
+
+ };
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator ++ (propFunction<T,g,s> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator -- (propFunction<T,g,s> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator *= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator *= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator /= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator /= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator %= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator %= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator += (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator += (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator -= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator -= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator <<= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator <<= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator >>= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator >>= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator &= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator &= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator ^= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator ^= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propFunction<T,g,s> &
+ >::type
+operator |= (propFunction<T,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ T (*g)(),
+ void (*s)(T),
+ class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propFunction<T,g,s> &
+ >::type
+operator |= (propFunction<T,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyFunctor.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyFunctor.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,4 @@
+#pragma once
+
+#include "PropertyFunctorValue.h"
+#include "PropertyFunctorReference.h"

Added: sandbox/property/boost/property/PropertyFunctorReference.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyFunctorReference.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,46 @@
+#pragma once
+
+#include "PropertyReferenceInterface.h"
+
+namespace properties
+{
+
+ template <class T, class C>
+ class propFunctorReference :
+ public IPropertyReferenceRead<T>
+ {
+
+ public:
+
+ propFunctorReference(C & c) :
+ cf(c)
+ {
+ }
+
+ operator T const & () const
+ {
+ return(get());
+ }
+
+ operator T & ()
+ {
+ return(get());
+ }
+
+ T const & get() const
+ {
+ return(cf());
+ }
+
+ T & get() const
+ {
+ return(cf());
+ }
+
+ private:
+
+ C & cf;
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyFunctorValue.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyFunctorValue.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,492 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyTag.h"
+#include "PropertyOperators.h"
+#include <boost/type_traits/is_const.hpp>
+#include <boost/mpl/if.hpp>
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T,
+ class C,
+ class Access = typename boost::mpl::if_
+ <
+ boost::is_const<T>,
+ ReadTag,
+ ReadWriteTag
+ >::type
+ >
+ class propFunctor;
+
+ template <class T, class C>
+ class propFunctor<T,C,ReadTag> :
+ public virtual IPropertyRead<T>
+ {
+
+ public:
+
+ explicit propFunctor(C & c) : cf(c)
+ {
+ }
+
+ operator T() const
+ {
+ return(get());
+ }
+
+ T get() const
+ {
+ return(cf());
+ }
+
+ private:
+
+ C & cf;
+
+ propFunctor & operator = (const propFunctor &);
+
+ };
+
+ template <class T, class C>
+ class propFunctor<T,C,WriteTag> :
+ public virtual IPropertyWrite<T>
+ {
+
+ public:
+
+ explicit propFunctor(C & c) :
+ cf(c)
+ {
+ }
+
+ propFunctor(C & c,T arg) :
+ cf(c)
+ {
+ cf(arg);
+ }
+
+ template<class U>
+ propFunctor(C & c,U arg) :
+ cf(c)
+ {
+ cf(static_cast<T>(arg));
+ }
+
+ propFunctor & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propFunctor & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ cf(arg);
+ }
+
+ private:
+
+ C & cf;
+
+ propFunctor & operator = (const propFunctor &);
+
+ };
+
+ template <class T, class C>
+ struct propFunctor<T,C,ReadWriteTag> :
+ propFunctor<T,C,ReadTag>,
+ propFunctor<T,C,WriteTag>,
+ IPropertyReadWrite<T>
+ {
+
+ explicit propFunctor(C & c) :
+ propFunctor<T,C,ReadTag>(c),
+ propFunctor<T,C,WriteTag>(c)
+ {
+ }
+
+ propFunctor(const propFunctor & arg) :
+ propFunctor<T,C,ReadTag>(arg),
+ propFunctor<T,C,WriteTag>(static_cast<const propFunctor<T,C,WriteTag> &>(arg))
+ {
+ }
+
+ propFunctor(C & c,T arg) :
+ propFunctor<T,C,ReadTag>(c) ,
+ propFunctor<T,C,WriteTag>(c,arg)
+ {
+ }
+
+ template<class U>
+ propFunctor(C & c,U arg) :
+ propFunctor<T,C,ReadTag>(c),
+ propFunctor<T,C,WriteTag>(c,arg)
+ {
+ }
+
+ propFunctor & operator = (const propFunctor & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propFunctor & operator = (T arg)
+ {
+ (static_cast<propFunctor<T,C,WriteTag> & >(*this)) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propFunctor & operator = (U arg)
+ {
+ (static_cast<propFunctor<T,C,WriteTag> & >(*this)) = arg;
+ return(*this);
+ }
+
+ };
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator ++ (propFunctor<T,C,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator -- (propFunctor<T,C,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator *= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator *= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator /= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator /= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator %= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator %= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator += (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator += (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator -= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator -= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator <<= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator <<= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator >>= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator >>= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator &= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator &= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator ^= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator ^= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator |= (propFunctor<T,C,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propFunctor<T,C,ReadWriteTag> &
+ >::type
+operator |= (propFunctor<T,C,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyGlobalFunctions.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyGlobalFunctions.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,8 @@
+#pragma once
+
+class PropertyGlobalFunctions
+{
+public:
+ PropertyGlobalFunctions(void);
+ ~PropertyGlobalFunctions(void);
+};

Added: sandbox/property/boost/property/PropertyIndexInterface.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyIndexInterface.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,47 @@
+#pragma once
+
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/is_const.hpp>
+
+namespace properties
+{
+
+ template <class T,class I>
+ struct IPropertyIndexRead
+ {
+
+ BOOST_MPL_ASSERT_NOT((boost::is_reference<T>));
+
+ virtual T get(I) const = 0;
+
+ };
+
+ template <class T,class I>
+ struct IPropertyIndexWrite
+ {
+
+ BOOST_MPL_ASSERT_NOT((boost::is_reference<T>));
+ BOOST_MPL_ASSERT_NOT((boost::is_const<T>));
+
+ virtual void set(I,T) = 0;
+
+ };
+
+ template <class T,class I,class R>
+ struct IPropertyIndexReadWriteLValue : IPropertyIndexRead<T,I>, public IPropertyIndexWrite<T,I>
+ {
+
+ virtual R operator [] (I) = 0;
+
+ };
+
+ template <class T,class I,class R>
+ struct IPropertyIndexReadImmutable : IPropertyIndexRead<T,I>
+ {
+
+ virtual R operator [] (I) const = 0;
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyIndexMap.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyIndexMap.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "detail/PropertyIndexMapDetail.h"
+
+namespace properties
+{
+
+ template <class PMAP>
+ struct PropertyIndexMap :
+ detail::PropertyIndexMapMakeBase<PMAP>::type
+ {
+
+ PropertyIndexMap(PMAP & pmap) :
+ detail::PropertyIndexMapMakeBase<PMAP>::type(pmap)
+ {
+ }
+
+ private:
+
+ PropertyIndexMap(const PropertyIndexMap<PMAP> &);
+ PropertyIndexMap & operator = (const PropertyIndexMap<PMAP> &);
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyInterface.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyInterface.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/is_const.hpp>
+
+namespace properties
+{
+
+ template <class T>
+ struct IPropertyRead
+ {
+
+ BOOST_MPL_ASSERT_NOT((boost::is_reference<T>));
+
+ virtual T get() const = 0;
+
+ };
+
+ template <class T>
+ struct IPropertyWrite
+ {
+
+ BOOST_MPL_ASSERT_NOT((boost::is_reference<T>));
+ BOOST_MPL_ASSERT_NOT((boost::is_const<T>));
+
+ virtual void set(T) = 0;
+
+ };
+
+ template <class T>
+ struct IPropertyReadWrite :
+ virtual IPropertyRead<T>,
+ virtual IPropertyWrite<T>
+ {
+
+ BOOST_MPL_ASSERT_NOT((boost::is_reference<T>));
+ BOOST_MPL_ASSERT_NOT((boost::is_const<T>));
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyMemberData.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyMemberData.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "PropertyMemberDataValue.h"
+#include "PropertyMemberDataReference.h"
+#include "PropertyMemberDataPredicate.h"

Added: sandbox/property/boost/property/PropertyMemberDataPredicate.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyMemberDataPredicate.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,646 @@
+#pragma once
+
+#include "PropertyTag.h"
+#include "PropertyMemberDataValue.h"
+#include "PropertyOperators.h"
+#include <boost/function.hpp>
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T,
+ class C,
+ T C::*d,
+ template <class> class NotificationPolicy = DefaultPolicyTag,
+ template <class> class PredicateFailurePolicy = DefaultPolicyTag,
+ class Access = ReadWriteTag
+ >
+ class propMemberDataPredicate;
+
+ template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+ struct propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,WriteTag> :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>,
+ PredicateFailurePolicy<T>
+ {
+
+ propMemberDataPredicate(const propMemberDataPredicate & arg) :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(static_cast<const propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(arg)),
+ fs(f)
+ {
+ }
+
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c) :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c),
+ fs(f)
+ {
+ }
+
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c,T arg) :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c),
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ c.*d = arg;
+ }
+ }
+
+ template<class U>
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c,U arg) :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c),
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ c.*d = static_cast<T>(arg);
+ }
+ }
+
+ propMemberDataPredicate & operator = (T arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propMemberDataPredicate & operator = (U arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>::set(arg);
+ }
+ else
+ {
+ PredicateFailure(*this,fs,boost::optional<T>(),arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ propMemberDataPredicate & operator = (const propMemberDataPredicate & arg);
+
+ };
+
+ template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+ struct propMemberDataPredicate<T,C,d,NotificationPolicy,DefaultPolicyTag,WriteTag> :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>
+ {
+
+ propMemberDataPredicate(const propMemberDataPredicate & arg) :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(static_cast<const propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(arg)),
+ fs(f)
+ {
+ }
+
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c) :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c),
+ fs(f)
+ {
+ }
+
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c,T arg) :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c),
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ c.*d = arg;
+ }
+ }
+
+ template<class U>
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c,U arg) :
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c),
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ c.*d = static_cast<T>(arg);
+ }
+ }
+
+ propMemberDataPredicate & operator = (T arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propMemberDataPredicate & operator = (U arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>::set(arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ propMemberDataPredicate & operator = (const propMemberDataPredicate & arg);
+
+ };
+
+ template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+ struct propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>,
+ PredicateFailurePolicy<T>
+ {
+
+ propMemberDataPredicate(const propMemberDataPredicate & arg) :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>(static_cast<const propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(arg)),
+ fs(f)
+ {
+ }
+
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c) :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>(c),
+ fs(f)
+ {
+ }
+
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c,T arg) :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>(c),
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ c.*d = arg;
+ }
+ }
+
+ template<class U>
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c,U arg) :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>(c),
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ c.*d = static_cast<T>(arg);
+ }
+ }
+
+ propMemberDataPredicate & operator = (const propMemberDataPredicate & arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(*this) = static_cast<const propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(arg);
+ return(*this);
+ }
+
+ propMemberDataPredicate & operator = (T arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propMemberDataPredicate & operator = (U arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>::set(arg);
+ }
+ else
+ {
+
+ T t(*this);
+
+ PredicateFailure(*this,fs,boost::optional<T>(t),arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ };
+
+ template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+ struct propMemberDataPredicate<T,C,d,NotificationPolicy,DefaultPolicyTag,ReadWriteTag> :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>
+ {
+
+ propMemberDataPredicate(const propMemberDataPredicate & arg) :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>(static_cast<const propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(arg)),
+ fs(f)
+ {
+ }
+
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c) :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>(c),
+ fs(f)
+ {
+ }
+
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c,T arg) :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>(c),
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ c.*d = arg;
+ }
+ }
+
+ template<class U>
+ propMemberDataPredicate(boost::function<bool (T)> f,C & c,U arg) :
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>(c),
+ fs(f)
+ {
+ if (!fs || fs(arg))
+ {
+ c.*d = static_cast<T>(arg);
+ }
+ }
+
+ propMemberDataPredicate & operator = (const propMemberDataPredicate & arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(*this) = static_cast<const propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(arg);
+ return(*this);
+ }
+
+ propMemberDataPredicate & operator = (T arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propMemberDataPredicate & operator = (U arg)
+ {
+ static_cast<propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &>(*this) = arg;
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (!fs || fs(arg))
+ {
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag>::set(arg);
+ }
+ }
+
+ private:
+
+ boost::function<bool (T)> fs;
+
+ };
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator ++ (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator -- (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator *= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator *= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator /= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator /= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator %= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator %= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator += (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator += (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator -= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator -= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator <<= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator <<= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator >>= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator >>= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator &= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator &= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator ^= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator ^= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator |= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy,template <class> class PredicateFailurePolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> &
+ >::type
+operator |= (propMemberDataPredicate<T,C,d,NotificationPolicy,PredicateFailurePolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyMemberDataReference.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyMemberDataReference.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,45 @@
+#pragma once
+
+#include "PropertyReferenceInterface.h"
+
+namespace properties
+{
+
+ template <class T, class C, T C::*d>
+ class propMemberDataReference :
+ public IPropertyReferenceRead<T>
+ {
+ public:
+
+ propMemberDataReference(C & c) :
+ cf(c)
+ {
+ }
+
+ operator T const & () const
+ {
+ return(get());
+ }
+
+ operator T & ()
+ {
+ return(get());
+ }
+
+ T const & get() const
+ {
+ return(cf.*d);
+ }
+
+ T & get()
+ {
+ return(cf.*d);
+ }
+
+ private:
+
+ C & cf;
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyMemberDataValue.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyMemberDataValue.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,606 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyTag.h"
+#include "PropertyOperators.h"
+#include <boost/type_traits/is_const.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/optional.hpp>
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T,
+ class C,
+ T C::*d,
+ template <class> class NotificationPolicy = DefaultPolicyTag,
+ class Access = typename boost::mpl::if_
+ <
+ boost::is_const<T>,
+ ReadTag,
+ ReadWriteTag
+ >::type
+ >
+ class propMemberData;
+
+ template <class T, class C, T C::*d>
+ class propMemberData<T,C,d,DefaultPolicyTag,ReadTag> :
+ public virtual IPropertyRead<T>
+ {
+ public:
+
+ explicit propMemberData(C & c) :
+ cf(c)
+ {
+ }
+
+ operator T() const
+ {
+ return(get());
+ }
+
+ T get() const
+ {
+ return(cf.*d);
+ }
+
+ private:
+
+ C & cf;
+
+ propMemberData & operator = (const propMemberData &);
+
+ };
+
+ template <class T, class C, T C::*d>
+ class propMemberData<T,C,d,DefaultPolicyTag,WriteTag> :
+ public virtual IPropertyWrite<T>
+ {
+ public:
+
+ explicit propMemberData(C & c) :
+ cf(c)
+ {
+ }
+
+ propMemberData(C & c,T arg) :
+ cf(c)
+ {
+ cf.*d = arg;
+ }
+
+ template<class U>
+ propMemberData(C & c,U arg) :
+ cf(c)
+ {
+ cf.*d = static_cast<T>(arg);
+ }
+
+ propMemberData & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propMemberData & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ cf.*d = arg;
+ }
+
+ private:
+
+ C & cf;
+
+ propMemberData & operator = (const propMemberData &);
+
+ };
+
+ template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+ class propMemberData<T,C,d,NotificationPolicy,WriteTag> :
+ public virtual IPropertyWrite<T>,
+ public NotificationPolicy<T>
+ {
+ public:
+
+ explicit propMemberData(C & c) :
+ cf(c)
+ {
+ }
+
+ propMemberData(C & c,T arg) :
+ cf(c)
+ {
+ cf.*d = arg;
+ }
+
+ template<class U>
+ propMemberData(C & c,U arg) :
+ cf(c)
+ {
+ cf.*d = static_cast<T>(arg);
+ }
+
+ propMemberData & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propMemberData & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ cf.*d = arg;
+ PropertyChanged(*this,oldT,arg);
+ }
+
+ private:
+
+ C & cf;
+
+ protected:
+
+ boost::optional<T> oldT;
+
+ propMemberData & operator = (const propMemberData &);
+
+ };
+
+ template <class T, class C, T C::*d>
+ struct propMemberData<T,C,d,DefaultPolicyTag,ReadWriteTag> :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>,
+ propMemberData<T,C,d,DefaultPolicyTag,WriteTag>,
+ IPropertyReadWrite<T>
+ {
+ public:
+
+ explicit propMemberData(C & c) :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>(c) ,
+ propMemberData<T,C,d,DefaultPolicyTag,WriteTag>(c)
+ {
+ }
+
+ propMemberData(const propMemberData & arg) :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>(arg) ,
+ propMemberData<T,C,d,DefaultPolicyTag,WriteTag>(static_cast<const propMemberData<T,C,d,DefaultPolicyTag,WriteTag> &>(arg))
+ {
+ }
+
+ propMemberData(C & c,T arg) :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>(c) ,
+ propMemberData<T,C,d,DefaultPolicyTag,WriteTag>(c,arg)
+ {
+ }
+
+ template<class U>
+ propMemberData(C & c,U arg) :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>(c),
+ propMemberData<T,C,d,DefaultPolicyTag,WriteTag>(c,arg)
+ {
+ }
+
+ propMemberData & operator = (const propMemberData & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propMemberData & operator = (T arg)
+ {
+ (static_cast<propMemberData<T,C,d,DefaultPolicyTag,WriteTag> &>(*this)) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propMemberData & operator = (U arg)
+ {
+ (static_cast<propMemberData<T,C,d,DefaultPolicyTag,WriteTag> &>(*this)) = arg;
+ return(*this);
+ }
+
+ };
+
+ template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+ struct propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>,
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>,
+ IPropertyReadWrite<T>
+ {
+ public:
+
+ explicit propMemberData(C & c) :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>(c),
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c)
+ {
+ }
+
+ propMemberData(const propMemberData & arg) :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>(arg),
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(static_cast<const propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(arg))
+ {
+ }
+
+ propMemberData(C & c,T arg) :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>(c),
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c,arg)
+ {
+ }
+
+ template<class U>
+ propMemberData(C & c,U arg) :
+ propMemberData<T,C,d,DefaultPolicyTag,ReadTag>(c) ,
+ propMemberData<T,C,d,NotificationPolicy,WriteTag>(c,arg)
+ {
+ }
+
+ propMemberData & operator = (const propMemberData & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propMemberData & operator = (T arg)
+ {
+ oldT = *this;
+ (static_cast<propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(*this)) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propMemberData & operator = (U arg)
+ {
+ oldT = *this;
+ (static_cast<propMemberData<T,C,d,NotificationPolicy,WriteTag> &>(*this)) = arg;
+ return(*this);
+ }
+
+ };
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ++ (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -- (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator *= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator *= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator /= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator /= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator %= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator %= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator += (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator += (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator -= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator <<= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator <<= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator >>= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator >>= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator &= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator &= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ^= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator ^= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator |= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T, class C, T C::*d,template <class> class NotificationPolicy, class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> &
+ >::type
+operator |= (propMemberData<T,C,d,NotificationPolicy,ReadWriteTag> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyMemberFunction.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyMemberFunction.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,4 @@
+#pragma once
+
+#include "PropertyMemberFunctionValue.h"
+#include "PropertyMemberFunctionReference.h"

Added: sandbox/property/boost/property/PropertyMemberFunctionReference.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyMemberFunctionReference.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,54 @@
+#pragma once
+
+#include "PropertyReferenceInterface.h"
+#include "PropertyException.h"
+
+namespace properties
+{
+
+ template <class T, class C, T & (C::*g)()>
+ class propMemberFunctionReference :
+ public IPropertyReferenceRead<T>
+ {
+ public:
+
+ propMemberFunctionReference(C & c) :
+ cf(c)
+ {
+ }
+
+ operator T const & () const
+ {
+ return(get());
+ }
+
+ operator T & ()
+ {
+ return(get());
+ }
+
+ T const & get() const
+ {
+ if (g == 0)
+ {
+ throw PropertyReadException();
+ }
+ return((cf.*g)());
+ }
+
+ T & get()
+ {
+ if (g == 0)
+ {
+ throw PropertyReadException();
+ }
+ return((cf.*g)());
+ }
+
+ private:
+
+ C & cf;
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyMemberFunctionValue.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyMemberFunctionValue.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,592 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyTag.h"
+#include "PropertyException.h"
+#include "PropertyOperators.h"
+
+#pragma warning (push)
+#pragma warning (disable: 4250)
+
+namespace properties
+{
+
+ template <class T, class C, T (C::*g)()>
+ class propReadMemberFunction :
+ public virtual IPropertyRead<T>
+ {
+ public:
+
+ explicit propReadMemberFunction(C & c) :
+ cf(c)
+ {
+ }
+
+ operator T() const
+ {
+ return(get());
+ }
+
+ T get() const
+ {
+ if (g == 0)
+ {
+ throw PropertyReadException();
+ }
+ return((cf.*g)());
+ }
+
+ private:
+
+ C & cf;
+
+ propReadMemberFunction & operator = (const propReadMemberFunction &);
+
+ };
+
+ template <class T, class C, void (C::*s)(T)>
+ class propWriteMemberFunction :
+ public virtual IPropertyWrite<T>
+ {
+ public:
+
+ explicit propWriteMemberFunction(C & c) :
+ cf(c)
+ {
+ }
+
+ propWriteMemberFunction(C & c,T arg) :
+ cf(c)
+ {
+ if (s == 0)
+ {
+ throw PropertyWriteException();
+ }
+ (cf.*s)(arg);
+ }
+
+ template<class U>
+ propWriteMemberFunction(C & c,U arg) :
+ cf(c)
+ {
+ if (s == 0)
+ {
+ throw PropertyWriteException();
+ }
+ (cf.*s)(static_cast<T>(arg));
+ }
+
+ propWriteMemberFunction & operator = (T arg)
+ {
+ set(arg);
+ return(*this);
+ }
+
+ template<class U>
+ propWriteMemberFunction & operator = (U arg)
+ {
+ set(static_cast<T>(arg));
+ return(*this);
+ }
+
+ void set(T arg)
+ {
+ if (s == 0)
+ {
+ throw PropertyWriteException();
+ }
+ (cf.*s)(arg);
+ }
+
+ private:
+
+ C & cf;
+
+ propWriteMemberFunction & operator = (const propWriteMemberFunction &);
+
+ };
+
+ template <class T, class C, T (C::*g)(), void (C::*s)(T)>
+ struct propMemberFunction :
+ propReadMemberFunction<T,C,g> ,
+ propWriteMemberFunction<T,C,s>
+ {
+
+ explicit propMemberFunction(C & c) :
+ propReadMemberFunction<T,C,g>(c) ,
+ propWriteMemberFunction<T,C,s>(c)
+ {
+ }
+
+ propMemberFunction(const propMemberFunction & arg) :
+ propReadMemberFunction<T,C,g>(arg) ,
+ propWriteMemberFunction<T,C,s>(static_cast<const propWriteMemberFunction<T,C,s> &>(arg))
+ {
+ }
+
+ propMemberFunction(C & c,T arg) :
+ propReadMemberFunction<T,C,g>(c) ,
+ propWriteMemberFunction<T,C,s>(c,arg)
+ {
+ }
+
+ template<class U>
+ propMemberFunction(C & c,U arg) :
+ propReadMemberFunction<T,C,g>(c) ,
+ propWriteMemberFunction<T,C,s>(c,arg)
+ {
+ }
+
+ propMemberFunction & operator = (const propMemberFunction & arg)
+ {
+ return(*this = static_cast<T>(arg));
+ }
+
+ propMemberFunction & operator = (T arg)
+ {
+ (static_cast<propWriteMemberFunction<T,C,s> &>(*this)) = arg;
+ return(*this);
+ }
+
+ template<class U>
+ propMemberFunction & operator = (U arg)
+ {
+ (static_cast<propWriteMemberFunction<T,C,s> &>(*this)) = arg;
+ return(*this);
+ }
+
+ };
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator ++ (propMemberFunction<T,C,g,s> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator -- (propMemberFunction<T,C,g,s> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator *= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator *= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator /= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator /= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator %= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator %= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator += (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator += (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator -= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator -= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator <<= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator <<= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator >>= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator >>= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator &= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator &= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator ^= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator ^= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T)
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator |= (propMemberFunction<T,C,g,s> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,
+ class C,
+ T (C::*g)(),
+ void (C::*s)(T),
+ class U
+ >
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ propMemberFunction<T,C,g,s> &
+ >::type
+operator |= (propMemberFunction<T,C,g,s> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}
+
+#pragma warning (pop)

Added: sandbox/property/boost/property/PropertyMixin.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyMixin.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,8 @@
+#pragma once
+
+#include "PropertyCallableMixin.h"
+#include "PropertyDataMixin.h"
+#include "PropertyFunctionMixin.h"
+#include "PropertyFunctorMixin.h"
+#include "PropertyMemberDataMixin.h"
+#include "PropertyMemberFunctionMixin.h"

Added: sandbox/property/boost/property/PropertyNotificationBoostSignal.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyNotificationBoostSignal.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <boost/signal.hpp>
+#include <boost/optional.hpp>
+#include "PropertyInterface.h"
+
+namespace properties
+{
+
+ template <class T> class NotificationBoostSignal
+ {
+
+ public:
+
+ boost::signal<void (const IPropertyWrite<T> &,boost::optional<T>,T)> sig;
+
+ protected:
+
+ void PropertyChanged(const IPropertyWrite<T> & signaller,boost::optional<T> oldValue,T newValue)
+ {
+ sig(signaller,oldValue,newValue);
+ }
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyOperators.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyOperators.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,377 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyOperatorsEnabling.h"
+#include "PropertyOperatorsDetail.h"
+#include <boost/utility/enable_if.hpp>
+
+namespace properties
+{
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFIncrement<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator ++ (IPropertyReadWrite<T> & value)
+ {
+
+ T t(value.get());
+
+ ++t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFDecrement<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator -- (IPropertyReadWrite<T> & value)
+ {
+
+ T t(value.get());
+
+ --t;
+ value.set(t);
+ return(value);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFPostIncrement<T>::type,
+ T
+ >::type
+operator ++ (IPropertyReadWrite<T> & value,int)
+ {
+
+ T ret(value.get());
+ T t(ret);
+
+ ++t;
+ value.set(t);
+ return(ret);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFPostDecrement<T>::type,
+ T
+ >::type
+operator -- (IPropertyReadWrite<T> & value,int)
+ {
+
+ T ret(value.get());
+ T t(ret);
+
+ --t;
+ value.set(t);
+ return(ret);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiplySame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator *= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryROMultiplySame<T>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignMultiply<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator *= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryROMultiply<T,U>::type t(first.get() * second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivideSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator /= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryRODivideSame<T>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignDivide<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator /= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryRODivide<T,U>::type t(first.get() / second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModuloSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator %= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryROModuloSame<T>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignModulo<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator %= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryROModulo<T,U>::type t(first.get() % second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAddSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator += (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryROAddSame<T>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAdd<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator += (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryROAdd<T,U>::type t(first.get() + second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtractSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator -= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryROSubtractSame<T>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignSubtract<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator -= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryROSubtract<T,U>::type t(first.get() - second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShiftSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator <<= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryROLeftShiftSame<T>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignLeftShift<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator <<= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryROLeftShift<T,U>::type t(first.get() << second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShiftSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator >>= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryRORightShiftSame<T>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignRightShift<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator >>= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryRORightShift<T,U>::type t(first.get() >> second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAndSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator &= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryROAndSame<T>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignAnd<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator &= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryROAnd<T,U>::type t(first.get() & second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOrSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator ^= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryROXOrSame<T>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignXOr<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator ^= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryROXOr<T,U>::type t(first.get() ^ second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOrSame<T>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator |= (IPropertyReadWrite<T> & first,T second)
+ {
+
+ typename detail::BinaryROOrSame<T>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+template <class T,class U>
+typename boost::enable_if
+ <
+ typename detail::OMFAssignOr<T,U>::type,
+ IPropertyReadWrite<T> &
+ >::type
+operator |= (IPropertyReadWrite<T> & first,U second)
+ {
+
+ typename detail::BinaryROOr<T,U>::type t(first.get() | second);
+
+ first.set(static_cast<T>(t));
+ return(first);
+ }
+
+}

Added: sandbox/property/boost/property/PropertyOperatorsDetail.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyOperatorsDetail.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,252 @@
+#pragma once
+
+#include <boost/typeof/typeof.hpp>
+
+namespace properties
+{
+
+ namespace detail
+ {
+
+ template <class T>
+ struct UnaryROPlus
+ {
+ typedef BOOST_TYPEOF_TPL(+T()) type;
+ };
+
+ template <class T>
+ struct UnaryROMinus
+ {
+ typedef BOOST_TYPEOF_TPL(-T()) type;
+ };
+
+ template <class T>
+ struct UnaryRONegate
+ {
+ typedef BOOST_TYPEOF_TPL(~T()) type;
+ };
+
+ template <class T>
+ struct UnaryRONot
+ {
+ typedef BOOST_TYPEOF_TPL(!T()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROMultiply
+ {
+ typedef BOOST_TYPEOF_TPL(T() * U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryRODivide
+ {
+ typedef BOOST_TYPEOF_TPL(T() / U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROModulo
+ {
+ typedef BOOST_TYPEOF_TPL(T() % U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROAdd
+ {
+ typedef BOOST_TYPEOF_TPL(T() + U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROSubtract
+ {
+ typedef BOOST_TYPEOF_TPL(T() - U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROLeftShift
+ {
+ typedef BOOST_TYPEOF_TPL(T() << U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryRORightShift
+ {
+ typedef BOOST_TYPEOF_TPL(T() >> U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROAnd
+ {
+ typedef BOOST_TYPEOF_TPL(T() & U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROOr
+ {
+ typedef BOOST_TYPEOF_TPL(T() | U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROXOr
+ {
+ typedef BOOST_TYPEOF_TPL(T() ^ U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROGreater
+ {
+ typedef BOOST_TYPEOF_TPL(T() > U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROLess
+ {
+ typedef BOOST_TYPEOF_TPL(T() < U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROGreaterOrEqual
+ {
+ typedef BOOST_TYPEOF_TPL(T() >= U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROLessOrEqual
+ {
+ typedef BOOST_TYPEOF_TPL(T() <= U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROEqual
+ {
+ typedef BOOST_TYPEOF_TPL(T() == U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryRONotEqual
+ {
+ typedef BOOST_TYPEOF_TPL(T() != U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROLogicalAnd
+ {
+ typedef BOOST_TYPEOF_TPL(T() && U()) type;
+ };
+
+ template <class T,class U>
+ struct BinaryROLogicalOr
+ {
+ typedef BOOST_TYPEOF_TPL(T() || U()) type;
+ };
+
+ template <class T>
+ struct BinaryROMultiplySame
+ {
+ typedef typename BinaryROMultiply<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryRODivideSame
+ {
+ typedef typename BinaryRODivide<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROModuloSame
+ {
+ typedef typename BinaryROModulo<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROAddSame
+ {
+ typedef typename BinaryROAdd<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROSubtractSame
+ {
+ typedef typename BinaryROSubtract<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROLeftShiftSame
+ {
+ typedef typename BinaryROLeftShift<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryRORightShiftSame
+ {
+ typedef typename BinaryRORightShift<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROAndSame
+ {
+ typedef typename BinaryROAnd<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROOrSame
+ {
+ typedef typename BinaryROOr<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROXOrSame
+ {
+ typedef typename BinaryROXOr<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROGreaterSame
+ {
+ typedef typename BinaryROGreater<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROLessSame
+ {
+ typedef typename BinaryROLess<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROGreaterOrEqualSame
+ {
+ typedef typename BinaryROGreaterOrEqual<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROLessOrEqualSame
+ {
+ typedef typename BinaryROLessOrEqual<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROEqualSame
+ {
+ typedef typename BinaryROEqual<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryRONotEqualSame
+ {
+ typedef typename BinaryRONotEqual<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROLogicalAndSame
+ {
+ typedef typename BinaryROLogicalAnd<T,T>::type type;
+ };
+
+ template <class T>
+ struct BinaryROLogicalOrSame
+ {
+ typedef typename BinaryROLogicalOr<T,T>::type type;
+ };
+
+ }
+}

Added: sandbox/property/boost/property/PropertyOperatorsEnabling.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyOperatorsEnabling.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,475 @@
+#pragma once
+
+#include "PropertyInterface.h"
+#include "PropertyOperatorsDetail.h"
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+
+namespace properties
+{
+
+ namespace detail
+ {
+
+ // Arithmetic, pointer, not bool
+
+ template <class T>
+ struct OMFIncrement
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_pointer<T>,
+ boost::mpl::and_
+ <
+ boost::mpl::not_
+ <
+ boost::is_same<T,bool>
+ >,
+ boost::is_arithmetic<T>
+ >
+ > type;
+ };
+
+ // Arithmetic, pointer, not bool
+
+ template <class T>
+ struct OMFDecrement
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_pointer<T>,
+ boost::mpl::and_
+ <
+ boost::mpl::not_
+ <
+ boost::is_same<T,bool>
+ >,
+ boost::is_arithmetic<T>
+ >
+ > type;
+ };
+
+ // Arithmetic, pointer, not bool
+
+ template <class T>
+ struct OMFPostIncrement
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_pointer<T>,
+ boost::mpl::and_
+ <
+ boost::mpl::not_
+ <
+ boost::is_same<T,bool>
+ >,
+ boost::is_arithmetic<T>
+ >
+ > type;
+ };
+
+ // Arithmetic, pointer, not bool
+
+ template <class T>
+ struct OMFPostDecrement
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_pointer<T>,
+ boost::mpl::and_
+ <
+ boost::mpl::not_
+ <
+ boost::is_same<T,bool>
+ >,
+ boost::is_arithmetic<T>
+ >
+ > type;
+ };
+
+ // Arithmetic, enumeration
+
+ template <class T>
+ struct OMFAssignMultiplySame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_arithmetic<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ // Arithmetic, enumeration
+
+ template <class T,class U>
+ struct OMFAssignMultiply
+ {
+ typedef typename boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_arithmetic<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_arithmetic<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ > type;
+ };
+
+ // Arithmetic, enumeration
+
+ template <class T>
+ struct OMFAssignDivideSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_arithmetic<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ // Arithmetic, enumeration
+
+ template <class T,class U>
+ struct OMFAssignDivide
+ {
+ typedef typename boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_arithmetic<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_arithmetic<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T>
+ struct OMFAssignModuloSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T,class U>
+ struct OMFAssignModulo
+ {
+ typedef typename boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_integral<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ > type;
+ };
+
+ /* Both - arithmetic, enumeration
+ or
+ One - pointer, other integral, enumeration
+ */
+
+ template <class T>
+ struct OMFAssignAddSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_arithmetic<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ /* Both - arithmetic, enumeration
+ or
+ One - pointer, other integral, enumeration
+ */
+
+ template <class T,class U>
+ struct OMFAssignAdd
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_arithmetic<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_arithmetic<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ >,
+ boost::mpl::and_
+ <
+ boost::is_pointer<T>,
+ boost::mpl::or_
+ <
+ boost::is_integral<U>,
+ boost::is_enum<U>
+ >
+ >
+ > type;
+ };
+
+ /* Both - arithmetic, enumeration
+ or
+ Both - pointers
+ or
+ Left - pointer, other intergral, enumeration
+ */
+
+ template <class T>
+ struct OMFAssignSubtractSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_arithmetic<T>,
+ boost::is_enum<T>,
+ boost::is_pointer<T>
+ > type;
+ };
+
+ /* Both - arithmetic, enumeration
+ or
+ Both - pointers
+ or
+ Left - pointer, other intergral, enumeration
+ */
+
+ template <class T,class U>
+ struct OMFAssignSubtract
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_arithmetic<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_arithmetic<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ >,
+ boost::mpl::and_
+ <
+ boost::is_pointer<T>,
+ boost::is_pointer<U>,
+ boost::is_same
+ <
+ typename boost::remove_pointer<typename boost::remove_cv<T>::type>::type,
+ typename boost::remove_pointer<typename boost::remove_cv<U>::type>::type
+ >
+ >,
+ boost::mpl::and_
+ <
+ boost::is_pointer<T>,
+ boost::mpl::or_
+ <
+ boost::is_integral<U>,
+ boost::is_enum<U>
+ >
+ >
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T>
+ struct OMFAssignLeftShiftSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T,class U>
+ struct OMFAssignLeftShift
+ {
+ typedef typename boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_integral<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T>
+ struct OMFAssignRightShiftSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T,class U>
+ struct OMFAssignRightShift
+ {
+ typedef typename boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_integral<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T>
+ struct OMFAssignAndSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T,class U>
+ struct OMFAssignAnd
+ {
+ typedef typename boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_integral<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T>
+ struct OMFAssignXOrSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T,class U>
+ struct OMFAssignXOr
+ {
+ typedef typename boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_integral<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T>
+ struct OMFAssignOrSame
+ {
+ typedef typename boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ > type;
+ };
+
+ // Integral, enumeration
+
+ template <class T,class U>
+ struct OMFAssignOr
+ {
+ typedef typename boost::mpl::and_
+ <
+ boost::mpl::or_
+ <
+ boost::is_integral<T>,
+ boost::is_enum<T>
+ >,
+ boost::mpl::or_
+ <
+ boost::is_integral<U>,
+ boost::is_enum<U>,
+ boost::is_convertible<U,T>
+ >
+ > type;
+ };
+ }
+
+}

Added: sandbox/property/boost/property/PropertyPredicateFailureRuntimeException.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyPredicateFailureRuntimeException.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <boost/optional.hpp>
+#include <boost/function.hpp>
+#include "PropertyInterface.h"
+#include <stdexcept>
+#include <sstream>
+
+namespace properties
+{
+
+ template <class T> class PredicateFailureRuntimeException
+ {
+
+ protected:
+
+ void PredicateFailure(const IPropertyWrite<T> & prop,const boost::function<bool (T)> & f,boost::optional<T> oldValue,T newValue)
+ {
+
+ std::ostringstream oss;
+
+ oss << "Error trying to update a writeable property with the value '" << newValue << "'.";
+
+ throw std::runtime_error(oss.str());
+ }
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyReferenceInterface.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyReferenceInterface.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_reference.hpp>
+
+namespace properties
+{
+
+ template <class T>
+ struct IPropertyReferenceRead
+ {
+
+ BOOST_MPL_ASSERT_NOT((boost::is_reference<T>));
+
+ virtual T const & get() const = 0;
+ virtual T & get() = 0;
+
+ };
+
+}

Added: sandbox/property/boost/property/PropertyTag.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/PropertyTag.hpp 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,11 @@
+#pragma once
+
+namespace properties
+{
+
+ struct ReadTag { };
+ struct WriteTag { };
+ struct ReadWriteTag : public ReadTag, public WriteTag { };
+ template <class T> class DefaultPolicyTag { };
+
+}

Added: sandbox/property/boost/property/detail/PropertyIndexMapDetail.h
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/detail/PropertyIndexMapDetail.h 2011-04-28 11:05:46 EDT (Thu, 28 Apr 2011)
@@ -0,0 +1,188 @@
+#pragma once
+
+#include <boost/property_map/property_map.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/logical.hpp>
+#include <boost/mpl/bool.hpp>
+#include <PropertyIndexInterface.h>
+
+namespace properties
+{
+ namespace detail
+ {
+
+ template <class PMAP>
+ struct PropertyIndexMapBaseTypedefs
+ {
+ typedef typename boost::property_traits<PMAP>::value_type value_type;
+ typedef typename boost::property_traits<PMAP>::key_type key_type;
+ typedef typename boost::property_traits<PMAP>::reference reference_type;
+ };
+
+ template <class PMAP,class bref,class category>
+ struct PropertyIndexMapBase;
+
+ template <class PMAP,class bref>
+ struct PropertyIndexMapBase<PMAP,bref,boost::readable_property_map_tag> :
+ IPropertyIndexRead<typename boost::property_traits<PMAP>::value_type,typename boost::property_traits<PMAP>::key_type>,
+ PropertyIndexMapBaseTypedefs<PMAP>
+ {
+
+ PropertyIndexMapBase(PMAP & pm) : pmap(pm)
+ {
+ }
+
+ value_type get(key_type key) const
+ {
+ return(get(pmap,key));
+ }
+
+ private:
+
+ PMAP & pmap;
+
+ };
+
+ template <class PMAP,class bref>
+ struct PropertyIndexMapBase<PMAP,bref,boost::writable_property_map_tag> :
+ IPropertyIndexWrite<typename boost::property_traits<PMAP>::value_type,typename boost::property_traits<PMAP>::key_type>,
+ PropertyIndexMapBaseTypedefs<PMAP>
+ {
+
+ PropertyIndexMapBase(PMAP & pm) : pmap(pm)
+ {
+ }
+
+ void set(key_type key,value_type value)
+ {
+ put(pmap,key,value);
+ }
+
+ private:
+
+ PMAP & pmap;
+
+ };
+
+ template <class PMAP,class bref>
+ struct PropertyIndexMapBase<PMAP,bref,boost::read_write_property_map_tag> :
+ IPropertyIndexRead<typename boost::property_traits<PMAP>::value_type,typename boost::property_traits<PMAP>::key_type>,
+ IPropertyIndexWrite<typename boost::property_traits<PMAP>::value_type,typename boost::property_traits<PMAP>::key_type>,
+ PropertyIndexMapBaseTypedefs<PMAP>
+ {
+
+ PropertyIndexMapBase(PMAP & pm) : pmap(pm)
+ {
+ }
+
+ value_type get(key_type key) const
+ {
+ return(get(pmap,key));
+ }
+
+ void set(key_type key,value_type value)
+ {
+ put(pmap,key,value);
+ }
+
+ private:
+
+ PMAP & pmap;
+
+ };
+
+ template <class PMAP>
+ struct PropertyIndexMapBase<PMAP,boost::mpl::false_,boost::lvalue_property_map_tag> :
+ IPropertyIndexReadWriteLValue<typename boost::property_traits<PMAP>::value_type,typename boost::property_traits<PMAP>::key_type,typename boost::property_traits<PMAP>::reference>,
+ PropertyIndexMapBaseTypedefs<PMAP>
+ {
+
+ PropertyIndexMapBase(PMAP & pm) : pmap(pm)
+ {
+ }
+
+ value_type get(key_type key) const
+ {
+ return(get(pmap,key));
+ }
+
+ void set(key_type key,value_type value)
+ {
+ put(pmap,key,value);
+ }
+
+ reference_type operator [] (key_type key)
+ {
+ return(pmap[key]);
+ }
+
+ private:
+
+ PMAP & pmap;
+
+ };
+
+ template <class PMAP>
+ struct PropertyIndexMapBase<PMAP,boost::mpl::true_,boost::lvalue_property_map_tag> :
+ IPropertyIndexReadImmutable<typename boost::property_traits<PMAP>::value_type,typename boost::property_traits<PMAP>::key_type,typename boost::property_traits<PMAP>::reference>,
+ PropertyIndexMapBaseTypedefs<PMAP>
+ {
+
+ PropertyIndexMapBase(PMAP & pm) : pmap(pm)
+ {
+ }
+
+ value_type get(key_type key) const
+ {
+ return(get(pmap,key));
+ }
+
+ reference_type operator [] (key_type key) const
+ {
+ return(pmap[key]);
+ }
+
+ private:
+
+ PMAP & pmap;
+
+ };
+
+ template <class PMAP>
+ struct PropertyIndexMapMakeBase
+ {
+
+ typedef PropertyIndexMapBase
+ <
+ PMAP,
+ typename boost::mpl::if_
+ <
+ boost::mpl::and_
+ <
+ boost::is_reference
+ <
+ typename boost::property_traits<PMAP>::reference
+ >,
+ boost::mpl::not_
+ <
+ boost::is_const
+ <
+ typename boost::remove_reference<typename boost::property_traits<PMAP>::reference>::type
+ >
+ >
+ >,
+ boost::mpl::false_,
+ boost::mpl::true_
+ >::type,
+ typename boost::property_traits<PMAP>::category
+ >
+ type;
+ };
+ }
+}
\ No newline at end of file


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk