28 #include <boost/optional.hpp> 47 aProperty->
setter(
object, aValue );
49 return object !=
nullptr;
60 aProperty->
set<T>( object, aValue );
62 return object !=
nullptr;
66 bool Set(
const wxString& aProperty, T aValue )
71 void*
object =
nullptr;
78 prop->
set<T>( object, aValue );
81 return object !=
nullptr;
89 return object ? aProperty->
getter(
object ) : wxAny();
98 return object ? aProperty->
get<T>( object ) : T();
102 boost::optional<T>
Get(
const wxString& aProperty )
107 boost::optional<T> ret;
114 ret = prop->
get<T>( object );
static PROPERTY_MANAGER & Instance()
boost::optional< T > Get(const wxString &aProperty)
size_t TYPE_ID
Unique type identifier.
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Cast a type to another type.
virtual wxAny getter(void *aObject) const =0
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
bool Set(const wxString &aProperty, T aValue)
wxAny Get(PROPERTY_BASE *aProperty)
bool Set(PROPERTY_BASE *aProperty, wxAny &aValue)
Class that other classes need to inherit from, in order to be inspectable.
bool Set(PROPERTY_BASE *aProperty, T aValue)
virtual void setter(void *aObject, wxAny &aValue)=0
T Get(PROPERTY_BASE *aProperty)
Provide class metadata.Helper macro to map type hashes to names.
void set(void *aObject, T aValue)
virtual size_t OwnerHash() const =0
Return type-id of the Owner class.