KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PROPERTY< Owner, T, Base > Class Template Reference

#include <property.h>

Inheritance diagram for PROPERTY< Owner, T, Base >:
PROPERTY_BASE PROPERTY_ENUM< Owner, T, Base >

Public Types

using BASE_TYPE = typename std::decay< T >::type
 

Public Member Functions

template<typename SetType , typename GetType >
 PROPERTY (const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)(), PROPERTY_DISPLAY aDisplay=PT_DEFAULT, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType=ORIGIN_TRANSFORMS::NOT_A_COORD)
 
template<typename SetType , typename GetType >
 PROPERTY (const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)() const, PROPERTY_DISPLAY aDisplay=PT_DEFAULT, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType=ORIGIN_TRANSFORMS::NOT_A_COORD)
 
size_t OwnerHash () const override
 Return type-id of the Owner class. More...
 
size_t BaseHash () const override
 Return type-id of the Base class. More...
 
size_t TypeHash () const override
 Return type-id of the property type. More...
 
bool Writeable (INSPECTABLE *aObject) const override
 
const wxString & Name () const
 
virtual const wxPGChoices & Choices () const
 Return a limited set of possible values (e.g. More...
 
virtual void SetChoices (const wxPGChoices &aChoices)
 Set the possible values for for the property. More...
 
virtual bool HasChoices () const
 Return true if this PROPERTY has a limited set of possible values. More...
 
bool Available (INSPECTABLE *aObject) const
 Return true if aObject offers this PROPERTY. More...
 
PROPERTY_BASESetAvailableFunc (std::function< bool(INSPECTABLE *)> aFunc)
 Set a callback function to determine whether an object provides this property. More...
 
PROPERTY_BASESetWriteableFunc (std::function< bool(INSPECTABLE *)> aFunc)
 
PROPERTY_DISPLAY Display () const
 
PROPERTY_BASESetDisplay (PROPERTY_DISPLAY aDisplay)
 
ORIGIN_TRANSFORMS::COORD_TYPES_T CoordType () const
 
PROPERTY_BASESetCoordType (ORIGIN_TRANSFORMS::COORD_TYPES_T aType)
 
bool IsHiddenFromPropertiesManager () const
 
PROPERTY_BASESetIsHiddenFromPropertiesManager (bool aHide=true)
 
bool IsHiddenFromRulesEditor () const
 
PROPERTY_BASESetIsHiddenFromRulesEditor (bool aHide=true)
 
bool IsHiddenFromLibraryEditors () const
 
PROPERTY_BASESetIsHiddenFromLibraryEditors (bool aIsHidden=true)
 
wxString Group () const
 
PROPERTY_BASESetGroup (const wxString &aGroup)
 
PROPERTY_BASESetValidator (PROPERTY_VALIDATOR_FN &&aValidator)
 
VALIDATOR_RESULT Validate (const wxAny &&aValue, EDA_ITEM *aItem)
 

Static Public Member Functions

static VALIDATOR_RESULT NullValidator (const wxAny &&aValue, EDA_ITEM *aItem)
 

Protected Member Functions

 PROPERTY (const wxString &aName, SETTER_BASE< Owner, T > *s, GETTER_BASE< Owner, T > *g, PROPERTY_DISPLAY aDisplay, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
 
virtual ~PROPERTY ()
 
virtual void setter (void *obj, wxAny &v) override
 
virtual wxAny getter (const void *obj) const override
 Set method. More...
 
template<typename T >
void set (void *aObject, T aValue)
 
template<typename T >
get (const void *aObject) const
 

Protected Attributes

std::unique_ptr< SETTER_BASE< Owner, T > > m_setter
 Get method. More...
 
std::unique_ptr< GETTER_BASE< Owner, T > > m_getter
 Owner class type-id. More...
 
const size_t m_ownerHash
 Base class type-id. More...
 
const size_t m_baseHash
 Property value type-id. More...
 
const size_t m_typeHash
 

Private Attributes

const wxString m_name
 Permanent identifier for this property. More...
 
PROPERTY_DISPLAY m_display
 The display style controls how properties are edited in the properties manager GUI. More...
 
ORIGIN_TRANSFORMS::COORD_TYPES_T m_coordType
 The coordinate type controls how distances are mapped to the user coordinate system. More...
 
bool m_hideFromPropertiesManager
 Some properties should not be shown in the Properties Manager GUI. More...
 
bool m_hideFromRulesEditor
 Some properties should not be shown in the Custom Rules editor autocomplete. More...
 
bool m_hideFromLibraryEditors
 This property should only be shown in the design editor, not the library editor. More...
 
wxString m_group
 Optional group identifier. More...
 
std::function< bool(INSPECTABLE *)> m_availFunc
 Eval to determine if prop is available. More...
 
std::function< bool(INSPECTABLE *)> m_writeableFunc
 Eval to determine if prop is read-only. More...
 
PROPERTY_VALIDATOR_FN m_validator
 

Detailed Description

template<typename Owner, typename T, typename Base = Owner>
class PROPERTY< Owner, T, Base >

Definition at line 413 of file property.h.

Member Typedef Documentation

◆ BASE_TYPE

template<typename Owner , typename T , typename Base = Owner>
using PROPERTY< Owner, T, Base >::BASE_TYPE = typename std::decay<T>::type

Definition at line 416 of file property.h.

Constructor & Destructor Documentation

◆ PROPERTY() [1/3]

template<typename Owner , typename T , typename Base = Owner>
template<typename SetType , typename GetType >
PROPERTY< Owner, T, Base >::PROPERTY ( const wxString &  aName,
void(Base::*)(SetType)  aSetter,
GetType(Base::*)()  aGetter,
PROPERTY_DISPLAY  aDisplay = PT_DEFAULT,
ORIGIN_TRANSFORMS::COORD_TYPES_T  aCoordType = ORIGIN_TRANSFORMS::NOT_A_COORD 
)
inline

Definition at line 419 of file property.h.

◆ PROPERTY() [2/3]

template<typename Owner , typename T , typename Base = Owner>
template<typename SetType , typename GetType >
PROPERTY< Owner, T, Base >::PROPERTY ( const wxString &  aName,
void(Base::*)(SetType)  aSetter,
GetType(Base::*)() const  aGetter,
PROPERTY_DISPLAY  aDisplay = PT_DEFAULT,
ORIGIN_TRANSFORMS::COORD_TYPES_T  aCoordType = ORIGIN_TRANSFORMS::NOT_A_COORD 
)
inline

Definition at line 429 of file property.h.

◆ PROPERTY() [3/3]

template<typename Owner , typename T , typename Base = Owner>
PROPERTY< Owner, T, Base >::PROPERTY ( const wxString &  aName,
SETTER_BASE< Owner, T > *  s,
GETTER_BASE< Owner, T > *  g,
PROPERTY_DISPLAY  aDisplay,
ORIGIN_TRANSFORMS::COORD_TYPES_T  aCoordType 
)
inlineprotected

Definition at line 459 of file property.h.

◆ ~PROPERTY()

template<typename Owner , typename T , typename Base = Owner>
virtual PROPERTY< Owner, T, Base >::~PROPERTY ( )
inlineprotectedvirtual

Definition at line 467 of file property.h.

Member Function Documentation

◆ Available()

bool PROPERTY_BASE::Available ( INSPECTABLE aObject) const
inlineinherited

Return true if aObject offers this PROPERTY.

Definition at line 234 of file property.h.

Referenced by BOOST_AUTO_TEST_CASE(), and PROPERTY_MANAGER::IsAvailableFor().

◆ BaseHash()

template<typename Owner , typename T , typename Base = Owner>
size_t PROPERTY< Owner, T, Base >::BaseHash ( ) const
inlineoverridevirtual

Return type-id of the Base class.

Implements PROPERTY_BASE.

Definition at line 443 of file property.h.

References PROPERTY< Owner, T, Base >::m_baseHash.

◆ Choices()

virtual const wxPGChoices & PROPERTY_BASE::Choices ( ) const
inlinevirtualinherited

Return a limited set of possible values (e.g.

enum). Check with HasChoices() if a particular PROPERTY provides such set.

Reimplemented in PROPERTY_ENUM< Owner, T, Base >.

Definition at line 208 of file property.h.

References empty().

Referenced by BOOST_AUTO_TEST_CASE(), PCB_PROPERTIES_PANEL::createPGProperty(), and PGPropertyFactory().

◆ CoordType()

ORIGIN_TRANSFORMS::COORD_TYPES_T PROPERTY_BASE::CoordType ( ) const
inlineinherited

Definition at line 277 of file property.h.

Referenced by PGPropertyFactory().

◆ Display()

PROPERTY_DISPLAY PROPERTY_BASE::Display ( ) const
inlineinherited

Definition at line 274 of file property.h.

Referenced by PGPropertyFactory().

◆ get()

template<typename T >
T PROPERTY_BASE::get ( const void *  aObject) const
inlineprotectedinherited

Definition at line 358 of file property.h.

Referenced by INSPECTABLE::Get().

◆ getter()

template<typename Owner , typename T , typename Base = Owner>
virtual wxAny PROPERTY< Owner, T, Base >::getter ( const void *  obj) const
inlineoverrideprotectedvirtual

Set method.

Implements PROPERTY_BASE.

Reimplemented in PROPERTY_ENUM< Owner, T, Base >.

Definition at line 481 of file property.h.

References res.

◆ Group()

wxString PROPERTY_BASE::Group ( ) const
inlineinherited

Definition at line 305 of file property.h.

◆ HasChoices()

virtual bool PROPERTY_BASE::HasChoices ( ) const
inlinevirtualinherited

Return true if this PROPERTY has a limited set of possible values.

See also
PROPERTY_BASE::Choices()

Reimplemented in PROPERTY_ENUM< Owner, T, Base >.

Definition at line 226 of file property.h.

Referenced by BOOST_AUTO_TEST_CASE(), PCB_PROPERTIES_PANEL::createPGProperty(), PCBEXPR_UCODE::CreateVarRef(), PROPERTIES_PANEL::getItemValue(), and PGPropertyFactory().

◆ IsHiddenFromLibraryEditors()

bool PROPERTY_BASE::IsHiddenFromLibraryEditors ( ) const
inlineinherited

Definition at line 298 of file property.h.

◆ IsHiddenFromPropertiesManager()

bool PROPERTY_BASE::IsHiddenFromPropertiesManager ( ) const
inlineinherited

Definition at line 284 of file property.h.

◆ IsHiddenFromRulesEditor()

bool PROPERTY_BASE::IsHiddenFromRulesEditor ( ) const
inlineinherited

Definition at line 291 of file property.h.

◆ Name()

◆ NullValidator()

static VALIDATOR_RESULT PROPERTY_BASE::NullValidator ( const wxAny &&  aValue,
EDA_ITEM aItem 
)
inlinestaticinherited

Definition at line 319 of file property.h.

◆ OwnerHash()

template<typename Owner , typename T , typename Base = Owner>
size_t PROPERTY< Owner, T, Base >::OwnerHash ( ) const
inlineoverridevirtual

Return type-id of the Owner class.

Implements PROPERTY_BASE.

Definition at line 438 of file property.h.

References PROPERTY< Owner, T, Base >::m_ownerHash.

◆ set()

template<typename T >
void PROPERTY_BASE::set ( void *  aObject,
aValue 
)
inlineprotectedinherited

Definition at line 326 of file property.h.

References EDA_ANGLE_VARIANT_DATA::Angle(), and COLOR4D_VARIANT_DATA::Color().

Referenced by INSPECTABLE::Set().

◆ SetAvailableFunc()

PROPERTY_BASE & PROPERTY_BASE::SetAvailableFunc ( std::function< bool(INSPECTABLE *)>  aFunc)
inlineinherited

Set a callback function to determine whether an object provides this property.

Definition at line 242 of file property.h.

Referenced by BOARD_ITEM_DESC::BOARD_ITEM_DESC(), DIMENSION_DESC::DIMENSION_DESC(), EDA_SHAPE_DESC::EDA_SHAPE_DESC(), PAD_DESC::PAD_DESC(), and PCB_SHAPE_DESC::PCB_SHAPE_DESC().

◆ SetChoices()

virtual void PROPERTY_BASE::SetChoices ( const wxPGChoices &  aChoices)
inlinevirtualinherited

Set the possible values for for the property.

Reimplemented in PROPERTY_ENUM< Owner, T, Base >.

Definition at line 217 of file property.h.

Referenced by PCB_PROPERTIES_PANEL::updateLists().

◆ SetCoordType()

PROPERTY_BASE & PROPERTY_BASE::SetCoordType ( ORIGIN_TRANSFORMS::COORD_TYPES_T  aType)
inlineinherited

Definition at line 278 of file property.h.

◆ SetDisplay()

PROPERTY_BASE & PROPERTY_BASE::SetDisplay ( PROPERTY_DISPLAY  aDisplay)
inlineinherited

Definition at line 275 of file property.h.

◆ SetGroup()

PROPERTY_BASE & PROPERTY_BASE::SetGroup ( const wxString &  aGroup)
inlineinherited

Definition at line 306 of file property.h.

Referenced by PROPERTY_MANAGER::AddProperty().

◆ SetIsHiddenFromLibraryEditors()

PROPERTY_BASE & PROPERTY_BASE::SetIsHiddenFromLibraryEditors ( bool  aIsHidden = true)
inlineinherited

◆ SetIsHiddenFromPropertiesManager()

PROPERTY_BASE & PROPERTY_BASE::SetIsHiddenFromPropertiesManager ( bool  aHide = true)
inlineinherited

◆ SetIsHiddenFromRulesEditor()

PROPERTY_BASE & PROPERTY_BASE::SetIsHiddenFromRulesEditor ( bool  aHide = true)
inlineinherited

Definition at line 292 of file property.h.

Referenced by BOARD_CONNECTED_ITEM_DESC::BOARD_CONNECTED_ITEM_DESC().

◆ setter()

template<typename Owner , typename T , typename Base = Owner>
virtual void PROPERTY< Owner, T, Base >::setter ( void *  obj,
wxAny &  v 
)
inlineoverrideprotectedvirtual

Implements PROPERTY_BASE.

Reimplemented in PROPERTY_ENUM< Owner, T, Base >.

Definition at line 469 of file property.h.

References PROPERTY< Owner, T, Base >::m_setter.

◆ SetValidator()

PROPERTY_BASE & PROPERTY_BASE::SetValidator ( PROPERTY_VALIDATOR_FN &&  aValidator)
inlineinherited

Definition at line 308 of file property.h.

Referenced by PAD_DESC::PAD_DESC(), and ZONE_DESC::ZONE_DESC().

◆ SetWriteableFunc()

PROPERTY_BASE & PROPERTY_BASE::SetWriteableFunc ( std::function< bool(INSPECTABLE *)>  aFunc)
inlineinherited

Definition at line 253 of file property.h.

Referenced by PAD_DESC::PAD_DESC(), and ZONE_DESC::ZONE_DESC().

◆ TypeHash()

template<typename Owner , typename T , typename Base = Owner>
size_t PROPERTY< Owner, T, Base >::TypeHash ( ) const
inlineoverridevirtual

Return type-id of the property type.

Implements PROPERTY_BASE.

Definition at line 448 of file property.h.

References PROPERTY< Owner, T, Base >::m_typeHash.

◆ Validate()

VALIDATOR_RESULT PROPERTY_BASE::Validate ( const wxAny &&  aValue,
EDA_ITEM aItem 
)
inlineinherited

Definition at line 314 of file property.h.

◆ Writeable()

template<typename Owner , typename T , typename Base = Owner>
bool PROPERTY< Owner, T, Base >::Writeable ( INSPECTABLE aObject) const
inlineoverridevirtual

Reimplemented from PROPERTY_BASE.

Definition at line 453 of file property.h.

References PROPERTY< Owner, T, Base >::m_setter, and PROPERTY_BASE::Writeable().

Member Data Documentation

◆ m_availFunc

std::function<bool(INSPECTABLE*)> PROPERTY_BASE::m_availFunc
privateinherited

Eval to determine if prop is available.

Definition at line 402 of file property.h.

◆ m_baseHash

template<typename Owner , typename T , typename Base = Owner>
const size_t PROPERTY< Owner, T, Base >::m_baseHash
protected

Property value type-id.

Definition at line 498 of file property.h.

Referenced by PROPERTY< Owner, T, Base >::BaseHash().

◆ m_coordType

ORIGIN_TRANSFORMS::COORD_TYPES_T PROPERTY_BASE::m_coordType
privateinherited

The coordinate type controls how distances are mapped to the user coordinate system.

Definition at line 388 of file property.h.

◆ m_display

PROPERTY_DISPLAY PROPERTY_BASE::m_display
privateinherited

The display style controls how properties are edited in the properties manager GUI.

Definition at line 385 of file property.h.

◆ m_getter

template<typename Owner , typename T , typename Base = Owner>
std::unique_ptr<GETTER_BASE<Owner, T> > PROPERTY< Owner, T, Base >::m_getter
protected

Owner class type-id.

Definition at line 492 of file property.h.

◆ m_group

wxString PROPERTY_BASE::m_group
privateinherited

Optional group identifier.

Definition at line 400 of file property.h.

◆ m_hideFromLibraryEditors

bool PROPERTY_BASE::m_hideFromLibraryEditors
privateinherited

This property should only be shown in the design editor, not the library editor.

Definition at line 397 of file property.h.

◆ m_hideFromPropertiesManager

bool PROPERTY_BASE::m_hideFromPropertiesManager
privateinherited

Some properties should not be shown in the Properties Manager GUI.

Definition at line 391 of file property.h.

◆ m_hideFromRulesEditor

bool PROPERTY_BASE::m_hideFromRulesEditor
privateinherited

Some properties should not be shown in the Custom Rules editor autocomplete.

Definition at line 394 of file property.h.

◆ m_name

const wxString PROPERTY_BASE::m_name
privateinherited

Permanent identifier for this property.

Property names are an API contract; changing them after release will impact the Custom DRC Rules system as well as the automatic API binding system. Never rename properties; instead deprecate them and hide them from the GUI.

Definition at line 382 of file property.h.

◆ m_ownerHash

template<typename Owner , typename T , typename Base = Owner>
const size_t PROPERTY< Owner, T, Base >::m_ownerHash
protected

Base class type-id.

Definition at line 495 of file property.h.

Referenced by PROPERTY< Owner, T, Base >::OwnerHash().

◆ m_setter

template<typename Owner , typename T , typename Base = Owner>
std::unique_ptr<SETTER_BASE<Owner, T> > PROPERTY< Owner, T, Base >::m_setter
protected

Get method.

Definition at line 489 of file property.h.

Referenced by PROPERTY< Owner, T, Base >::setter(), and PROPERTY< Owner, T, Base >::Writeable().

◆ m_typeHash

template<typename Owner , typename T , typename Base = Owner>
const size_t PROPERTY< Owner, T, Base >::m_typeHash
protected

Definition at line 501 of file property.h.

Referenced by PROPERTY< Owner, T, Base >::TypeHash().

◆ m_validator

PROPERTY_VALIDATOR_FN PROPERTY_BASE::m_validator
privateinherited

Definition at line 406 of file property.h.

◆ m_writeableFunc

std::function<bool(INSPECTABLE*)> PROPERTY_BASE::m_writeableFunc
privateinherited

Eval to determine if prop is read-only.

Definition at line 404 of file property.h.


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