JSBSim Flight Dynamics Model 1.2.4 (07 Feb 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
SGRawValueMethodsIndexedEnum< C, T, U > Class Template Reference

Detailed Description

template<class C, class T, class U>
class SGRawValueMethodsIndexedEnum< C, T, U >

Definition at line 86 of file FGPropertyManager.h.

+ Inheritance diagram for SGRawValueMethodsIndexedEnum< C, T, U >:
+ Collaboration diagram for SGRawValueMethodsIndexedEnum< C, T, U >:

Public Types

typedef T(C::* getter_t) (U) const
 
typedef void(C::* setter_t) (U, T)
 

Public Member Functions

 SGRawValueMethodsIndexedEnum (C &obj, U index, getter_t getter=nullptr, setter_t setter=nullptr)
 
SGRawclone () const override
 
getValue () const override
 Return the underlying value.
 
bool setValue (T value) override
 Assign a new underlying value.
 
- Public Member Functions inherited from SGRawValue< T >
 SGRawValue ()
 Constructor.
 
virtual ~SGRawValue ()
 Destructor.
 
bool DefaultValue ()
 
const char * DefaultValue ()
 
virtual simgear::props::Type getType () const
 Return the type tag for this raw value type.
 

Additional Inherited Members

- Static Public Member Functions inherited from SGRawValue< T >
static T DefaultValue ()
 The default underlying value for this type.
 

Member Typedef Documentation

◆ getter_t

template<class C , class T , class U >
typedef T(C::* getter_t) (U) const

Definition at line 89 of file FGPropertyManager.h.

◆ setter_t

template<class C , class T , class U >
typedef void(C::* setter_t) (U, T)

Definition at line 90 of file FGPropertyManager.h.

Constructor & Destructor Documentation

◆ SGRawValueMethodsIndexedEnum()

template<class C , class T , class U >
SGRawValueMethodsIndexedEnum ( C &  obj,
index,
getter_t  getter = nullptr,
setter_t  setter = nullptr 
)
inline

Definition at line 91 of file FGPropertyManager.h.

93 : _obj(obj), _index(index), _getter(getter), _setter(setter) {}

Member Function Documentation

◆ clone()

template<class C , class T , class U >
SGRaw * clone ( ) const
inlineoverride

Definition at line 102 of file FGPropertyManager.h.

102 {
103 return new SGRawValueMethodsIndexedEnum(_obj, _index, _getter, _setter);
104 }

◆ getValue()

template<class C , class T , class U >
T getValue ( ) const
inlineoverridevirtual

Return the underlying value.

Returns
The actual value for the property.
See also
setValue

Implements SGRawValue< T >.

Definition at line 94 of file FGPropertyManager.h.

94 {
95 if (_getter) { return (_obj.*_getter)(_index); }
96 else { return SGRawValue<T>::DefaultValue(); }
97 }
static T DefaultValue()
The default underlying value for this type.
Definition props.hxx:332
+ Here is the call graph for this function:

◆ setValue()

template<class C , class T , class U >
bool setValue ( value)
inlineoverridevirtual

Assign a new underlying value.

If the new value cannot be set (because this is a read-only raw value, or because the new value is not acceptable for some reason) this method returns false and leaves the original value unchanged.

Parameters
valueThe actual value for the property.
Returns
true if the value was set successfully, false otherwise.
See also
getValue

Implements SGRawValue< T >.

Definition at line 98 of file FGPropertyManager.h.

98 {
99 if (_setter) { (_obj.*_setter)(_index, value); return true; }
100 else return false;
101 }

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