8#ifndef INCLUDED_BDLD_MANAGEDDATUM
9#define INCLUDED_BDLD_MANAGEDDATUM
237#include <bdlscm_version.h>
252#include <bsl_algorithm.h>
253#include <bsl_iosfwd.h>
385 bsl::ostream&
print(bsl::ostream& stream,
387 int spacesPerLevel = 4)
const;
435: d_data(
Datum::createNull())
442: d_data(
Datum::createNull())
443, d_allocator(allocator)
450, d_allocator(allocator)
457: d_allocator(allocator)
459 d_data = original.d_data.
clone(d_allocator);
480 if (&obj != &d_data) {
512 swap(d_data, other.d_data);
551 int spacesPerLevel)
const
553 return d_data.
print(stream, level, spacesPerLevel);
562 return (lhs.datum() == rhs.datum());
568 return (lhs.datum() != rhs.datum());
572bsl::ostream&
bdld::operator<<(bsl::ostream& stream,
const ManagedDatum& rhs)
574 return (stream << rhs.datum());
579void bdld::swap(ManagedDatum& a, ManagedDatum& b)
581 if (a.get_allocator() == b.get_allocator()) {
585 ManagedDatum tempA(a, b.get_allocator());
586 ManagedDatum tempB(b, a.get_allocator());
Definition bdld_datum.h:787
static Datum createNull()
Return, by value, a datum having no value.
Definition bdld_datum.h:3887
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static void destroy(const Datum &value, const AllocatorType &allocator)
Datum clone(const AllocatorType &allocator) const
Definition bdld_manageddatum.h:266
~ManagedDatum()
Definition bdld_manageddatum.h:463
void swap(ManagedDatum &other)
Definition bdld_manageddatum.h:507
ManagedDatum()
Definition bdld_manageddatum.h:434
void adopt(const Datum &obj)
Definition bdld_manageddatum.h:478
bslma::Allocator * allocator() const
Definition bdld_manageddatum.h:537
BSLMF_NESTED_TRAIT_DECLARATION(ManagedDatum, bslmf::IsBitwiseMoveable)
'ManagedDatum' objects are allocator-aware and bitwise movable.
const Datum * operator->() const
Definition bdld_manageddatum.h:517
const Datum & datum() const
Definition bdld_manageddatum.h:529
void makeNull()
Definition bdld_manageddatum.h:493
bsl::allocator allocator_type
Definition bdld_manageddatum.h:270
Datum release()
Definition bdld_manageddatum.h:499
void clone(const Datum &value)
Definition bdld_manageddatum.h:486
allocator_type get_allocator() const
Definition bdld_manageddatum.h:543
const Datum & operator*() const
Definition bdld_manageddatum.h:523
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition bdld_manageddatum.h:549
ManagedDatum & operator=(const ManagedDatum &rhs)
Definition bdld_manageddatum.h:470
Definition bslma_bslallocator.h:580
BloombergLP::bslma::Allocator * mechanism() const
Definition bslma_bslallocator.h:1126
Definition bslma_allocator.h:457
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdld_datum.h:730
bsl::ostream & operator<<(bsl::ostream &stream, const Datum &rhs)
bool operator==(const Datum &lhs, const Datum &rhs)
void swap(ManagedDatum &a, ManagedDatum &b)
bool operator!=(const Datum &lhs, const Datum &rhs)
Definition bslmf_isbitwisemoveable.h:718