BloombergLP::bdlc::PackedIntArrayImp

Space-efficient value-semantic array of packed integer elements.

Synopsis

Declared in <bdlc_packedintarray.h>

template<class STORAGE>
class PackedIntArrayImp;

Description

This space-efficient value-semantic array class represents a sequence of STORAGE::EightByteStorageType elements; STORAGE::EightByteStorageType must be convertible to either a signed or unsigned 64-bit integer using static_cast. The interface provides functionality similar to a vector<int> however references to individual elements are not provided.

Type Aliases

NameDescription
ElementType Element storage type used by this packed array implementation.

Member Functions

NameDescription
PackedIntArrayImp [constructor]Constructors
~PackedIntArrayImp [destructor]Destroy this object
operator= Assign to this array the value of the specified rhs array.
allocator Return the allocator used by this array to supply memory.
append append overloads
bdexStreamIn Assign to this object the value read from the specified input stream.
bdexStreamOut Write this value to the specified output stream.
bytesPerElement Return the number of bytes currently used to store each element in this array.
capacity Return the number of elements this array can hold in terms of the current data type used to store its elements.
insert insert overloads
isEmpty Return true if there are no elements in this array, and false otherwise.
isEqual Return true if this and other have the same value.
length Return number of elements in this array.
operator[] Return the value of the element at the specified index.
pop_back Remove the last element from this array. The behavior is undefined unless 0 < length() .
print Write the value of this array to the specified output stream.
push_back Append an element having the specified value to this array.
remove remove overloads
removeAll Remove all the elements from this array and set the storage required per element to one byte.
replace replace overloads
reserveCapacity reserveCapacity overloads
reserveCapacityImp Make the capacity of this array at least requiredCapacityInBytes.
resize Set the length of this array to the specified numElements.
swap Efficiently exchange the value of this array with that of other.

Static Member Functions

NameDescription
maxSupportedBdexVersion Return the BDEX version for the given serializationVersion.

Static Data Members

NameDescription
k_MAX_CAPACITY Maximum capacity in bytes for this packed array implementation.