+inline bool
+SGPropertyNode::get_bool () const
+{
+ if (_tied)
+ return _value.bool_val->getValue();
+ else
+ return _local_val.bool_val;
+}
+
+inline int
+SGPropertyNode::get_int () const
+{
+ if (_tied)
+ return _value.int_val->getValue();
+ else
+ return _local_val.int_val;
+}
+
+inline long
+SGPropertyNode::get_long () const
+{
+ if (_tied)
+ return _value.long_val->getValue();
+ else
+ return _local_val.long_val;
+}
+
+inline float
+SGPropertyNode::get_float () const
+{
+ if (_tied)
+ return _value.float_val->getValue();
+ else
+ return _local_val.float_val;
+}
+
+inline double
+SGPropertyNode::get_double () const
+{
+ if (_tied)
+ return _value.double_val->getValue();
+ else
+ return _local_val.double_val;
+}
+
+inline const char *
+SGPropertyNode::get_string () const
+{
+ if (_tied)
+ return _value.string_val->getValue();
+ else
+ return _local_val.string_val;
+}
+
+inline bool
+SGPropertyNode::set_bool (bool val)
+{
+ if (_tied) {
+ return _value.bool_val->setValue(val);
+ } else {
+ _local_val.bool_val = val;
+ return true;
+ }
+}
+
+inline bool
+SGPropertyNode::set_int (int val)
+{
+ if (_tied) {
+ return _value.int_val->setValue(val);
+ } else {
+ _local_val.int_val = val;
+ return true;
+ }
+}
+
+inline bool
+SGPropertyNode::set_long (long val)
+{
+ if (_tied) {
+ return _value.long_val->setValue(val);
+ } else {
+ _local_val.long_val = val;
+ return true;
+ }
+}
+
+inline bool
+SGPropertyNode::set_float (float val)
+{
+ if (_tied) {
+ return _value.float_val->setValue(val);
+ } else {
+ _local_val.float_val = val;
+ return true;
+ }
+}
+
+inline bool
+SGPropertyNode::set_double (double val)
+{
+ if (_tied) {
+ return _value.double_val->setValue(val);
+ } else {
+ _local_val.double_val = val;
+ return true;
+ }
+}
+
+inline bool
+SGPropertyNode::set_string (const char * val)
+{
+ if (_tied) {
+ return _value.string_val->setValue(val);
+ } else {
+ delete (char *)_local_val.string_val;
+ _local_val.string_val = copy_string(val);
+ return true;
+ }
+}
+
+void
+SGPropertyNode::clear_value ()
+{
+ switch (_type) {
+ case NONE:
+ break;
+ case ALIAS:
+ _value.alias = 0;
+ break;
+ case BOOL:
+ if (_tied) {
+ delete _value.bool_val;
+ _value.bool_val = 0;
+ }
+ _local_val.bool_val = SGRawValue<bool>::DefaultValue;
+ break;
+ case INT:
+ if (_tied) {
+ delete _value.int_val;
+ _value.int_val = 0;
+ }
+ _local_val.int_val = SGRawValue<int>::DefaultValue;
+ break;
+ case LONG:
+ if (_tied) {
+ delete _value.long_val;
+ _value.long_val = 0L;
+ }
+ _local_val.long_val = SGRawValue<long>::DefaultValue;
+ break;
+ case FLOAT:
+ if (_tied) {
+ delete _value.float_val;
+ _value.float_val = 0;
+ }
+ _local_val.float_val = SGRawValue<float>::DefaultValue;
+ break;
+ case DOUBLE:
+ if (_tied) {
+ delete _value.double_val;
+ _value.double_val = 0;
+ }
+ _local_val.double_val = SGRawValue<double>::DefaultValue;
+ break;
+ case STRING:
+ case UNSPECIFIED:
+ if (_tied) {
+ delete _value.string_val;
+ _value.string_val = 0;
+ } else {
+ delete (char *)_local_val.string_val;
+ }
+ _local_val.string_val = 0;
+ break;
+ }
+ _tied = false;
+ _type = NONE;
+}
+
+
+/**
+ * Get the value as a string.
+ */
+const char *
+SGPropertyNode::make_string () const
+{
+ if (!getAttribute(READ))
+ return "";
+
+ switch (_type) {
+ case ALIAS:
+ return _value.alias->getStringValue();
+ case BOOL:
+ if (get_bool())
+ return "true";
+ else
+ return "false";
+ case INT:
+ sprintf(_buffer, "%d", get_int());
+ return _buffer;
+ case LONG:
+ sprintf(_buffer, "%ld", get_long());
+ return _buffer;
+ case FLOAT:
+ sprintf(_buffer, "%f", get_float());
+ return _buffer;
+ case DOUBLE:
+ sprintf(_buffer, "%f", get_double());
+ return _buffer;
+ case STRING:
+ case UNSPECIFIED:
+ return get_string();
+ case NONE:
+ default:
+ return "";
+ }
+}
+
+/**
+ * Trace a write access for a property.
+ */
+void
+SGPropertyNode::trace_write () const
+{
+#if PROPS_STANDALONE
+ cerr << "TRACE: Write node " << getPath () << ", value\""
+ << make_string() << '"' << endl;
+#else
+ SG_LOG(SG_GENERAL, SG_INFO, "TRACE: Write node " << getPath()
+ << ", value\"" << make_string() << '"');
+#endif
+}
+
+/**
+ * Trace a read access for a property.
+ */
+void
+SGPropertyNode::trace_read () const
+{
+#if PROPS_STANDALONE
+ cerr << "TRACE: Write node " << getPath () << ", value \""
+ << make_string() << '"' << endl;
+#else
+ SG_LOG(SG_GENERAL, SG_INFO, "TRACE: Read node " << getPath()
+ << ", value \"" << make_string() << '"');
+#endif
+}
+
+
+\f
+////////////////////////////////////////////////////////////////////////
+// Public methods from SGPropertyNode.
+////////////////////////////////////////////////////////////////////////