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
329 int calculateSufficientSize(
int minLength,
int size);
344 int memcpyCircular(T *dstArray,
361 void memShiftLeft(T *array,
376 void memShiftRight(T *array,
392 void copyData(T *dstArray,
410 int increaseSizeImp(T **addrArray,
454 const T& initialValue,
467 Queue(
const InitialCapacity& numElements,
528 void append(
const Queue& srcQueue,
int srcIndex,
int numElements);
554 void insert(
int dstIndex,
const T& item);
570 const Queue& srcQueue,
649 const Queue& srcQueue,
694 template <
class STREAM>
700 void swap(
int index1,
int index2);
745 bsl::ostream&
print(bsl::ostream& stream,
747 int spacesPerLevel)
const;
755 for (
int i = 0; i <
length(); ++i) {
756 stream <<
' ' << (*this)[i];
758 return stream <<
" ]";
769 template <
class STREAM>
772#ifndef BDE_OMIT_INTERNAL_DEPRECATED
828 return d_back > d_front ? d_back - d_front - 1
829 : d_back + d_size - d_front - 1;
836 const int len = minLength + k_EXTRA_CAPACITY;
838 size *= k_GROW_FACTOR;
844int Queue<T>::memcpyCircular(T *dstArray,
857 if (srcA + numElements <= srcSize) {
858 int lenSrcA = numElements;
865 int dstLen = dstSize - dst;
867 if (dstLen >= lenSrcA) {
870 for (
int i = 0; i < lenSrcA; ++i) {
871 new (&dstArray[dst + i]) T(srcArray[srcA + i]);
878 for (
int i = 0; i < dstLen; ++i) {
879 new (&dstArray[dst + i]) T(srcArray[srcA + i]);
891 for (
int i = 0; i < lenSrcA; ++i) {
892 new (&dstArray[i]) T(srcArray[srcA + i]);
901 int lenSrcA = srcSize - srcA;
902 int lenSrcB = numElements - lenSrcA;
909 int dstLen = dstSize - dst;
911 if (dstLen >= lenSrcA) {
914 for (
int i = 0; i < lenSrcA; ++i) {
915 new (&dstArray[dst + i]) T(srcArray[srcA + i]);
922 for (
int i = 0; i < dstLen; ++i) {
923 new (&dstArray[dst + i]) T(srcArray[srcA + i]);
935 for (
int i = 0; i < lenSrcA; ++i) {
936 new (&dstArray[i]) T(srcArray[srcA + i]);
947 if (dstLen >= lenSrcB) {
950 for (
int i = 0; i < lenSrcB; ++i) {
951 new (&dstArray[dst + i]) T(srcArray[i]);
959 for (
int i = 0; i < dstLen; ++i) {
960 new (&dstArray[dst + i]) T(srcArray[i]);
967 for (
int i = 0; i < lenSrcB; ++i) {
968 new (&dstArray[i]) T(srcArray[dstLen + i]);
973 return dst % dstSize;
977void Queue<T>::memShiftLeft(T *array,
985 if (srcIndex > dstIndex) {
986 int numMove =
size - srcIndex;
987 if (numMove >= numElements) {
990 for (
int i = 0; i < numElements; ++i) {
991 new (&array[dstIndex + i]) T(array[srcIndex + i]);
992 array[srcIndex + i].~T();
999 for (
int i = 0; i < numMove; ++i) {
1000 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1001 array[srcIndex + i].~T();
1003 numElements -= numMove;
1004 dstIndex += numMove;
1007 else if (srcIndex == dstIndex) {
1013 int numMove =
size - dstIndex;
1014 if (numMove >= numElements) {
1017 for (
int i = numElements - 1; i >= 0; --i) {
1018 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1019 array[srcIndex + i].~T();
1026 for (
int i = numMove - 1; i >= 0; --i) {
1027 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1028 array[srcIndex + i].~T();
1030 numElements -= numMove;
1031 srcIndex += numMove;
1037 for (
int i = 0; i < numElements; ++i) {
1038 new (&array[i]) T(array[srcIndex + i]);
1039 array[srcIndex + i].~T();
1044void Queue<T>::memShiftRight(T *array,
1050 if (dstIndex == srcIndex) {
1058 int numMove = srcIndex + numElements;
1059 if (numMove > size) {
1063 for (
int i = numMove - 1; i >= 0; --i) {
1064 new (&array[(dstIndex + numElements - numMove) % size + i])
1068 numElements -= numMove;
1075 int numMove = dstIndex + numElements;
1076 if (numMove > size) {
1080 for (
int i = 0; i < numMove; ++i) {
1082 T(array[(srcIndex + numElements - numMove) %
size + i]);
1083 array[srcIndex + numElements - numMove + i].~T();
1085 numElements -= numMove;
1092 if (dstIndex < srcIndex) {
1095 for (
int i = 0; i < numElements; ++i) {
1096 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1097 array[srcIndex + i].~T();
1103 for (
int i = numElements - 1; i >= 0; --i) {
1104 new (&array[dstIndex + i]) T(array[srcIndex + i]);
1105 array[srcIndex + i].~T();
1112void Queue<T>::copyData(T *dstArray,
1121 const int dstIndex = (dstFront + 1) % dstSize;
1122 const int srcIndex = (srcFront + 1) % srcSize;
1123 const int numElements = (srcBack + srcSize - srcFront - 1) % srcSize;
1125 *dstBack = memcpyCircular(dstArray,
1135int Queue<T>::increaseSizeImp(T **addrArray,
1142 T *array = (T *)allocator->
allocate(newSize *
sizeof **addrArray);
1146 const int oldFront = *front;
1147 const int oldBack = *back;
1148 *front = newSize - 1;
1149 copyData(array, back, newSize, *front, *addrArray, size, oldFront, *back);
1153 for (
int i = (oldFront + 1) % size; i != oldBack; i = (i + 1) % size) {
1154 (*addrArray)[i].~T();
1164void Queue<T>::increaseSize()
1166 d_size = increaseSizeImp(&d_array_p,
1169 d_size * k_GROW_FACTOR,
1182#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1190 return maxSupportedBdexVersion();
1205: d_size(k_INITIAL_SIZE)
1206, d_front(k_INITIAL_SIZE - 1)
1208, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1210 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1215: d_back(initialLength)
1216, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1218 d_size = calculateSufficientSize(initialLength, k_INITIAL_SIZE);
1219 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1220 d_front = d_size - 1;
1226 for (
int i = 0; i < d_back; ++i) {
1227 new (d_array_p + i) T();
1233 const T& initialValue,
1235: d_back(initialLength)
1236, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1238 d_size = calculateSufficientSize(initialLength, k_INITIAL_SIZE);
1239 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1240 d_front = d_size - 1;
1245 for (
int i = 0; i < d_back; ++i) {
1246 new (d_array_p + i) T(initialValue);
1253: d_size(numElements.d_i + k_EXTRA_CAPACITY)
1254, d_front(numElements.d_i + k_EXTRA_CAPACITY - 1)
1256, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1258 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1265: d_back(numElements)
1266, d_allocator_p(
bslma::Default::allocator(basicAllocator))
1268 d_size = calculateSufficientSize(numElements, k_INITIAL_SIZE);
1269 d_front = d_size - 1;
1270 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1274 for (
int i = 0; i < numElements; ++i) {
1275 new (&d_array_p[i]) T(srcArray[i]);
1281: d_allocator_p(
bslma::Default::allocator(basicAllocator))
1283 d_size = calculateSufficientSize(original.
length(), k_INITIAL_SIZE);
1284 d_array_p = (T *)d_allocator_p->
allocate(d_size *
sizeof *d_array_p);
1285 d_front = d_size - 1;
1301 for (
int i = (d_front + 1) % d_size; i != d_back; i = (i + 1) % d_size) {
1305 d_allocator_p->deallocate(d_array_p);
1314 calculateSufficientSize(rhs.
length(), k_INITIAL_SIZE);
1315 if (newSize > d_size) {
1317 (T *)d_allocator_p->allocate(newSize *
sizeof *d_array_p);
1321 for (
int i = (d_front + 1) % d_size; i != d_back;
1322 i = (i + 1) % d_size) {
1326 d_allocator_p->deallocate(d_array_p);
1333 for (
int i = (d_front + 1) % d_size; i != d_back;
1334 i = (i + 1) % d_size) {
1354 return d_array_p[(index + d_front + 1) % d_size];
1360 const int numElements = srcQueue.
length();
1361 const int newLength = length() + numElements;
1362 const int minSize = calculateSufficientSize(newLength, d_size);
1363 if (d_size < minSize) {
1364 d_size = increaseSizeImp(&d_array_p,
1371 d_back = memcpyCircular(d_array_p,
1376 (srcQueue.d_front + 1) % srcQueue.d_size,
1385 const int newLength = length() + numElements;
1386 const int minSize = calculateSufficientSize(newLength, d_size);
1387 if (d_size < minSize) {
1388 d_size = increaseSizeImp(&d_array_p,
1395 d_back = memcpyCircular(d_array_p,
1400 (srcQueue.d_front + 1 + srcIndex) %
1409 return d_array_p[(d_back - 1 + d_size) % d_size];
1416 return d_array_p[(d_front + 1) % d_size];
1427 const int originalLength = length();
1428 const int newLength = originalLength + 1;
1429 const int newSize = calculateSufficientSize(newLength, d_size);
1431 if (d_size < newSize) {
1434 T *array = (T *)d_allocator_p->allocate(newSize *
sizeof *d_array_p);
1438 const int start = d_front + 1;
1442 memcpyCircular(array,
1449 memcpyCircular(array,
1451 (start + dstIndex + 1) % newSize,
1454 (start + dstIndex) % d_size,
1455 originalLength - dstIndex);
1459 for (
int i = (d_front + 1) % d_size; i != d_back;
1460 i = (i + 1) % d_size) {
1464 d_allocator_p->deallocate(d_array_p);
1468 d_back = (start + newLength) % d_size;
1469 new (&d_array_p[(start + dstIndex) % d_size]) T(itemCopy);
1478 const int backLen = originalLength - dstIndex;
1480 if (dstIndex < backLen) {
1484 const int src = (d_front + 1) % d_size;
1485 const int dst = d_front;
1487 memShiftLeft(d_array_p, d_size, dst, src, dstIndex);
1488 new (&d_array_p[(d_front + dstIndex) % d_size]) T(itemCopy);
1489 d_front = (d_front - 1 + d_size) % d_size;
1495 const int src = (d_front + 1 + dstIndex) % d_size;
1496 const int dst = (src + 1) % d_size;
1498 memShiftRight(d_array_p,
1503 new (&d_array_p[(d_front + 1 + dstIndex) % d_size]) T(itemCopy);
1504 d_back = (d_back + 1) % d_size;
1511 const Queue& srcQueue,
1518 const int originalLength = length();
1519 const int newLength = originalLength + numElements;
1520 const int newSize = calculateSufficientSize(newLength, d_size);
1522 if (d_size < newSize) {
1525 T *array = (T *)d_allocator_p->allocate(newSize *
sizeof *d_array_p);
1529 const int start = d_front + 1;
1530 const int startIndex = start + dstIndex;
1534 memcpyCircular(array,
1541 memcpyCircular(array,
1543 (startIndex + numElements) % newSize,
1546 (startIndex) % d_size,
1547 originalLength - dstIndex);
1548 memcpyCircular(array,
1550 startIndex % newSize,
1553 (srcQueue.d_front + 1 + srcIndex) % srcQueue.d_size,
1558 for (
int i = (d_front + 1) % d_size; i != d_back;
1559 i = (i + 1) % d_size) {
1563 d_allocator_p->deallocate(d_array_p);
1566 d_back = (start + newLength) % d_size;
1575 const int backLen = originalLength - dstIndex;
1576 if (dstIndex < backLen) {
1580 const int d = (d_front + 1 - numElements + d_size) % d_size;
1581 memShiftLeft(d_array_p,
1584 (d_front + 1) % d_size,
1587 if (
this != &srcQueue || srcIndex >= dstIndex) {
1588 memcpyCircular(d_array_p,
1590 (d + dstIndex) % d_size,
1593 (srcQueue.d_front + 1 + srcIndex) %
1598 const int distance = dstIndex - srcIndex;
1599 if (distance >= numElements) {
1600 memcpyCircular(d_array_p,
1602 (d + dstIndex) % d_size,
1605 (d + srcIndex) % d_size,
1609 memcpyCircular(d_array_p,
1611 (d + dstIndex) % d_size,
1614 (d + srcIndex) % d_size,
1616 memcpyCircular(d_array_p,
1618 (d + dstIndex + distance) % d_size,
1621 (d_front + 1 + dstIndex) % d_size,
1622 numElements - distance);
1625 d_front = (d_front - numElements + d_size) % d_size;
1634 const int s = (d_front + 1 + dstIndex) % d_size;
1635 memShiftRight(d_array_p,
1637 (s + numElements) % d_size,
1641 if (
this != &srcQueue ||
1642 srcIndex + numElements <= dstIndex) {
1643 memcpyCircular(d_array_p,
1648 (srcQueue.d_front + 1 + srcIndex) %
1653 if (dstIndex <= srcIndex) {
1654 memcpyCircular(d_array_p,
1659 (d_front + 1 + srcIndex + numElements) %
1664 const int distance = dstIndex - srcIndex;
1665 memcpyCircular(d_array_p,
1670 (d_front + 1 + srcIndex) % d_size,
1672 memcpyCircular(d_array_p,
1674 (s + distance) % d_size,
1677 (d_front + 1 + srcIndex + distance +
1678 numElements) % d_size,
1679 numElements - distance);
1682 d_back = (d_back + numElements) % d_size;
1691 insert(dstIndex, srcQueue, 0, srcQueue.
length());
1698 d_back = (d_back - 1 + d_size) % d_size;
1699 d_array_p[d_back].~T();
1706 d_front = (d_front + 1) % d_size;
1707 d_array_p[d_front].~T();
1715 int newBack = (d_back + 1) % d_size;
1716 if (d_front == newBack) {
1718 newBack = (d_back + 1) % d_size;
1720 new (&d_array_p[d_back]) T(itemCopy);
1729 int newFront = (d_front - 1 + d_size) % d_size;
1730 if (newFront == d_back) {
1732 newFront = (d_front - 1 + d_size) % d_size;
1734 new (&d_array_p[d_front]) T(itemCopy);
1748 d_array_p[(index + d_front + 1) % d_size].~T();
1754 (d_back - d_front - k_EXTRA_CAPACITY - index + d_size) % d_size;
1756 if (index < backLen) {
1757 d_front = (d_front + 1) % d_size;
1758 memShiftRight(d_array_p,
1760 (d_front + 1) % d_size,
1765 const int d = (d_front + 1 + index) % d_size;
1766 memShiftLeft(d_array_p,
1770 (d_back + d_size - d_front - 1) % d_size - 1 - index);
1771 d_back = (d_back - 1 + d_size) % d_size;
1780 for (
int i = 0; i < numElements; ++i) {
1781 d_array_p[(index + d_front + 1 + i) % d_size].~T();
1787 const int backLen = (d_back - d_front - 1
1788 - index - numElements + d_size) % d_size;
1789 if (index < backLen) {
1790 const int dst = (d_front + 1 + numElements) % d_size;
1791 const int src = (d_front + 1) % d_size;
1793 memShiftRight(d_array_p, d_size, dst, src, index);
1794 d_front = (d_front + numElements) % d_size;
1797 const int dst = (d_front + 1 + index) % d_size;
1798 const int src = (dst + numElements) % d_size;
1800 memShiftLeft(d_array_p,
1804 (d_back + d_size - d_front - 1) % d_size -
1805 numElements - index);
1806 d_back = (d_back - numElements + d_size) % d_size;
1813 d_front = (d_front + 1) % d_size;
1818 while (d_back != d_front) {
1820 d_array_p[d_front].~T();
1821 d_front = (d_front + 1) % d_size;
1824 while (d_back != d_front) {
1825 d_array_p[d_front].~T();
1826 d_front = (d_front + 1) % d_size;
1829 d_front = (d_back - 1 + d_size) % d_size;
1839 d_array_p[(d_front + 1 + dstIndex) % d_size].~T();
1840 new (&d_array_p[(d_front + 1 + dstIndex) % d_size]) T(itemCopy);
1845 const Queue& srcQueue,
1851 if (
this != &srcQueue || srcIndex + numElements <= dstIndex ||
1852 dstIndex + numElements <= srcIndex) {
1853 memcpyCircular(d_array_p,
1855 (d_front + 1 + dstIndex) % d_size,
1858 (srcQueue.d_front + 1 + srcIndex) % srcQueue.d_size,
1862 if (srcIndex < dstIndex) {
1863 memShiftRight(d_array_p,
1865 (d_front + 1 + dstIndex) % d_size,
1866 (d_front + 1 + srcIndex) % d_size,
1869 else if (srcIndex > dstIndex) {
1870 memShiftLeft(d_array_p,
1872 (d_front + 1 + dstIndex) % d_size,
1873 (d_front + 1 + srcIndex) % d_size,
1882 const int newSize = calculateSufficientSize(numElements, d_size);
1883 if (d_size < newSize) {
1884 d_size = increaseSizeImp(&d_array_p,
1894 if (0 == length()) {
1895 d_front = d_size - 1;
1904 const int newSize = numElements + k_EXTRA_CAPACITY;
1907 if (d_size < newSize) {
1908 d_size = increaseSizeImp(&d_array_p,
1920 const int newSize = newLength + k_EXTRA_CAPACITY;
1923 if (d_size < newSize) {
1924 d_size = increaseSizeImp(&d_array_p,
1931 const int oldBack = d_back;
1932 const int oldLength = length();
1933 d_back = (d_front + 1 + newLength) % d_size;
1934 if (newLength > oldLength) {
1935 if (oldBack < d_back) {
1938 for (
int i = 0; i < d_back - oldBack; ++i) {
1939 new (d_array_p + oldBack + i) T();
1945 for (
int i = 0; i < d_size - oldBack; ++i) {
1946 new (d_array_p + oldBack + i) T();
1951 for (
int i = 0; i < d_back; ++i) {
1952 new (d_array_p + i) T();
1961 const int newSize = newLength + k_EXTRA_CAPACITY;
1964 if (d_size < newSize) {
1965 d_size = increaseSizeImp(&d_array_p,
1972 const int oldBack = d_back;
1973 const int oldLength = length();
1974 d_back = (d_front + 1 + newLength) % d_size;
1975 if (newLength > oldLength) {
1976 if (oldBack < d_back) {
1979 for (
int i = 0; i < d_back - oldBack; ++i) {
1980 new (d_array_p + oldBack + i) T(initialValue);
1986 for (
int i = 0; i < d_size - oldBack; ++i) {
1987 new (d_array_p + oldBack + i) T(initialValue);
1991 for (
int i = 0; i < d_back; ++i) {
1992 new (d_array_p + i) T(initialValue);
2001 const int newSize = newLength + k_EXTRA_CAPACITY;
2004 if (d_size < newSize) {
2005 d_size = increaseSizeImp(&d_array_p,
2012 d_back = (d_front + 1 + newLength) % d_size;
2016template <
class STREAM>
2023 stream.getLength(newLength);
2026 int newSize = calculateSufficientSize(newLength, d_size);
2027 if (d_size < newSize) {
2028 d_size = increaseSizeImp(&d_array_p,
2035 d_front = d_size - 1;
2037 for (
int i = 0; i < newLength && stream; ++i) {
2039 stream, (*
this)[i], version);
2044 stream.invalidate();
2054 if (index1 != index2) {
2055 const int tmp = d_front + 1;
2056 const int i1 = (tmp + index1) % d_size;
2057 const int i2 = (tmp + index2) % d_size;
2059 T temp(d_array_p[i1]);
2061 new (d_array_p + i1) T(d_array_p[i2]);
2063 new (d_array_p + i2) T(temp);
2072 return d_array_p[(index + d_front + 1) % d_size];
2079 return d_array_p[(d_back - 1 + d_size) % d_size];
2086 return d_array_p[(d_front + 1) % d_size];
2092 int spacesPerLevel)
const
2101 int levelPlus1 = level + 1;
2102 if (0 <= spacesPerLevel) {
2106 const int len = length();
2107 for (
int i = 0; i < len; ++i) {
2109 stream << d_array_p[(i + d_front + 1) % d_size] <<
'\n';
2118 const int len = length();
2119 for (
int i = 0; i < len; ++i) {
2121 stream << d_array_p[(i + d_front + 1) % d_size];
2126 return stream << bsl::flush;
2130template <
class STREAM>
2136 const int len = length();
2137 stream.putLength(len);
2138 for (
int i = 0; i < len && stream; ++i) {
2140 stream, (*
this)[i], version);
2144 stream.invalidate();
2157 const int len = lhs.length();
2158 if (rhs.length() != len) {
2164 for (
int i = 0; i < len; ++i) {
2165 if (!(lhs[i] == rhs[i])) {
2176 return !(lhs == rhs);
2183 return queue.streamOut(stream);
Definition bdlc_queue.h:273
Queue(int initialLength, const T &initialValue, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1232
BSLMF_NESTED_TRAIT_DECLARATION(Queue, bdlb::HasPrintMethod)
void append(const Queue &srcQueue)
Definition bdlc_queue.h:1358
void insert(int dstIndex, const Queue &srcQueue, int srcIndex, int numElements)
Definition bdlc_queue.h:1510
Queue(bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1204
const T & operator[](int index) const
Definition bdlc_queue.h:2070
static int maxSupportedVersion()
Definition bdlc_queue.h:1188
Queue(const InitialCapacity &numElements, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1251
void setLength(int newLength)
Definition bdlc_queue.h:1918
const T & front() const
Definition bdlc_queue.h:2084
Queue(unsigned int initialLength, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1214
void popFront()
Definition bdlc_queue.h:1704
void append(const Queue &srcQueue, int srcIndex, int numElements)
Definition bdlc_queue.h:1381
void replace(int dstIndex, const T &item)
Definition bdlc_queue.h:1833
void swap(int index1, int index2)
Definition bdlc_queue.h:2052
bsl::ostream & print(bsl::ostream &stream, int level, int spacesPerLevel) const
Definition bdlc_queue.h:2090
void setLengthRaw(int newLength)
Definition bdlc_queue.h:1999
static int maxSupportedBdexVersion()
Definition bdlc_queue.h:1195
void remove(int index)
Definition bdlc_queue.h:1746
static int maxSupportedBdexVersion(int versionSelector)
Definition bdlc_queue.h:1177
T & operator[](int index)
Definition bdlc_queue.h:1352
void pushBack(const T &item)
Definition bdlc_queue.h:1711
BSLMF_NESTED_TRAIT_DECLARATION(Queue, bslma::UsesBslmaAllocator)
Queue(const Queue &original, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1280
Queue & operator=(const Queue &rhs)
Definition bdlc_queue.h:1310
bsl::ostream & streamOut(bsl::ostream &stream) const
Definition bdlc_queue.h:752
void remove(int index, int numElements)
Definition bdlc_queue.h:1776
void popBack()
Definition bdlc_queue.h:1696
T & front()
Definition bdlc_queue.h:1414
~Queue()
Destroy this object.
Definition bdlc_queue.h:1297
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlc_queue.h:2017
void setLength(int newLength, const T &initialValue)
Definition bdlc_queue.h:1959
void insert(int dstIndex, const T &item)
Definition bdlc_queue.h:1420
void reserveCapacity(int numElements)
Definition bdlc_queue.h:1880
void replace(int dstIndex, const Queue &srcQueue, int srcIndex, int numElements)
Definition bdlc_queue.h:1844
Queue(const T *srcArray, int numElements, bslma::Allocator *basicAllocator=0)
Definition bdlc_queue.h:1262
int length() const
Return the number of elements in this queue.
Definition bdlc_queue.h:826
void reserveCapacityRaw(int numElements)
Definition bdlc_queue.h:1902
void pushFront(const T &item)
Definition bdlc_queue.h:1725
const T & back() const
Definition bdlc_queue.h:2077
void append(const T &item)
Definition bdlc_queue.h:1740
void removeAll(bsl::vector< T > *buffer=0)
Definition bdlc_queue.h:1811
T & back()
Definition bdlc_queue.h:1407
void insert(int dstIndex, const Queue &srcQueue)
Definition bdlc_queue.h:1689
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlc_queue.h:2131
Definition bslstl_vector.h:1025
void push_back(const VALUE_TYPE &value)
Definition bslstl_vector.h:3760
Definition bslma_allocator.h:457
virtual void deallocate(void *address)=0
virtual void * allocate(size_type size)=0
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
bsl::size_t size(const TYPE &array)
Return the number of elements in the specified array.
Definition bdlc_bitarray.h:503
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)
Definition balxml_encoderoptions.h:68
STREAM & bdexStreamIn(STREAM &stream, VALUE_TYPE &variable)
Definition bslx_instreamfunctions.h:1247
STREAM & bdexStreamOut(STREAM &stream, const TYPE &value)
Definition bslx_outstreamfunctions.h:992
Definition bdlb_printmethods.h:306
static bsl::ostream & indent(bsl::ostream &stream, int level, int spacesPerLevel=4)
Definition bdlc_queue.h:295
InitialCapacity(unsigned int i)
Definition bdlc_queue.h:300
unsigned int d_i
Definition bdlc_queue.h:297
~InitialCapacity()
Definition bdlc_queue.h:301
Definition bslma_usesbslmaallocator.h:343