14.7.1 Memory Management

NVList has the following special memory management rules:

  • Ownership of the return values of the add, add_item, add_value, add_item_consume, add_value_consume, and item functions is maintained by the NVList; these return values must not be freed by the caller.
  • The char* parameters to the add_item_consume and add_value_consume functions and the Any* parameter to the add_value_consume function are consumed by the NVList. The caller may not access these data after they have been passed to these functions because the NVList may copy them and destroy the originals immediately. The caller must use the NamedValue::value() operation to modify the value attribute of the underlying NamedValue, if desired.
  • The remove function also calls CORBA::release on the removed NamedValue.

The following sections describe NVList member functions.