KiCad PCB EDA Suite
D Class Reference
Inheritance diagram for D:
A C INSPECTABLE INSPECTABLE E

Public Types

enum  enum_class { TESTA = 0, TESTB = 1, TESTC = 4 }
 

Public Member Functions

virtual void setA (int a) override
 
virtual int getA () const override
 
enum_glob getGlobEnum () const
 
void setGlobEnum (enum_glob val)
 
enum_class getClassEnum () const
 
void setClassEnum (enum_class val)
 
void setCond (int a)
 
int getCond () const
 
virtual const int & getA2 () const
 
virtual void setPoint (const wxPoint &p)
 
void setPoint2 (wxPoint &p)
 
void setPoint3 (wxPoint p)
 
void setPoint4 (wxPoint p)
 
const wxPointgetPoint () const
 
wxPoint getPoint2 () const
 
wxPoint getPoint3 ()
 
const wxPointgetPoint4 () const
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
wxAny Get (PROPERTY_BASE *aProperty)
 
template<typename T >
Get (PROPERTY_BASE *aProperty)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 
bool getBool () const
 
void setBool (bool a)
 
int getNew () const
 
void setNew (int m)
 
bool Set (PROPERTY_BASE *aProperty, wxAny &aValue)
 
template<typename T >
bool Set (PROPERTY_BASE *aProperty, T aValue)
 
template<typename T >
bool Set (const wxString &aProperty, T aValue)
 
template<typename T >
boost::optional< T > Get (const wxString &aProperty)
 

Public Attributes

enum_glob m_enum_glob
 
enum_class m_enum_class
 
int m_aa = 0
 
int m_cond = 0
 
int m_m = 0
 
bool m_bool = false
 

Protected Attributes

int m_a = 0
 
wxPoint m_p
 

Detailed Description

Definition at line 79 of file test_property.cpp.

Member Enumeration Documentation

◆ enum_class

Enumerator
TESTA 
TESTB 
TESTC 

Definition at line 82 of file test_property.cpp.

Member Function Documentation

◆ Get() [1/4]

wxAny INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 84 of file inspectable.h.

