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
, anditem
functions is maintained by the NVList; these return values must not be freed by the caller. - The
char*
parameters to theadd_item_consume
andadd_value_consume
functions and theAny*
parameter to theadd_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 theNamedValue::value()
operation to modify thevalue
attribute of the underlying NamedValue, if desired. - The
remove
function also callsCORBA::release
on the removed NamedValue.
The following sections describe NVList member functions.