Sleeping Wombat GUI  0.100
swGUI
IEnableProperty.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RTTR.h"
5 
6 
8 {
9  RTTR_ENABLE()
10 private:
11 public:
12 
13  //inline IProperty GetProperty ( const char* propertyName )
14  //{
15  // const IMetaProperty* metaProperty = GetMetaProperty( propertyName );
16  // return IProperty( metaProperty, this );
17  //}
18 
19  template< typename PropertyType >
20  inline Property< PropertyType > GetTypedProperty ( const char* propertyName )
21  {
22  auto metaProperty = rttr::type::get( *this ).get_property( propertyName );
23 
24  if( metaProperty.is_valid() && metaProperty.get_type().is_derived_from< PropertyType >() )
25  return Property< PropertyType >( metaProperty, this );
26 
27  // Types are inconsistent. Return invalid property.
28  return Property< PropertyType >( this );
29  }
30 
31  //inline std::vector< IProperty > GetProperties ()
32  //{
33  // auto typeInfo = getTypeInfo();
34  // auto propertyVec = typeInfo.GetProperties();
35 
36  // std::vector< IProperty > properties;
37 
38  // for( auto metaProperty : propertyVec )
39  // {
40  // properties.push_back( IProperty( metaProperty, this ) );
41  // }
42 
43  // return properties;
44  //}
45 };
46 //RTTR_DECLARE_STANDARD_META_TYPE_VARIANTS( IEnableProperty )
Property< PropertyType > GetTypedProperty(const char *propertyName)
Definition: IEnableProperty.h:20
Definition: IEnableProperty.h:7
Definition: Property.h:47