BloombergLP::bdlc::PackedIntArray

Space-efficient value-semantic array of packed TYPE integers.

Synopsis

Declared in <bdlc_packedintarray.h>

template<class TYPE>
class PackedIntArray;

Description

This space-efficient value-semantic array class represents a sequence of TYPE elements; TYPE 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. This class provides accessors that return iterators that provide non-modifiable access to its elements. The returned iterators, unlike those returned by a vector<int> are not invalidated upon reallocation.

Type Aliases

NameDescription
const_iterator Constant iterator type for this packed array.
value_type Element value type for this packed array.

Member Functions

NameDescription
PackedIntArray [constructor]Constructors
~PackedIntArray [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
back Return the value of the element at the back of this array.
bdexStreamIn Assign to this object the value read from the specified input stream.
bdexStreamOut Write this value to the specified output stream.
begin Return an iterator to the first element (or end() if empty).
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.
end Return an iterator one past the last element in this array.
front Return the value of the element at the front of this array.
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
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.

Non-Member Functions

NameDescription
operator!=Return true if lhs and rhs do not have the same value.
operator==Return true if lhs and rhs have the same value.
swapExchange the values of the specified a and b objects.