+ _local_val.string_val = 0;
+}
+
+
+/**
+ * Copy constructor.
+ */
+SGPropertyNode::SGPropertyNode (const SGPropertyNode &node)
+ : _index(node._index),
+ _parent(0), // don't copy the parent
+ _path_cache(0),
+ _type(node._type),
+ _tied(node._tied),
+ _attr(node._attr)
+{
+ _name = copy_string(node._name);
+ _local_val.string_val = 0;
+ switch (_type) {
+ case NONE:
+ break;
+ case ALIAS:
+ _value.alias = node._value.alias;
+ _tied = false;
+ break;
+ case BOOL:
+ if (_tied) {
+ _tied = true;
+ _value.bool_val = node._value.bool_val->clone();
+ } else {
+ _tied = false;
+ set_bool(node.get_bool());
+ }
+ break;
+ case INT:
+ if (_tied) {
+ _tied = true;
+ _value.int_val = node._value.int_val->clone();
+ } else {
+ _tied = false;
+ set_int(node.get_int());
+ }
+ break;
+ case LONG:
+ if (_tied) {
+ _tied = true;
+ _value.long_val = node._value.long_val->clone();
+ } else {
+ _tied = false;
+ set_long(node.get_long());
+ }
+ break;
+ case FLOAT:
+ if (_tied) {
+ _tied = true;
+ _value.float_val = node._value.float_val->clone();
+ } else {
+ _tied = false;
+ set_float(node.get_float());
+ }
+ break;
+ case DOUBLE:
+ if (_tied) {
+ _tied = true;
+ _value.double_val = node._value.double_val->clone();
+ } else {
+ _tied = false;
+ set_double(node.get_double());
+ }
+ break;
+ case STRING:
+ case UNSPECIFIED:
+ if (_tied) {
+ _tied = true;
+ _value.string_val = node._value.string_val->clone();
+ } else {
+ _tied = false;
+ set_string(node.get_string());
+ }
+ break;
+ }
+}
+
+
+/**
+ * Convenience constructor.
+ */
+SGPropertyNode::SGPropertyNode (const char * name,
+ int index,
+ SGPropertyNode * parent)
+ : _index(index),
+ _parent(parent),
+ _path_cache(0),
+ _type(NONE),
+ _tied(false),
+ _attr(READ|WRITE)
+{
+ _name = copy_string(name);
+ _local_val.string_val = 0;
+}
+
+
+/**
+ * Destructor.
+ */
+SGPropertyNode::~SGPropertyNode ()
+{
+ delete (char *)_name;
+ for (int i = 0; i < (int)_children.size(); i++) {
+ delete _children[i];
+ }
+// delete _path_cache;
+ clear_value();