JSBSim Flight Dynamics Model 1.2.3 (07 Jun 2025)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
props.hxx File Reference

Interface definition for a property list. More...

#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <typeinfo>
#include "simgear/compiler.h"
#include "JSBSim_API.h"
#include <simgear/structure/SGReferenced.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
+ Include dependency graph for props.hxx:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Compare
 
struct  disable_if< Cond, T >
 
struct  disable_if_c< B, T >
 
struct  disable_if_c< true, T >
 
struct  enable_if< Cond, T >
 
struct  enable_if_c< B, T >
 
struct  enable_if_c< false, T >
 
struct  Hash
 
class  SGPropertyChangeCallback< T >
 Convenience class for change listener callbacks without creating a derived class implementing a "valueChanged" method. More...
 
class  SGPropertyChangeListener
 The property change listener interface. More...
 
class  SGPropertyNode
 A node in a property tree. More...
 
class  SGRaw
 Base class for SGRawValue classes that holds no type information. More...
 
class  SGRawBase< T, 0 >
 
class  SGRawBase< T, 1 >
 
class  SGRawExtended
 
class  SGRawValue< T >
 Abstract base class for a raw value. More...
 
class  SGRawValueContainer< T >
 A raw value that contains its value. More...
 
class  SGRawValueFunctions< T >
 A value managed through static functions. More...
 
class  SGRawValueFunctionsIndexed< T >
 An indexed value bound to static functions. More...
 
class  SGRawValueMethods< C, T >
 A value managed through an object and access methods. More...
 
class  SGRawValueMethodsIndexed< C, T >
 An indexed value managed through an object and access methods. More...
 
class  SGRawValuePointer< T >
 A raw value bound to a pointer. More...
 

Namespaces

namespace  simgear
 Utility function for creation of a child property node using a relative path.
 
namespace  simgear::props
 Property value types.
 

Macros

#define DEFINTERNALPROP(TYPE, PROP)
 
#define PROPS_STANDALONE   1
 
#define SG_ALERT   0
 
#define SG_GENERAL   0
 
#define SG_LOG(type, level, message)   (type) ? (std::cerr <<message << endl) : (std::cout <<message << endl)
 
#define SG_WARN   1
 

Typedefs

typedef SGSharedPtr< const SGPropertyNodeSGConstPropertyNode_ptr
 
typedef SGSharedPtr< SGPropertyNodeSGPropertyNode_ptr
 

Enumerations

enum  Type {
  NONE = 0 , ALIAS , BOOL , INT ,
  LONG , FLOAT , DOUBLE , STRING ,
  UNSPECIFIED , EXTENDED , VEC3D , VEC4D
}
 The possible types of an SGPropertyNode. More...
 

Functions

 DEFINTERNALPROP (bool, BOOL)
 
 DEFINTERNALPROP (const char *, STRING)
 
 DEFINTERNALPROP (const char[], STRING)
 
 DEFINTERNALPROP (double, DOUBLE)
 
 DEFINTERNALPROP (float, FLOAT)
 
 DEFINTERNALPROP (int, INT)
 
 DEFINTERNALPROP (long, LONG)
 
template<typename T >
getValue (const SGPropertyNode *)
 
template<>
bool getValue< bool > (const SGPropertyNode *node)
 
template<>
const char * getValue< const char * > (const SGPropertyNode *node)
 
template<>
double getValue< double > (const SGPropertyNode *node)
 
template<>
float getValue< float > (const SGPropertyNode *node)
 
template<>
int getValue< int > (const SGPropertyNode *node)
 
template<>
long getValue< long > (const SGPropertyNode *node)
 
template<>
std::string getValue< std::string > (const SGPropertyNode *node)
 
size_t hash_value (const SGPropertyNode &node)
 
SGPropertyNodemakeChild (SGPropertyNode *parent, const char *name, int index=0)
 Utility function for creation of a child property node.
 
template<typename StringType >
SGPropertyNodemakeNode (SGPropertyNode *parent, const StringType &name)
 
template<typename T >
parseString (const std::string &str)
 Parse a string as an object of a given type.
 
template<typename T >
std::istream & readFrom (std::istream &stream, T &result)
 
bool setValue (SGPropertyNode *node, bool value)
 
bool setValue (SGPropertyNode *node, const char *value)
 
bool setValue (SGPropertyNode *node, const std::string &value)
 
bool setValue (SGPropertyNode *node, double value)
 
bool setValue (SGPropertyNode *node, float value)
 
bool setValue (SGPropertyNode *node, int value)
 
bool setValue (SGPropertyNode *node, long value)
 

Detailed Description

Interface definition for a property list.

Started Fall 2000 by David Megginson, david.nosp@m.@meg.nosp@m.ginso.nosp@m.n.co.nosp@m.m This code is released into the Public Domain.

See props.html for documentation [replace with URL when available].

Definition in file props.hxx.

Macro Definition Documentation

◆ DEFINTERNALPROP

#define DEFINTERNALPROP (   TYPE,
  PROP 
)
Value:
template<> \
struct PropertyTraits<TYPE> \
{ \
static const Type type_tag = PROP; \
enum { Internal = 1 }; \
}

