8#ifndef INCLUDED_BDLC_QUEUE
9#define INCLUDED_BDLC_QUEUE
224#include <bdlscm_version.h>
237#include <bsl_cstring.h>
238#include <bsl_ostream.h>
241#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
334 int calculateSufficientSize(
int minLength,
int size);
351 int memcpyCircular(T *dstArray,
370 void memShiftLeft(T *array,
387 void memShiftRight(T *array,
405 void copyData(T *dstArray,
424 int increaseSizeImp(T **addrArray,
470 const T& initialValue,
484 Queue(
const InitialCapacity& numElements,
552 void append(
const Queue& srcQueue,
int srcIndex,
int numElements);
583 void insert(
int dstIndex,
const T& item);
601 const Queue& srcQueue,
692 const Queue& srcQueue,
741 template <
class STREAM>
748 void swap(
int index1,
int index2);
799 bsl::ostream&
print(bsl::ostream& stream,
801 int spacesPerLevel)
const;
810 for (
int i = 0; i <
length(); ++i) {
811 stream <<
' ' << (*this)[i];
813 return stream <<
" ]";
825 template <
class STREAM>
828#ifndef BDE_OMIT_INTERNAL_DEPRECATED
884 return d_back > d_front ? d_back - d_front - 1
885 : d_back + d_size - d_front - 1;
892 const int len = minLength + k_EXTRA_CAPACITY;
894 size *= k_GROW_FACTOR;
900int Queue<T>::memcpyCircular(T *dstArray,
913 if (srcA + numElements <= srcSize) {
914 int lenSrcA = numElements;
921 int dstLen = dstSize - dst;
923 if (dstLen >= lenSrcA) {
926 for (
int i = 0; i < lenSrcA; ++i) {
927 new (&dstArray[dst + i]) T(srcArray[srcA + i]);
934 for (
int i = 0; i < dstLen; ++i) {
935 new (&dstArray[dst + i]) T(srcArray[srcA + i]);
947 for (
int i = 0; i < lenSrcA; ++i) {
948 new (&dstArray[i]) T(srcArray[srcA + i]);
957 int lenSrcA = srcSize - srcA;
958 int lenSrcB = numElements - lenSrcA;
965 int dstLen = dstSize - dst;
967 if (dstLen >= lenSrcA) {
970 for (
int i = 0; i < lenSrcA; ++i) {
971 new (&dstArray[dst + i]) T(srcArray[srcA + i]);
978 for (
int i = 0; i < dstLen; ++i) {
979 new (&dstArray[dst + i]) T(srcArray[srcA + i]);
991 for (
int i = 0; i < lenSrcA; ++i) {
992 new (&dstArray[i]) T(srcArray[srcA + i]);
1003 if (dstLen >= lenSrcB) {
1006 for (
int i = 0; i < lenSrcB; ++i) {
1007 new (&dstArray[dst + i]) T(srcArray[i]);
1015 for (
int i = 0; i < dstLen; ++i) {
1016 new (&dstArray[dst + i]) T(srcArray[i]);
1023 for (
int i = 0; i < lenSrcB; ++i) {
1024 new (&dstArray[i]) T(srcArray[dstLen + i]);
1029 return dst % dstSize;
1033void Queue<T>::memShiftLeft(T *array,
1041 if (srcIndex > dstIndex) {
1042 int numMove =
size - srcIndex;
1043 if (numMove >= numElements) {
1046 for (
int i = 0; i < numElements; ++i) {
1047 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1048 array[srcIndex + i].~T();
1055 for (
int i = 0; i < numMove; ++i) {
1056 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1057 array[srcIndex + i].~T();
1059 numElements -= numMove;
1060 dstIndex += numMove;
1063 else if (srcIndex == dstIndex) {
1069 int numMove =
size - dstIndex;
1070 if (numMove >= numElements) {
1073 for (
int i = numElements - 1; i >= 0; --i) {
1074 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1075 array[srcIndex + i].~T();
1082 for (
int i = numMove - 1; i >= 0; --i) {
1083 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1084 array[srcIndex + i].~T();
1086 numElements -= numMove;
1087 srcIndex += numMove;
1093 for (
int i = 0; i < numElements; ++i) {
1094 new (&array[i]) T(array[srcIndex + i]);
1095 array[srcIndex + i].~T();
1100void Queue<T>::memShiftRight(T *array,
1106 if (dstIndex == srcIndex) {
1114 int numMove = srcIndex + numElements;
1115 if (numMove > size) {
1119 for (
int i = numMove - 1; i >= 0; --i) {
1120 new (&array[(dstIndex + numElements - numMove) % size + i])
1124 numElements -= numMove;
1131 int numMove = dstIndex + numElements;
1132 if (numMove > size) {
1136 for (
int i = 0; i < numMove; ++i) {
1138 T(array[(srcIndex + numElements - numMove) %
size + i]);
1139 array[srcIndex + numElements - numMove + i].~T();
1141 numElements -= numMove;
1148 if (dstIndex < srcIndex) {
1151 for (
int i = 0; i < numElements; ++i) {
1152 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1153 array[srcIndex + i].~T();
1159 for (
int i = numElements - 1; i >= 0; --i) {
1160 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1161 array[srcIndex + i].~T();
1168void Queue<T>::copyData(T *dstArray,
1177 const int dstIndex = (dstFront + 1) % dstSize;
1178 const int srcIndex = (srcFront + 1) % srcSize;
1179 const int numElements = (srcBack + srcSize - srcFront - 1) % srcSize;
1181 *dstBack = memcpyCircular(dstArray,
1191int Queue<T>::increaseSizeImp(T **addrArray,
1198 T *array = (T *)allocator->
allocate(newSize *
sizeof **addrArray);
1202 const int oldFront = *front;
1203 const int oldBack = *back;
1204 *front = newSize - 1;
1205 copyData(array, back, newSize, *front, *addrArray, size, oldFront, *back);
1209 for (
int i = (oldFront + 1) % size; i != oldBack; i = (i + 1) % size) {
1210 (*addrArray)[i].~T();
1220void Queue<T>::increaseSize()
1222 d_size = increaseSizeImp(&d_array_p,
1225 d_size * k_GROW_FACTOR,
1238#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1246 return maxSupportedBdexVersion();
1261: d_size(k_INITIAL_SIZE)
1262, d_front(k_INITIAL_SIZE - 1)
1264, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1266 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1271: d_back(initialLength)
1272, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1274 d_size = calculateSufficientSize(initialLength, k_INITIAL_SIZE);
1275 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1276 d_front = d_size - 1;
1282 for (
int i = 0; i < d_back; ++i) {
1283 new (d_array_p + i) T();
1289 const T& initialValue,
1291: d_back(initialLength)
1292, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1294 d_size = calculateSufficientSize(initialLength, k_INITIAL_SIZE);
1295 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1296 d_front = d_size - 1;
1301 for (
int i = 0; i < d_back; ++i) {
1302 new (d_array_p + i) T(initialValue);
1309: d_size(numElements.d_i + k_EXTRA_CAPACITY)
1310, d_front(numElements.d_i + k_EXTRA_CAPACITY - 1)
1312, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1314 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1321: d_back(numElements)
1322, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1324 d_size = calculateSufficientSize(numElements, k_INITIAL_SIZE);
1325 d_front = d_size - 1;
1326 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1330 for (
int i = 0; i < numElements; ++i) {
1331 new (&d_array_p[i]) T(srcArray[i]);
1337: d_allocator_p(
bslma::Default::allocator(basicAllocator))
1339 d_size = calculateSufficientSize(original.
length(), k_INITIAL_SIZE);
1340 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1341 d_front = d_size - 1;
1357 for (
int i = (d_front + 1) % d_size; i != d_back; i = (i + 1) % d_size) {
1361 d_allocator_p->deallocate(d_array_p);
1370 calculateSufficientSize(rhs.length(), k_INITIAL_SIZE);
1371 if (newSize > d_size) {
1373 (T *)d_allocator_p->allocate(newSize *
sizeof *d_array_p);
1377 for (
int i = (d_front + 1) % d_size; i != d_back;
1378 i = (i + 1) % d_size) {
1382 d_allocator_p->deallocate(d_array_p);
1389 for (
int i = (d_front + 1) % d_size; i != d_back;
1390 i = (i + 1) % d_size) {
1410 return d_array_p[(index + d_front + 1) % d_size];
1416 const int numElements = srcQueue.
length();
1417 const int newLength = length() + numElements;
1418 const int minSize = calculateSufficientSize(newLength, d_size);
1419 if (d_size < minSize) {
1420 d_size = increaseSizeImp(&d_array_p,
1427 d_back = memcpyCircular(d_array_p,
1432 (srcQueue.d_front + 1) % srcQueue.d_size,
1441 const int newLength = length() + numElements;
1442 const int minSize = calculateSufficientSize(newLength, d_size);
1443 if (d_size < minSize) {
1444 d_size = increaseSizeImp(&d_array_p,
1451 d_back = memcpyCircular(d_array_p,
1456 (srcQueue.d_front + 1 + srcIndex) %
1465 return d_array_p[(d_back - 1 + d_size) % d_size];
1472 return d_array_p[(d_front + 1) % d_size];
1483 const int originalLength = length();
1484 const int newLength = originalLength + 1;
1485 const int newSize = calculateSufficientSize(newLength, d_size);
1487 if (d_size < newSize) {
1490 T *array = (T *)d_allocator_p->allocate(newSize *
sizeof *d_array_p);
1494 const int start = d_front + 1;
1498 memcpyCircular(array,
1505 memcpyCircular(array,
1507 (start + dstIndex + 1) % newSize,
1510 (start + dstIndex) % d_size,
1511 originalLength - dstIndex);
1515 for (
int i = (d_front + 1) % d_size; i != d_back;
1516 i = (i + 1) % d_size) {
1520 d_allocator_p->deallocate(d_array_p);
1524 d_back = (start + newLength) % d_size;
1525 new (&d_array_p[(start + dstIndex) % d_size]) T(itemCopy);
1534 const int backLen = originalLength - dstIndex;
1536 if (dstIndex < backLen) {
1540 const int src = (d_front + 1) % d_size;
1541 const int dst = d_front;
1543 memShiftLeft(d_array_p, d_size, dst, src, dstIndex);
1544 new (&d_array_p[(d_front + dstIndex) % d_size]) T(itemCopy);
1545 d_front = (d_front - 1 + d_size) % d_size;
1551 const int src = (d_front + 1 + dstIndex) % d_size;
1552 const int dst = (src + 1) % d_size;
1554 memShiftRight(d_array_p,
1559 new (&d_array_p[(d_front + 1 + dstIndex) % d_size]) T(itemCopy);
1560 d_back = (d_back + 1) % d_size;
1567 const Queue& srcQueue,
1574 const int originalLength = length();
1575 const int newLength = originalLength + numElements;
1576 const int newSize = calculateSufficientSize(newLength, d_size);
1578 if (d_size < newSize) {
1581 T *array = (T *)d_allocator_p->allocate(newSize *
sizeof *d_array_p);
1585 const int start = d_front + 1;
1586 const int startIndex = start + dstIndex;
1590 memcpyCircular(array,
1597 memcpyCircular(array,
1599 (startIndex + numElements) % newSize,
1602 (startIndex) % d_size,
1603 originalLength - dstIndex);
1604 memcpyCircular(array,
1606 startIndex % newSize,
1609 (srcQueue.d_front + 1 + srcIndex) % srcQueue.d_size,
1614 for (
int i = (d_front + 1) % d_size; i != d_back;
1615 i = (i + 1) % d_size) {
1619 d_allocator_p->deallocate(d_array_p);
1622 d_back = (start + newLength) % d_size;
1631 const int backLen = originalLength - dstIndex;
1632 if (dstIndex < backLen) {
1636 const int d = (d_front + 1 - numElements + d_size) % d_size;
1637 memShiftLeft(d_array_p,
1640 (d_front + 1) % d_size,
1643 if (
this != &srcQueue || srcIndex >= dstIndex) {
1644 memcpyCircular(d_array_p,
1646 (d + dstIndex) % d_size,
1649 (srcQueue.d_front + 1 + srcIndex) %
1654 const int distance = dstIndex - srcIndex;
1655 if (distance >= numElements) {
1656 memcpyCircular(d_array_p,
1658 (d + dstIndex) % d_size,
1661 (d + srcIndex) % d_size,
1665 memcpyCircular(d_array_p,
1667 (d + dstIndex) % d_size,
1670 (d + srcIndex) % d_size,
1672 memcpyCircular(d_array_p,
1674 (d + dstIndex + distance) % d_size,
1677 (d_front + 1 + dstIndex) % d_size,
1678 numElements - distance);
1681 d_front = (d_front - numElements + d_size) % d_size;
1690 const int s = (d_front + 1 + dstIndex) % d_size;
1691 memShiftRight(d_array_p,
1693 (s + numElements) % d_size,
1697 if (
this != &srcQueue ||
1698 srcIndex + numElements <= dstIndex) {
1699 memcpyCircular(d_array_p,
1704 (srcQueue.d_front + 1 + srcIndex) %
1709 if (dstIndex <= srcIndex) {
1710 memcpyCircular(d_array_p,
1715 (d_front + 1 + srcIndex + numElements) %
1720 const int distance = dstIndex - srcIndex;
1721 memcpyCircular(d_array_p,
1726 (d_front + 1 + srcIndex) % d_size,
1728 memcpyCircular(d_array_p,
1730 (s + distance) % d_size,
1733 (d_front + 1 + srcIndex + distance +
1734 numElements) % d_size,
1735 numElements - distance);
1738 d_back = (d_back + numElements) % d_size;
1747 insert(dstIndex, srcQueue, 0, srcQueue.
length());
1754 d_back = (d_back - 1 + d_size) % d_size;
1755 d_array_p[d_back].~T();
1762 d_front = (d_front + 1) % d_size;
1763 d_array_p[d_front].~T();
1771 int newBack = (d_back + 1) % d_size;
1772 if (d_front == newBack) {
1774 newBack = (d_back + 1) % d_size;
1776 new (&d_array_p[d_back]) T(itemCopy);
1785 int newFront = (d_front - 1 + d_size) % d_size;
1786 if (newFront == d_back) {
1788 newFront = (d_front - 1 + d_size) % d_size;
1790 new (&d_array_p[d_front]) T(itemCopy);
1804 d_array_p[(index + d_front + 1) % d_size].~T();
1810 (d_back - d_front - k_EXTRA_CAPACITY - index + d_size) % d_size;
1812 if (index < backLen) {
1813 d_front = (d_front + 1) % d_size;
1814 memShiftRight(d_array_p,
1816 (d_front + 1) % d_size,
1821 const int d = (d_front + 1 + index) % d_size;
1822 memShiftLeft(d_array_p,
1826 (d_back + d_size - d_front - 1) % d_size - 1 - index);
1827 d_back = (d_back - 1 + d_size) % d_size;
1836 for (
int i = 0; i < numElements; ++i) {
1837 d_array_p[(index + d_front + 1 + i) % d_size].~T();
1843 const int backLen = (d_back - d_front - 1
1844 - index - numElements + d_size) % d_size;
1845 if (index < backLen) {
1846 const int dst = (d_front + 1 + numElements) % d_size;
1847 const int src = (d_front + 1) % d_size;
1849 memShiftRight(d_array_p, d_size, dst, src, index);
1850 d_front = (d_front + numElements) % d_size;
1853 const int dst = (d_front + 1 + index) % d_size;
1854 const int src = (dst + numElements) % d_size;
1856 memShiftLeft(d_array_p,
1860 (d_back + d_size - d_front - 1) % d_size -
1861 numElements - index);
1862 d_back = (d_back - numElements + d_size) % d_size;
1869 d_front = (d_front + 1) % d_size;
1874 while (d_back != d_front) {
1876 d_array_p[d_front].~T();
1877 d_front = (d_front + 1) % d_size;
1880 while (d_back != d_front) {
1881 d_array_p[d_front].~T();
1882 d_front = (d_front + 1) % d_size;
1885 d_front = (d_back - 1 + d_size) % d_size;
1895 d_array_p[(d_front + 1 + dstIndex) % d_size].~T();
1896 new (&d_array_p[(d_front + 1 + dstIndex) % d_size]) T(itemCopy);
1901 const Queue& srcQueue,
1907 if (
this != &srcQueue || srcIndex + numElements <= dstIndex ||
1908 dstIndex + numElements <= srcIndex) {
1909 memcpyCircular(d_array_p,
1911 (d_front + 1 + dstIndex) % d_size,
1914 (srcQueue.d_front + 1 + srcIndex) % srcQueue.d_size,
1918 if (srcIndex < dstIndex) {
1919 memShiftRight(d_array_p,
1921 (d_front + 1 + dstIndex) % d_size,
1922 (d_front + 1 + srcIndex) % d_size,
1925 else if (srcIndex > dstIndex) {
1926 memShiftLeft(d_array_p,
1928 (d_front + 1 + dstIndex) % d_size,
1929 (d_front + 1 + srcIndex) % d_size,
1938 const int newSize = calculateSufficientSize(numElements, d_size);
1939 if (d_size < newSize) {
1940 d_size = increaseSizeImp(&d_array_p,
1950 if (0 == length()) {
1951 d_front = d_size - 1;
1960 const int newSize = numElements + k_EXTRA_CAPACITY;
1963 if (d_size < newSize) {
1964 d_size = increaseSizeImp(&d_array_p,
1976 const int newSize = newLength + k_EXTRA_CAPACITY;
1979 if (d_size < newSize) {
1980 d_size = increaseSizeImp(&d_array_p,
1987 const int oldBack = d_back;
1988 const int oldLength = length();
1989 d_back = (d_front + 1 + newLength) % d_size;
1990 if (newLength > oldLength) {
1991 if (oldBack < d_back) {
1994 for (
int i = 0; i < d_back - oldBack; ++i) {
1995 new (d_array_p + oldBack + i) T();
2001 for (
int i = 0; i < d_size - oldBack; ++i) {
2002 new (d_array_p + oldBack + i) T();
2007 for (
int i = 0; i < d_back; ++i) {
2008 new (d_array_p + i) T();
2017 const int newSize = newLength + k_EXTRA_CAPACITY;
2020 if (d_size < newSize) {
2021 d_size = increaseSizeImp(&d_array_p,
2028 const int oldBack = d_back;
2029 const int oldLength = length();
2030 d_back = (d_front + 1 + newLength) % d_size;
2031 if (newLength > oldLength) {
2032 if (oldBack < d_back) {
2035 for (
int i = 0; i < d_back - oldBack; ++i) {
2036 new (d_array_p + oldBack + i) T(initialValue);
2042 for (
int i = 0; i < d_size - oldBack; ++i) {
2043 new (d_array_p + oldBack + i) T(initialValue);
2047 for (
int i = 0; i < d_back; ++i) {
2048 new (d_array_p + i) T(initialValue);
2057 const int newSize = newLength + k_EXTRA_CAPACITY;
2060 if (d_size < newSize) {
2061 d_size = increaseSizeImp(&d_array_p,
2068 d_back = (d_front + 1 + newLength) % d_size;
2072template <
class STREAM>
2079 stream.getLength(newLength);
2082 int newSize = calculateSufficientSize(newLength, d_size);
2083 if (d_size < newSize) {
2084 d_size = increaseSizeImp(&d_array_p,
2091 d_front = d_size - 1;
2093 for (
int i = 0; i < newLength && stream; ++i) {
2095 stream, (*
this)[i], version);
2100 stream.invalidate();
2110 if (index1 != index2) {
2111 const int tmp = d_front + 1;
2112 const int i1 = (tmp + index1) % d_size;
2113 const int i2 = (tmp + index2) % d_size;
2115 T temp(d_array_p[i1]);
2117 new (d_array_p + i1) T(d_array_p[i2]);
2119 new (d_array_p + i2) T(temp);
2128 return d_array_p[(index + d_front + 1) % d_size];
2135 return d_array_p[(d_back - 1 + d_size) % d_size];
2142 return d_array_p[(d_front + 1) % d_size];
2148 int spacesPerLevel)
const
2157 int levelPlus1 = level + 1;
2158 if (0 <= spacesPerLevel) {
2162 const int len = length();
2163 for (
int i = 0; i < len; ++i) {
2165 stream << d_array_p[(i + d_front + 1) % d_size] <<
'\n';
2174 const int len = length();
2175 for (
int i = 0; i < len; ++i) {
2177 stream << d_array_p[(i + d_front + 1) % d_size];
2182 return stream << bsl::flush;
2186template <
class STREAM>
2192 const int len = length();
2193 stream.putLength(len);
2194 for (
int i = 0; i < len && stream; ++i) {
2196 stream, (*
this)[i], version);
2200 stream.invalidate();
2213 const int len = lhs.length();
2214 if (rhs.length() != len) {
2220 for (
int i = 0; i < len; ++i) {
2221 if (!(lhs[i] == rhs[i])) {
2239 return queue.streamOut(stream);
Definition bdlc_queue.h:274
Queue(int initialLength, const T &initialValue, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1288
BSLMF_NESTED_TRAIT_DECLARATION(Queue, bdlb::HasPrintMethod)
void append(const Queue &srcQueue)
Definition bdlc_queue.h:1414
void insert(int dstIndex, const Queue &srcQueue, int srcIndex, int numElements)
Definition bdlc_queue.h:1566
Queue(bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1260
const T & operator[](int index) const
Definition bdlc_queue.h:2126
static int maxSupportedVersion()
Definition bdlc_queue.h:1244
Queue(const InitialCapacity &numElements, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1307
void setLength(int newLength)
Definition bdlc_queue.h:1974
const T & front() const
Definition bdlc_queue.h:2140
Queue(unsigned int initialLength, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1270
void popFront()
Definition bdlc_queue.h:1760
void append(const Queue &srcQueue, int srcIndex, int numElements)
Definition bdlc_queue.h:1437
void replace(int dstIndex, const T &item)
Definition bdlc_queue.h:1889
void swap(int index1, int index2)
Definition bdlc_queue.h:2108
bsl::ostream & print(bsl::ostream &stream, int level, int spacesPerLevel) const
Definition bdlc_queue.h:2146
void setLengthRaw(int newLength)
Definition bdlc_queue.h:2055
static int maxSupportedBdexVersion()
Definition bdlc_queue.h:1251
void remove(int index)
Definition bdlc_queue.h:1802
static int maxSupportedBdexVersion(int versionSelector)
Definition bdlc_queue.h:1233
T & operator[](int index)
Definition bdlc_queue.h:1408
void pushBack(const T &item)
Definition bdlc_queue.h:1767
BSLMF_NESTED_TRAIT_DECLARATION(Queue, bslma::UsesBslmaAllocator)
Queue(const Queue &original, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1336
Queue & operator=(const Queue &rhs)
Definition bdlc_queue.h:1366
bsl::ostream & streamOut(bsl::ostream &stream) const
Definition bdlc_queue.h:807
void remove(int index, int numElements)
Definition bdlc_queue.h:1832
void popBack()
Definition bdlc_queue.h:1752
T & front()
Definition bdlc_queue.h:1470
~Queue()
Destroy this object.
Definition bdlc_queue.h:1353
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlc_queue.h:2073
void setLength(int newLength, const T &initialValue)
Definition bdlc_queue.h:2015
void insert(int dstIndex, const T &item)
Definition bdlc_queue.h:1476
void reserveCapacity(int numElements)
Definition bdlc_queue.h:1936
void replace(int dstIndex, const Queue &srcQueue, int srcIndex, int numElements)
Definition bdlc_queue.h:1900
Queue(const T *srcArray, int numElements, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1318
int length() const
Return the number of elements in this queue.
Definition bdlc_queue.h:882
void reserveCapacityRaw(int numElements)
Definition bdlc_queue.h:1958
void pushFront(const T &item)
Definition bdlc_queue.h:1781
const T & back() const
Definition bdlc_queue.h:2133
void append(const T &item)
Definition bdlc_queue.h:1796
void removeAll(bsl::vector< T > *buffer=0)
Definition bdlc_queue.h:1867
T & back()
Definition bdlc_queue.h:1463
void insert(int dstIndex, const Queue &srcQueue)
Definition bdlc_queue.h:1745
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlc_queue.h:2187
Definition bslstl_vector.h:1120
void push_back(const VALUE_TYPE &value)
Definition bslstl_vector.h:4343
Definition bslma_allocator.h:545
virtual void deallocate(void *address)=0
virtual void * allocate(size_type size)=0
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
bsl::size_t size(const TYPE &array)
Return the number of elements in the specified array.
Definition bdlc_bitarray.h:506
bool operator==(const BitArray &lhs, const BitArray &rhs)
bool operator!=(const BitArray &lhs, const BitArray &rhs)
BitArray operator<<(const BitArray &array, bsl::size_t numBits)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
ALLOCATOR & lhs
Definition bslstl_string.h:3917
Definition baljsn_encoder_testtypes.h:76
STREAM & bdexStreamIn(STREAM &stream, VALUE_TYPE &variable)
Definition bslx_instreamfunctions.h:1263
STREAM & bdexStreamOut(STREAM &stream, const TYPE &value)
Definition bslx_outstreamfunctions.h:1004
Definition bdlb_printmethods.h:306
static bsl::ostream & indent(bsl::ostream &stream, int level, int spacesPerLevel=4)
Definition bdlc_queue.h:298
InitialCapacity(unsigned int i)
Definition bdlc_queue.h:303
unsigned int d_i
Definition bdlc_queue.h:300
~InitialCapacity()
Definition bdlc_queue.h:304
Definition bslma_usesbslmaallocator.h:344