KiCad PCB EDA Suite
property.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2020 CERN
5  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef PROPERTY_H
23 #define PROPERTY_H
24 
25 #include <wx/wx.h>
26 #include <wx/any.h>
27 #include <wx/string.h>
28 #include <wx/propgrid/property.h>
29 
30 #include <functional>
31 #include <map>
32 #include <memory>
33 #include <typeindex>
34 #include <type_traits>
35 
36 class wxPGProperty;
37 class INSPECTABLE;
38 class PROPERTY_BASE;
39 
40 template<typename T>
41 class ENUM_MAP;
42 
45 {
50 };
51 
53 #define TYPE_HASH( x ) typeid( x ).hash_code()
54 #define TYPE_NAME( x ) typeid( x ).name()
55 //#define TYPE_HASH( x ) typeid( std::decay<x>::type ).hash_code()
56 
57 template<typename Owner, typename T>
59 {
60 public:
61  virtual ~GETTER_BASE() {}
62 
63  virtual T operator()( Owner* aOwner ) const = 0;
64 };
65 
66 template<typename Owner, typename T, typename FuncType>
67 class GETTER : public GETTER_BASE<Owner, T>
68 {
69 public:
70  GETTER( FuncType aFunc )
71  : m_func( aFunc )
72  {
73  }
74 
75  T operator()( Owner* aOwner ) const override
76  {
77  return ( aOwner->*m_func )();
78  }
79 
80 private:
81  FuncType m_func;
82 };
83 
84 template<typename Owner, typename T>
86 {
87 public:
88  virtual ~SETTER_BASE() {}
89 
90  virtual void operator()( Owner* aOwner, T aValue ) = 0;
91 };
92 
93 template<typename Owner, typename T, typename FuncType>
94 class SETTER : public SETTER_BASE<Owner, T>
95 {
96 public:
97  SETTER( FuncType aFunc )
98  : m_func( aFunc )
99  {
100  }
101 
102  void operator()( Owner* aOwner, T aValue ) override
103  {
104  wxCHECK( m_func, /*void*/ );
105  ( aOwner->*m_func )( aValue );
106  }
107 
108 private:
109  FuncType m_func;
110 };
111 
112 
113 template<typename Owner, typename T, typename Base = Owner>
114 class METHOD
115 {
116 public:
117  constexpr static GETTER_BASE<Owner, T>* Wrap( T (Base::*aFunc)() )
118  {
119  return new GETTER<Owner, T, T (Base::*)()>( aFunc );
120  }
121 
122  constexpr static GETTER_BASE<Owner, T>* Wrap( const T (Base::*aFunc)() )
123  {
124  return new GETTER<Owner, T, T (Base::*)()>( aFunc );
125  }
126 
127  constexpr static GETTER_BASE<Owner, T>* Wrap( const T& (Base::*aFunc)() )
128  {
129  return new GETTER<Owner, T, const T& (Base::*)()>( aFunc );
130  }
131 
132  constexpr static GETTER_BASE<Owner, T>* Wrap( T (Base::*aFunc)() const )
133  {
134  return new GETTER<Owner, T, T (Base::*)() const>( aFunc );
135  }
136 
137  constexpr static GETTER_BASE<Owner, T>* Wrap( const T (Base::*aFunc)() const )
138  {
140  }
141 
142  constexpr static GETTER_BASE<Owner, T>* Wrap( const T& (Base::*aFunc)() const )
143  {
145  }
146 
147  constexpr static SETTER_BASE<Owner, T>* Wrap( void (Base::*aFunc)( T ) )
148  {
149  return aFunc ? new SETTER<Owner, T, void (Base::*)( T )>( aFunc ) : nullptr;
150  }
151 
152  constexpr static SETTER_BASE<Owner, T>* Wrap( void (Base::*aFunc)( T& ) )
153  {
154  return aFunc ? new SETTER<Owner, T, void (Base::*)( T& )>( aFunc ) : nullptr;
155  }
156 
157  constexpr static SETTER_BASE<Owner, T>* Wrap( void (Base::*aFunc)( const T& ) )
158  {
159  return aFunc ? new SETTER<Owner, T, void (Base::*)( const T& )>( aFunc ) : nullptr;
160  }
161 
162  METHOD() = delete;
163 };
164 
165 
167 {
168 private:
170  size_t nextId = 0;
171 
172 public:
173  PROPERTY_BASE( const wxString& aName, PROPERTY_DISPLAY aDisplay = DEFAULT ) :
174  m_id( nextId ),
175  m_name( aName ),
176  m_display( aDisplay ),
177  m_availFunc( [](INSPECTABLE*)->bool { return true; } )
178  {
179  ++nextId;
180  }
181 
182  virtual ~PROPERTY_BASE()
183  {
184  }
185 
186  const wxString& Name() const
187  {
188  return m_name;
189  }
190 
195  virtual const wxPGChoices& Choices() const
196  {
197  static wxPGChoices empty;
198  return empty;
199  }
200 
204  virtual void SetChoices( const wxPGChoices& aChoices )
205  {
206  wxFAIL; // only possible for PROPERTY_ENUM
207  }
208 
213  virtual bool HasChoices() const
214  {
215  return false;
216  }
217 
221  bool Available( INSPECTABLE* aObject ) const
222  {
223  return m_availFunc( aObject );
224  }
225 
229  void SetAvailableFunc( std::function<bool(INSPECTABLE*)> aFunc )
230  {
231  m_availFunc = aFunc;
232  }
233 
237  virtual size_t OwnerHash() const = 0;
238 
242  virtual size_t BaseHash() const = 0;
243 
247  virtual size_t TypeHash() const = 0;
248 
252  size_t Id() const
253  {
254  return m_id;
255  }
256 
257  virtual bool IsReadOnly() const = 0;
258 
260  {
261  return m_display;
262  }
263 
264 protected:
265  template<typename T>
266  void set( void* aObject, T aValue )
267  {
268  wxAny a = aValue;
269  setter( aObject, a );
270  }
271 
272  template<typename T>
273  T get( void* aObject )
274  {
275  wxAny a = getter( aObject );
276 
277  if ( !( std::is_enum<T>::value && a.CheckType<int>() ) && !a.CheckType<T>() )
278  throw std::invalid_argument("Invalid requested type");
279 
280  return wxANY_AS(a, T);
281  }
282 
283  virtual void setter( void* aObject, wxAny& aValue ) = 0;
284  virtual wxAny getter( void* aObject ) const = 0;
285 
286 private:
287  const size_t m_id;
288  const wxString m_name;
290 
292  std::function<bool(INSPECTABLE*)> m_availFunc;
293 
294  friend class INSPECTABLE;
295 };
296 
297 
298 template<typename Owner, typename T, typename Base = Owner>
299 class PROPERTY : public PROPERTY_BASE
300 {
301 public:
302  typedef typename std::decay<T>::type BASE_TYPE;
303  typedef void (Base::*SETTER)( T );
304 
305  template<typename SetType, typename GetType>
306  PROPERTY( const wxString& aName,
307  void ( Base::*aSetter )( SetType ), GetType( Base::*aGetter )(),
308  PROPERTY_DISPLAY aDisplay = DEFAULT )
309  : PROPERTY( aName, METHOD<Owner, T, Base>::Wrap( aSetter ),
310  METHOD<Owner, T, Base>::Wrap( aGetter ), aDisplay )
311  {
312  }
313 
314  template<typename SetType, typename GetType>
315  PROPERTY( const wxString& aName,
316  void ( Base::*aSetter )( SetType ), GetType( Base::*aGetter )() const,
317  PROPERTY_DISPLAY aDisplay = DEFAULT )
318  : PROPERTY( aName, METHOD<Owner, T, Base>::Wrap( aSetter ),
319  METHOD<Owner, T, Base>::Wrap( aGetter ), aDisplay )
320  {
321  }
322 
323  size_t OwnerHash() const override
324  {
325  return m_ownerHash;
326  }
327 
328  size_t BaseHash() const override
329  {
330  return m_baseHash;
331  }
332 
333  size_t TypeHash() const override
334  {
335  return m_typeHash;
336  }
337 
338  bool IsReadOnly() const override
339  {
340  return !m_setter;
341  }
342 
343 protected:
344  PROPERTY( const wxString& aName, SETTER_BASE<Owner, T>* s, GETTER_BASE<Owner, T>* g,
345  PROPERTY_DISPLAY aDisplay )
346  : PROPERTY_BASE( aName, aDisplay ), m_setter( s ), m_getter( g ),
347  m_ownerHash( TYPE_HASH( Owner ) ), m_baseHash( TYPE_HASH( Base ) ),
349  {
350  }
351 
352  virtual ~PROPERTY() {}
353 
354  virtual void setter( void* obj, wxAny& v ) override
355  {
356  wxCHECK( !IsReadOnly(), /*void*/ );
357 
358  if( !v.CheckType<T>() )
359  throw std::invalid_argument( "Invalid type requested" );
360 
361  Owner* o = reinterpret_cast<Owner*>( obj );
362  BASE_TYPE value = wxANY_AS(v, BASE_TYPE);
363  (*m_setter)( o, value );
364  }
365 
366  virtual wxAny getter( void* obj ) const override
367  {
368  Owner* o = reinterpret_cast<Owner*>( obj );
369  wxAny res = (*m_getter)( o );
370  return res;
371  }
372 
374  std::unique_ptr<SETTER_BASE<Owner, T>> m_setter;
375 
377  std::unique_ptr<GETTER_BASE<Owner, T>> m_getter;
378 
380  const size_t m_ownerHash;
381 
383  const size_t m_baseHash;
384 
386  const size_t m_typeHash;
387 };
388 
389 
390 template<typename Owner, typename T, typename Base = Owner>
391 class PROPERTY_ENUM : public PROPERTY<Owner, T, Base>
392 {
393 public:
394  template<typename SetType, typename GetType>
395  PROPERTY_ENUM( const wxString& aName,
396  void ( Base::*aSetter )( SetType ), GetType( Base::*aGetter )(),
398  : PROPERTY<Owner, T, Base>( aName, METHOD<Owner, T, Base>::Wrap( aSetter ),
399  METHOD<Owner, T, Base>::Wrap( aGetter ), aDisplay )
400  {
401  if ( std::is_enum<T>::value )
402  {
403  m_choices = ENUM_MAP<T>::Instance().Choices();
404  wxASSERT_MSG( m_choices.GetCount() > 0, "No enum choices defined" );
405  }
406  }
407 
408  template<typename SetType, typename GetType>
409  PROPERTY_ENUM( const wxString& aName,
410  void ( Base::*aSetter )( SetType ), GetType( Base::*aGetter )() const,
412  : PROPERTY<Owner, T, Base>( aName, METHOD<Owner, T, Base>::Wrap( aSetter ),
413  METHOD<Owner, T, Base>::Wrap( aGetter ), aDisplay )
414  {
415  if ( std::is_enum<T>::value )
416  {
417  m_choices = ENUM_MAP<T>::Instance().Choices();
418  wxASSERT_MSG( m_choices.GetCount() > 0, "No enum choices defined" );
419  }
420  }
421 
422  virtual void setter( void* obj, wxAny& v ) override
423  {
424  wxCHECK( !( PROPERTY<Owner, T, Base>::IsReadOnly() ), /*void*/ );
425  Owner* o = reinterpret_cast<Owner*>( obj );
426 
427  if( v.CheckType<T>() )
428  {
429  T value = wxANY_AS(v, T);
430  (*PROPERTY<Owner, T, Base>::m_setter)( o, value );
431  }
432  else if (v.CheckType<int>() )
433  {
434  int value = wxANY_AS(v, int);
435  (*PROPERTY<Owner, T, Base>::m_setter)( o, static_cast<T>( value ) );
436  }
437  else
438  {
439  throw std::invalid_argument( "Invalid type requested" );
440  }
441  }
442 
443  virtual wxAny getter( void* obj ) const override
444  {
445  Owner* o = reinterpret_cast<Owner*>( obj );
446  wxAny res = static_cast<T>( (*PROPERTY<Owner, T, Base>::m_getter)( o ) );
447  return res;
448  }
449 
450  const wxPGChoices& Choices() const override
451  {
452  return m_choices;
453  }
454 
455  void SetChoices( const wxPGChoices& aChoices ) override
456  {
457  m_choices = aChoices;
458  }
459 
460  bool HasChoices() const override
461  {
462  return m_choices.GetCount() > 0;
463  }
464 
465 protected:
466  wxPGChoices m_choices;
467 };
468 
469 
471 {
472 public:
473  virtual ~TYPE_CAST_BASE() {}
474  virtual void* operator()( void* aPointer ) const = 0;
475  virtual const void* operator()( const void* aPointer ) const = 0;
476  virtual size_t BaseHash() const = 0;
477  virtual size_t DerivedHash() const = 0;
478 };
479 
480 
481 template<typename Base, typename Derived>
482 class TYPE_CAST : public TYPE_CAST_BASE
483 {
484 public:
486  {
487  }
488 
489  void* operator()( void* aPointer ) const override
490  {
491  Base* base = reinterpret_cast<Base*>( aPointer );
492  return static_cast<Derived*>( base );
493  }
494 
495  const void* operator()( const void* aPointer ) const override
496  {
497  const Base* base = reinterpret_cast<const Base*>( aPointer );
498  return static_cast<const Derived*>( base );
499  }
500 
501  size_t BaseHash() const override
502  {
503  return TYPE_HASH( Base );
504  }
505 
506  size_t DerivedHash() const override
507  {
508  return TYPE_HASH( Derived );
509  }
510 };
511 
512 
513 template<typename T>
514 class ENUM_MAP
515 {
516 public:
518  {
519  static ENUM_MAP<T> inst;
520  return inst;
521  }
522 
523  ENUM_MAP& Map( T aValue, const wxString& aName )
524  {
525  wxASSERT_MSG( m_choices.Index( aName ) == wxNOT_FOUND, "Redefined string for a value in ENUM_MAP" );
526  m_choices.Add( aName, static_cast<int>( aValue ) );
527  m_reverseMap[ aName ] = aValue;
528  return *this;
529  }
530 
531  ENUM_MAP& Undefined( T aValue )
532  {
533  m_undefined = aValue;
534  return *this;
535  }
536 
537  const wxString& ToString( T value ) const
538  {
539  static const wxString s_undef = "UNDEFINED";
540 
541  int idx = m_choices.Index( static_cast<int>( value ) );
542 
543  if( idx >= 0 && idx < (int) m_choices.GetCount() )
544  return m_choices.GetLabel( static_cast<int>( idx ) );
545  else
546  return s_undef;
547  }
548 
549  const T ToEnum( const wxString value )
550  {
551  if( m_reverseMap.count( value ) )
552  return m_reverseMap[ value ];
553  else
554  return m_undefined;
555  }
556 
557  wxPGChoices& Choices()
558  {
559  return m_choices;
560  }
561 
562 private:
563  wxPGChoices m_choices;
564  std::unordered_map<wxString, T> m_reverseMap;
565  T m_undefined; // Returned if the string is not recognized
566 
568  {
569  }
570 };
571 
572 
573 // Helper macros to handle enum types
574 #define DECLARE_ENUM_TO_WXANY(type)\
575  template<>\
576  class wxAnyValueTypeImpl<type> : public wxAnyValueTypeImplBase<type>\
577  {\
578  WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImpl<type>)\
579  public:\
580  wxAnyValueTypeImpl() : wxAnyValueTypeImplBase<type>() {}\
581  virtual ~wxAnyValueTypeImpl() {}\
582  virtual bool ConvertValue( const wxAnyValueBuffer& src,\
583  wxAnyValueType* dstType, wxAnyValueBuffer& dst ) const override\
584  {\
585  type value = GetValue(src);\
586  ENUM_MAP<type>& conv = ENUM_MAP<type>::Instance();\
587  if( dstType->CheckType<wxString>() )\
588  {\
589  wxAnyValueTypeImpl<wxString>::SetValue( conv.ToString( value ), dst );\
590  return true;\
591  }\
592  if( dstType->CheckType<int>() )\
593  {\
594  wxAnyValueTypeImpl<int>::SetValue( static_cast<int>(value), dst );\
595  return true;\
596  }\
597  else\
598  {\
599  return false;\
600  }\
601  }\
602  };
603 
604 #define IMPLEMENT_ENUM_TO_WXANY(type)\
605  WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl<type>)
606 
607 #define ENUM_TO_WXANY(type)\
608  DECLARE_ENUM_TO_WXANY(type)\
609  IMPLEMENT_ENUM_TO_WXANY(type)
610 
612 #define NO_SETTER(owner, type) ((void (owner::*)(type))nullptr)
613 
614 /*
615 #define DECLARE_PROPERTY(owner,type,name,getter,setter) \
616 namespace anonymous {\
617 static PROPERTY<owner,type> prop##_owner##_name_( "##name#", setter, getter );\
618 };
619 */
620 #endif /* PROPERTY_H */
size_t BaseHash() const override
Definition: property.h:501
Display value expressed in degrees.
Definition: property.h:48
virtual void * operator()(void *aPointer) const =0
virtual ~SETTER_BASE()
Definition: property.h:88
static constexpr GETTER_BASE< Owner, T > * Wrap(const T &(Base::*aFunc)() const)
Definition: property.h:142
virtual bool HasChoices() const
Returns true if this PROPERTY has a limited set of possible values.
Definition: property.h:213
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
virtual size_t BaseHash() const =0
PROPERTY_BASE(const wxString &aName, PROPERTY_DISPLAY aDisplay=DEFAULT)
Definition: property.h:173
void * operator()(void *aPointer) const override
Definition: property.h:489
METHOD()=delete
static constexpr GETTER_BASE< Owner, T > * Wrap(const T &(Base::*aFunc)())
Definition: property.h:127
virtual void setter(void *obj, wxAny &v) override
Definition: property.h:354
ENUM_MAP & Undefined(T aValue)
Definition: property.h:531
PROPERTY(const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)(), PROPERTY_DISPLAY aDisplay=DEFAULT)
Definition: property.h:306
const size_t m_typeHash
Property value type-id
Definition: property.h:386
std::unique_ptr< GETTER_BASE< Owner, T > > m_getter
Get method
Definition: property.h:377
virtual T operator()(Owner *aOwner) const =0
const wxPGChoices & Choices() const override
Returns a limited set of possible values (e.g.
Definition: property.h:450
virtual void operator()(Owner *aOwner, T aValue)=0
virtual size_t TypeHash() const =0
Returns type-id of the property type.
std::unique_ptr< SETTER_BASE< Owner, T > > m_setter
Set method
Definition: property.h:374
static ENUM_MAP< T > & Instance()
Definition: property.h:517
PROPERTY_DISPLAY GetDisplay() const
Definition: property.h:259
static constexpr GETTER_BASE< Owner, T > * Wrap(const T(Base::*aFunc)())
Definition: property.h:122
virtual size_t DerivedHash() const =0
T
enum T contains all this lexer's tokens.
static constexpr GETTER_BASE< Owner, T > * Wrap(const T(Base::*aFunc)() const)
Definition: property.h:137
wxPGChoices & Choices()
Definition: property.h:557
std::decay< T >::type BASE_TYPE
Definition: property.h:302
virtual wxAny getter(void *obj) const override
Definition: property.h:366
virtual wxAny getter(void *aObject) const =0
PROPERTY_ENUM(const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)() const, PROPERTY_DISPLAY aDisplay=PROPERTY_DISPLAY::DEFAULT)
Definition: property.h:409
const PROPERTY_DISPLAY m_display
Definition: property.h:289
virtual void setter(void *obj, wxAny &v) override
Definition: property.h:422
SETTER(FuncType aFunc)
Definition: property.h:97
static constexpr GETTER_BASE< Owner, T > * Wrap(T(Base::*aFunc)() const)
Definition: property.h:132
void operator()(Owner *aOwner, T aValue) override
Definition: property.h:102
bool IsReadOnly() const override
Definition: property.h:338
FuncType m_func
Definition: property.h:81
Display value expressed in distance units (mm/inch)
Definition: property.h:47
const void * operator()(const void *aPointer) const override
Definition: property.h:495
PROPERTY_ENUM(const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)(), PROPERTY_DISPLAY aDisplay=PROPERTY_DISPLAY::DEFAULT)
Definition: property.h:395
const T ToEnum(const wxString value)
Definition: property.h:549
virtual ~TYPE_CAST_BASE()
Definition: property.h:473
void SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Sets a callback function to determine whether an object provides this property.
Definition: property.h:229
PROPERTY(const wxString &aName, SETTER_BASE< Owner, T > *s, GETTER_BASE< Owner, T > *g, PROPERTY_DISPLAY aDisplay)
Definition: property.h:344
Convert decidegrees to degrees for display.
Definition: property.h:49
virtual wxAny getter(void *obj) const override
Definition: property.h:443
const wxString m_name
Definition: property.h:288
const wxString & Name() const
Definition: property.h:186
bool HasChoices() const override
Returns true if this PROPERTY has a limited set of possible values.
Definition: property.h:460
static constexpr SETTER_BASE< Owner, T > * Wrap(void(Base::*aFunc)(T &))
Definition: property.h:152
virtual ~GETTER_BASE()
Definition: property.h:61
static constexpr SETTER_BASE< Owner, T > * Wrap(void(Base::*aFunc)(T))
Definition: property.h:147
PROPERTY_DISPLAY
Common property types
Definition: property.h:44
Class that other classes need to inherit from, in order to be inspectable.
Definition: inspectable.h:33
virtual ~PROPERTY()
Definition: property.h:352
T operator()(Owner *aOwner) const override
Definition: property.h:75
virtual const wxPGChoices & Choices() const
Returns a limited set of possible values (e.g.
Definition: property.h:195
virtual void setter(void *aObject, wxAny &aValue)=0
T m_undefined
Definition: property.h:565
size_t Id() const
Returns unique ID of the property.
Definition: property.h:252
size_t DerivedHash() const override
Definition: property.h:506
std::function< bool(INSPECTABLE *)> m_availFunc
Condition that determines whether the property is available
Definition: property.h:292
virtual bool IsReadOnly() const =0
void SetChoices(const wxPGChoices &aChoices) override
Sets the possible values for for the property.
Definition: property.h:455
static constexpr GETTER_BASE< Owner, T > * Wrap(T(Base::*aFunc)())
Definition: property.h:117
virtual void SetChoices(const wxPGChoices &aChoices)
Sets the possible values for for the property.
Definition: property.h:204
size_t nextId
Used to generate unique IDs
Definition: property.h:170
bool Available(INSPECTABLE *aObject) const
Returns true if aObject offers this PROPERTY.
Definition: property.h:221
TYPE_CAST()
Definition: property.h:485
static bool empty(const wxTextEntryBase *aCtrl)
std::unordered_map< wxString, T > m_reverseMap
Definition: property.h:564
const size_t m_id
Definition: property.h:287
static constexpr SETTER_BASE< Owner, T > * Wrap(void(Base::*aFunc)(const T &))
Definition: property.h:157
size_t BaseHash() const override
Returns type-id of the Base class.
Definition: property.h:328
wxPGChoices m_choices
Definition: property.h:563
const size_t m_ownerHash
Owner class type-id
Definition: property.h:380
virtual size_t BaseHash() const =0
Returns type-id of the Base class.
size_t OwnerHash() const override
Returns type-id of the Owner class.
Definition: property.h:323
T get(void *aObject)
Definition: property.h:273
void set(void *aObject, T aValue)
Definition: property.h:266
Default property for a given type.
Definition: property.h:46
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition: property.h:523
FuncType m_func
Definition: property.h:109
virtual size_t OwnerHash() const =0
Returns type-id of the Owner class.
size_t TypeHash() const override
Returns type-id of the property type.
Definition: property.h:333
const size_t m_baseHash
Base class type-id
Definition: property.h:383
virtual ~PROPERTY_BASE()
Definition: property.h:182
wxPGChoices m_choices
Definition: property.h:466
const wxString & ToString(T value) const
Definition: property.h:537
PROPERTY(const wxString &aName, void(Base::*aSetter)(SetType), GetType(Base::*aGetter)() const, PROPERTY_DISPLAY aDisplay=DEFAULT)
Definition: property.h:315
GETTER(FuncType aFunc)
Definition: property.h:70