Definition at line 182 of file props.hxx.

185{ \
186 static const Type type_tag = PROP; \
187 enum { Internal = 1 }; \
188}
Type
The possible types of an SGPropertyNode.
Definition props.hxx:160

◆ PROPS_STANDALONE

#define PROPS_STANDALONE   1

Definition at line 15 of file props.hxx.

◆ SG_ALERT

#define SG_ALERT   0

Definition at line 30 of file props.hxx.

◆ SG_GENERAL

#define SG_GENERAL   0

Definition at line 29 of file props.hxx.

◆ SG_LOG

#define SG_LOG (   type,
  level,
  message 
)    (type) ? (std::cerr <<message << endl) : (std::cout <<message << endl)

Definition at line 32 of file props.hxx.

◆ SG_WARN

#define SG_WARN   1

Definition at line 31 of file props.hxx.

Typedef Documentation

◆ SGConstPropertyNode_ptr

typedef SGSharedPtr<const SGPropertyNode> SGConstPropertyNode_ptr

Definition at line 713 of file props.hxx.

◆ SGPropertyNode_ptr

typedef SGSharedPtr<SGPropertyNode> SGPropertyNode_ptr

Definition at line 712 of file props.hxx.

Function Documentation

◆ getValue< bool >()

template<>
bool getValue< bool > ( const SGPropertyNode node)
inline

Definition at line 1847 of file props.hxx.

1847{ return node->getBoolValue(); }
bool getBoolValue() const
Get a bool value for this node.

◆ getValue< const char * >()

template<>
const char * getValue< const char * > ( const SGPropertyNode node)
inline

Definition at line 1868 of file props.hxx.

1869{
1870 return node->getStringValue ();
1871}
const char * getStringValue() const
Get a string value for this node.

◆ getValue< double >()

template<>
double getValue< double > ( const SGPropertyNode node)
inline

Definition at line 1862 of file props.hxx.

1863{
1864 return node->getDoubleValue();
1865}
double getDoubleValue() const
Get a double value for this node.

◆ getValue< float >()

template<>
float getValue< float > ( const SGPropertyNode node)
inline

Definition at line 1856 of file props.hxx.

1857{
1858 return node->getFloatValue();
1859}
float getFloatValue() const
Get a float value for this node.

◆ getValue< int >()

template<>
int getValue< int > ( const SGPropertyNode node)
inline

Definition at line 1850 of file props.hxx.

1850{ return node->getIntValue(); }
int getIntValue() const
Get an int value for this node.

◆ getValue< long >()

template<>
long getValue< long > ( const SGPropertyNode node)
inline

Definition at line 1853 of file props.hxx.

1853{ return node->getLongValue(); }
long getLongValue() const
Get a long int value for this node.

◆ getValue< std::string >()

template<>
std::string getValue< std::string > ( const SGPropertyNode node)
inline

Definition at line 1874 of file props.hxx.

1875{
1876 return node->getStringValue();
1877}

◆ makeChild()

SGPropertyNode * makeChild ( SGPropertyNode parent,
const char *  name,
int  index = 0 
)
inline

Utility function for creation of a child property node.

Definition at line 2039 of file props.hxx.

2041{
2042 return parent->getChild(name, index, true);
2043}
SGPropertyNode * getChild(int position)
Get a child node by position (NOT index).
+ Here is the call graph for this function:

◆ setValue() [1/7]

bool setValue ( SGPropertyNode node,
bool  value 
)
inline

Definition at line 1879 of file props.hxx.

1880{
1881 return node->setBoolValue(value);
1882}
bool setBoolValue(bool value)
Set a bool value for this node.

◆ setValue() [2/7]

bool setValue ( SGPropertyNode node,
const char *  value 
)
inline

Definition at line 1904 of file props.hxx.

1905{
1906 return node->setStringValue(value);
1907}
bool setStringValue(const char *value)
Set a string value for this node.

◆ setValue() [3/7]

bool setValue ( SGPropertyNode node,
const std::string &  value 
)
inline

Definition at line 1909 of file props.hxx.

1910{
1911 return node->setStringValue(value.c_str());
1912}

◆ setValue() [4/7]

bool setValue ( SGPropertyNode node,
double  value 
)
inline

Definition at line 1899 of file props.hxx.

1900{
1901 return node->setDoubleValue(value);
1902}
bool setDoubleValue(double value)
Set a double value for this node.

◆ setValue() [5/7]

bool setValue ( SGPropertyNode node,
float  value 
)
inline

Definition at line 1894 of file props.hxx.

1895{
1896 return node->setFloatValue(value);
1897}
bool setFloatValue(float value)
Set a float value for this node.

◆ setValue() [6/7]

bool setValue ( SGPropertyNode node,
int  value 
)
inline

Definition at line 1884 of file props.hxx.

1885{
1886 return node->setIntValue(value);
1887}
bool setIntValue(int value)
Set an int value for this node.

◆ setValue() [7/7]

bool setValue ( SGPropertyNode node,
long  value 
)
inline

Definition at line 1889 of file props.hxx.

1890{
1891 return node->setLongValue(value);
1892}
bool setLongValue(long value)
Set a long int value for this node.