85  {
87  TYPE_ID thisType = TYPE_HASH( *this );
88  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
89  return object ? aProperty->getter( object ) : wxAny();
90  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual wxAny getter(void *aObject) const =0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::getter(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

Referenced by CLASS_D_DESC::CLASS_D_DESC(), PCB_EXPR_VAR_REF::GetValue(), and PAD_DESC::PAD_DESC().

◆ Get() [2/4]

template<typename T >
T INSPECTABLE::Get ( PROPERTY_BASE aProperty)
inlineinherited

Definition at line 93 of file inspectable.h.

94  {
96  TYPE_ID thisType = TYPE_HASH( *this );
97  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
98  return object ? aProperty->get<T>( object ) : T();
99  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [3/4]

template<typename T >
boost::optional<T> INSPECTABLE::Get ( const wxString &  aProperty)
inlineinherited

Definition at line 102 of file inspectable.h.

103  {
105  TYPE_ID thisType = TYPE_HASH( *this );
106  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
107  boost::optional<T> ret;
108 
109  if( prop )
110  {
111  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
112 
113  if( object )
114  ret = prop->get<T>( object );
115  }
116 
117  return ret;
118  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Get() [4/4]

template<typename T >
boost::optional<T> INSPECTABLE::Get ( const wxString &  aProperty)
inlineinherited

Definition at line 102 of file inspectable.h.

103  {
105  TYPE_ID thisType = TYPE_HASH( *this );
106  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
107  boost::optional<T> ret;
108 
109  if( prop )
110  {
111  void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
112 
113  if( object )
114  ret = prop->get<T>( object );
115  }
116 
117  return ret;
118  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
T get(void *aObject)
Definition: property.h:273
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_BASE::get(), PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ getA()

virtual int D::getA ( ) const
inlineoverridevirtual

Implements A.

Definition at line 86 of file test_property.cpp.

86 { return m_aa; }
int m_aa

◆ getA2()

virtual const int& A::getA2 ( ) const
inlinevirtualinherited

Definition at line 34 of file test_property.cpp.

34 { return m_a; }
int m_a

Referenced by CLASS_A_DESC::CLASS_A_DESC().

◆ getBool()

bool C::getBool ( ) const
inlineinherited

Definition at line 67 of file test_property.cpp.

67 { return m_bool; }
bool m_bool

Referenced by CLASS_C_DESC::CLASS_C_DESC(), and CLASS_D_DESC::CLASS_D_DESC().

◆ getClassEnum()

enum_class D::getClassEnum ( ) const
inline

Definition at line 91 of file test_property.cpp.

91 { return m_enum_class; }
enum_class m_enum_class

Referenced by CLASS_D_DESC::CLASS_D_DESC().

◆ getCond()

int D::getCond ( ) const
inline

Definition at line 95 of file test_property.cpp.

95 { return m_cond; }
int m_cond

Referenced by CLASS_D_DESC::CLASS_D_DESC().

◆ getGlobEnum()

enum_glob D::getGlobEnum ( ) const
inline

Definition at line 88 of file test_property.cpp.

88 { return m_enum_glob; }
enum_glob m_enum_glob

Referenced by CLASS_D_DESC::CLASS_D_DESC(), and CLASS_E_DESC::CLASS_E_DESC().

◆ getNew()

int C::getNew ( ) const
inlineinherited

Definition at line 70 of file test_property.cpp.

70 { return m_m; }
int m_m

Referenced by CLASS_C_DESC::CLASS_C_DESC().

◆ getPoint()

const wxPoint& A::getPoint ( ) const
inlineinherited

Definition at line 41 of file test_property.cpp.

41 { return m_p; }
wxPoint m_p

Referenced by CLASS_A_DESC::CLASS_A_DESC(), and CLASS_D_DESC::CLASS_D_DESC().

◆ getPoint2()

wxPoint A::getPoint2 ( ) const
inlineinherited

Definition at line 42 of file test_property.cpp.

42 { return m_p; }
wxPoint m_p

Referenced by CLASS_A_DESC::CLASS_A_DESC().

◆ getPoint3()

wxPoint A::getPoint3 ( )
inlineinherited

Definition at line 43 of file test_property.cpp.

43 { return m_p; }
wxPoint m_p

Referenced by CLASS_A_DESC::CLASS_A_DESC().

◆ getPoint4()

const wxPoint& A::getPoint4 ( ) const
inlineinherited

Definition at line 44 of file test_property.cpp.

44 { return m_p; }
wxPoint m_p

Referenced by CLASS_A_DESC::CLASS_A_DESC().

◆ Set() [1/6]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 40 of file inspectable.h.

41  {
43  TYPE_ID thisType = TYPE_HASH( *this );
44  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
45 
46  if( object )
47  aProperty->setter( object, aValue );
48 
49  return object != nullptr;
50  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [2/6]

bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
wxAny &  aValue 
)
inlineinherited

Definition at line 40 of file inspectable.h.

41  {
43  TYPE_ID thisType = TYPE_HASH( *this );
44  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
45 
46  if( object )
47  aProperty->setter( object, aValue );
48 
49  return object != nullptr;
50  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
virtual void setter(void *aObject, wxAny &aValue)=0
Provides class metadata.
Definition: property_mgr.h:58
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::setter(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [3/6]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 53 of file inspectable.h.

54  {
56  TYPE_ID thisType = TYPE_HASH( *this );
57  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
58 
59  if( object )
60  aProperty->set<T>( object, aValue );
61 
62  return object != nullptr;
63  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [4/6]

template<typename T >
bool INSPECTABLE::Set ( PROPERTY_BASE aProperty,
aValue 
)
inlineinherited

Definition at line 53 of file inspectable.h.

54  {
56  TYPE_ID thisType = TYPE_HASH( *this );
57  void* object = propMgr.TypeCast( this, thisType, aProperty->OwnerHash() );
58 
59  if( object )
60  aProperty->set<T>( object, aValue );
61 
62  return object != nullptr;
63  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [5/6]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 66 of file inspectable.h.

67  {
69  TYPE_ID thisType = TYPE_HASH( *this );
70  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71  void* object = nullptr;
72 
73  if( prop )
74  {
75  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76 
77  if( object )
78  prop->set<T>( object, aValue );
79  }
80 
81  return object != nullptr;
82  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ Set() [6/6]

template<typename T >
bool INSPECTABLE::Set ( const wxString &  aProperty,
aValue 
)
inlineinherited

Definition at line 66 of file inspectable.h.

67  {
69  TYPE_ID thisType = TYPE_HASH( *this );
70  PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty );
71  void* object = nullptr;
72 
73  if( prop )
74  {
75  object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
76 
77  if( object )
78  prop->set<T>( object, aValue );
79  }
80 
81  return object != nullptr;
82  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
size_t TYPE_ID
Unique type identifier
Definition: property_mgr.h:38
const void * TypeCast(const void *aSource, TYPE_ID aBase, TYPE_ID aTarget) const
Casts a type to another type.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Returns a property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
void set(void *aObject, T aValue)
Definition: property.h:266
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.

References PROPERTY_MANAGER::GetProperty(), PROPERTY_MANAGER::Instance(), PROPERTY_BASE::OwnerHash(), PROPERTY_BASE::set(), TYPE_HASH, and PROPERTY_MANAGER::TypeCast().

◆ setA()

virtual void D::setA ( int  a)
inlineoverridevirtual

Implements A.

Definition at line 85 of file test_property.cpp.

85 { m_aa = 2 * a; }
int m_aa

◆ setBool()

void C::setBool ( bool  a)
inlineinherited

Definition at line 68 of file test_property.cpp.

68 { m_bool = a; }
bool m_bool

Referenced by CLASS_C_DESC::CLASS_C_DESC(), and CLASS_D_DESC::CLASS_D_DESC().

◆ setClassEnum()

void D::setClassEnum ( enum_class  val)
inline

Definition at line 92 of file test_property.cpp.

92 { m_enum_class = val; }
enum_class m_enum_class

Referenced by CLASS_D_DESC::CLASS_D_DESC().

◆ setCond()

void D::setCond ( int  a)
inline

Definition at line 94 of file test_property.cpp.

94 { m_cond = a; }
int m_cond

Referenced by CLASS_D_DESC::CLASS_D_DESC().

◆ setGlobEnum()

void D::setGlobEnum ( enum_glob  val)
inline

Definition at line 89 of file test_property.cpp.

89 { m_enum_glob = val; }
enum_glob m_enum_glob

Referenced by CLASS_D_DESC::CLASS_D_DESC(), and CLASS_E_DESC::CLASS_E_DESC().

◆ setNew()

void C::setNew ( int  m)
inlineinherited

Definition at line 71 of file test_property.cpp.

71 { m_m = m; }
int m_m

Referenced by CLASS_C_DESC::CLASS_C_DESC().

◆ setPoint()

virtual void A::setPoint ( const wxPoint p)
inlinevirtualinherited

Definition at line 36 of file test_property.cpp.

36 { m_p = p; }
wxPoint m_p

Referenced by CLASS_A_DESC::CLASS_A_DESC(), and CLASS_D_DESC::CLASS_D_DESC().

◆ setPoint2()

void A::setPoint2 ( wxPoint p)
inlineinherited

Definition at line 37 of file test_property.cpp.

37 { m_p = p; }
wxPoint m_p

◆ setPoint3()

void A::setPoint3 ( wxPoint  p)
inlineinherited

Definition at line 38 of file test_property.cpp.

38 { m_p = p; }
wxPoint m_p

Referenced by CLASS_A_DESC::CLASS_A_DESC().

◆ setPoint4()

void A::setPoint4 ( wxPoint  p)
inlineinherited

Definition at line 39 of file test_property.cpp.

39 { m_p = p; }
wxPoint m_p

Referenced by CLASS_A_DESC::CLASS_A_DESC().

Member Data Documentation

◆ m_a

int A::m_a = 0
protectedinherited

Definition at line 47 of file test_property.cpp.

◆ m_aa

int D::m_aa = 0

Definition at line 99 of file test_property.cpp.

◆ m_bool

bool C::m_bool = false
inherited

Definition at line 74 of file test_property.cpp.

◆ m_cond

int D::m_cond = 0

Definition at line 100 of file test_property.cpp.

◆ m_enum_class

enum_class D::m_enum_class

Definition at line 98 of file test_property.cpp.

◆ m_enum_glob

enum_glob D::m_enum_glob

Definition at line 97 of file test_property.cpp.

◆ m_m

int C::m_m = 0
inherited

Definition at line 73 of file test_property.cpp.

◆ m_p

wxPoint A::m_p
protectedinherited

Definition at line 48 of file test_property.cpp.


The documentation for this class was generated from the following file: