BloombergLP::bdld::ManagedDatum

This class implements a smart-pointer-like resource manager for a Datum object.

Synopsis

Declared in <bdld_manageddatum.h>

class ManagedDatum;

Type Aliases

NameDescription
allocator_type Alias for the allocator type used by this class.

Member Functions

NameDescription
ManagedDatum [constructor]Constructors
~ManagedDatum [destructor]Destroy this object and release all dynamically allocated memory managed by this object.
operator= Assignment operators
adopt Take ownership of the specified obj and destroy the Datum object previously managed by this object. The behavior is undefined unless obj was allocated using the same allocator used by this object and is not subsequently destroyed externally using Datum::destroy.
allocator Return get_allocator().mechanism().
clone Assign to this object the specified value by making a "deep copy" of value, so that any dynamically allocated memory managed by value is cloned and not shared with value.
datum Return a const reference to the Datum object managed by this object.
get_allocator Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used.
makeNull Make the Datum object managed by this object null and release all dynamically allocated memory managed by this object.
operator* Return a const reference to the Datum object managed by this object.
operator-> Return an address providing non-modifiable access to the Datum object managed by this object.
print Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to the modifiable stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect.
release Return, by value, the Datum object managed by this object and set the managed object to null. Ownership of the previously managed Datum object is transferred to the caller.
swap Efficiently exchange the value of this object with the value of the specified other object. This method provides the no-throw exception-safety guarantee. The behavior is undefined unless this object was created with the same allocator as other.
operator BloombergLP::bslmf::NestedTraitDeclaration<ManagedDatum, IsBitwiseMoveable> 'ManagedDatum' objects are allocator-aware and bitwise movable.

Non-Member Functions

NameDescription
operator!=Return true if the specified lhs and rhs ManagedDatum objects do not have the same value, and false otherwise. Two ManagedDatum objects do not have the same value if their corresponding managed Datum objects do not have the same value. See the function-level documentation of the Datum equality-comparison operators for details.
operator==Return true if the specified lhs and rhs ManagedDatum objects have the same value, and false otherwise. Two ManagedDatum objects have the same value if their corresponding managed Datum objects have the same value. See the function-level documentation of the Datum equality-comparison operators for details.
swapExchange the values of the specified a and b objects. This function provides the no-throw exception-safety guarantee if the two objects were created with the same allocator and the basic guarantee otherwise. Note that in case the allocators are different this function places a clone of a into b, and vice versa. See {Value Semantics} on details of the cloning that may happen.