mirror of
https://github.com/boostorg/circular_buffer.git
synced 2026-01-22 05:02:14 +00:00
4233 lines
174 KiB
HTML
4233 lines
174 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||
"http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||
<title>
|
||
Space Optimized Circular Buffer
|
||
</title>
|
||
<link rel="stylesheet" href="../../../boost.css" type="text/css">
|
||
</head>
|
||
<body>
|
||
<h1>
|
||
Space Optimized Circular Buffer
|
||
</h1>
|
||
<table id="title" border="0">
|
||
<tr>
|
||
<td>
|
||
<h1>
|
||
circular_buffer_space_optimized<T, Alloc>
|
||
</h1>
|
||
</td>
|
||
<td>
|
||
<a href="../../../"><img src="../../../boost.png" width="277" height="86" alt="Boost" border="0"></a>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
<h2>
|
||
Contents
|
||
</h2><a href="#description">Description</a><br>
|
||
<a href="#synopsis">Synopsis</a><br>
|
||
<a href="#rationale">Rationale</a><br>
|
||
<a href="#header">Header Files</a><br>
|
||
<a href="#model">Modelled concepts</a><br>
|
||
<a href="#types">Specific Public Types</a><br>
|
||
<a href="#constructors">Constructors and Destructor</a><br>
|
||
<a href="#methods">Specific Public Member Functions</a><br>
|
||
<a href="#see">See also</a><br>
|
||
<a href="#ack">Acknowledgements</a><br>
|
||
<a href="#relnotes">Release Notes</a>
|
||
<h2>
|
||
<a name="description" id="description">Description</a>
|
||
</h2>
|
||
<p>
|
||
The <code>circular_buffer_space_optimized</code> container is an adaptor of the <code><a href=
|
||
"circular_buffer.html">circular_buffer</a></code>. The functionality of the
|
||
<code>circular_buffer_space_optimized</code> is similar to the base <code>circular_buffer</code> except it does
|
||
not allocate memory at once when created rather it allocates memory as needed. (The predictive memory allocation
|
||
is similar to typical <code>std::vector</code> implementation.) Moreover the memory is automatically freed as the
|
||
size of the container decreases.
|
||
</p>
|
||
<table id="figure" border="0">
|
||
<tr>
|
||
<td></td>
|
||
<td>
|
||
<img src="space_optimized.png" width="700" height="350" alt="Space Optimized Circular Buffer" border="0">
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td valign="top">
|
||
<b>Figure:</b>
|
||
</td>
|
||
<td valign="top">
|
||
The memory allocation process of the space optimized circular buffer. The <code>min_capacity()</code> of the
|
||
<a href="#types">capacity controller</a> represents the minimal guaranteed amount of allocated memory. The
|
||
allocated memory will never drop under this value. The default value of the <code>min_capacity()</code> is
|
||
set to <code>0</code>.
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
<h2>
|
||
<a name="synopsis" id="synopsis">Synopsis</a>
|
||
</h2>
|
||
<p>
|
||
Note that some of the links point to the original <code><a href="circular_buffer.html">circular_buffer</a></code>
|
||
if the functionality is the same.
|
||
</p>
|
||
<div id="srcdoc_synopsis">
|
||
<table id="table_synopsis" border="0" cellpadding="10">
|
||
<tr>
|
||
<td>
|
||
<pre>
|
||
namespace boost {
|
||
|
||
template <class <a href="circular_buffer.html#templateparam_T">T</a>, class <a href=
|
||
"circular_buffer.html#templateparam_Alloc">Alloc</a>>
|
||
class circular_buffer_space_optimized
|
||
{
|
||
public:
|
||
typedef typename Alloc::value_type <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1cbdd7ca87e147c08cd2be267eefd6540">value_type</a>;
|
||
typedef typename Alloc::pointer <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_14ff917f8a6131ec18e91606727592a9c">pointer</a>;
|
||
typedef typename Alloc::const_pointer <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_190f7c6bcb624ad507de546366f49028a">const_pointer</a>;
|
||
typedef typename Alloc::reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1f38a9bc64d84757c661c2542ff9a7f65">reference</a>;
|
||
typedef typename Alloc::const_reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>;
|
||
typedef typename Alloc::size_type <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a>;
|
||
typedef typename Alloc::difference_type <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15313e723fa85d73db5826f8b722aa2a9">difference_type</a>;
|
||
typedef Alloc <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>;
|
||
typedef <i>implementation-defined</i> <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15cab6d46f03c40d1e52d41843319ddb9">const_iterator</a>;
|
||
typedef <i>implementation-defined</i> <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>;
|
||
typedef boost::reverse_iterator<const_iterator> <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1c7317701b511bc5f7a663b06b53e2b73">const_reverse_iterator</a>;
|
||
typedef boost::reverse_iterator<iterator> <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1002fb890dded89e75dfeb6f021fb58a5">reverse_iterator</a>;
|
||
typedef std::pair<pointer, size_type> <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_126d279f91fef717e25459a0817ff242f">array_range</a>;
|
||
typedef std::pair<const_pointer, size_type> <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11885d7f475b7e7a74c95b2448d243025">const_array_range</a>;
|
||
typedef <i>implementation-defined</i> <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>;
|
||
|
||
explicit <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1a05f824b31cd93d7695f4039edc7597f">circular_buffer_space_optimized</a>(const allocator_type& alloc = allocator_type());
|
||
explicit <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1741159a0511a4e0fed6eaab6d6959fa7">circular_buffer_space_optimized</a>(capacity_type capacity_ctrl, const allocator_type& alloc = allocator_type());
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1f8c9fa872f9a84d454d7e245cc2eadbd">circular_buffer_space_optimized</a>(capacity_type capacity_ctrl, const_reference item, const allocator_type& alloc = allocator_type());
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1d29ce80b10d4a3250fedeb9427210d96">circular_buffer_space_optimized</a>(capacity_type capacity_ctrl, size_type n, const_reference item, const allocator_type& alloc = allocator_type());
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1d9f273c1a794f84484d220e977a3e24b">circular_buffer_space_optimized</a>(const circular_buffer_space_optimized<T, Alloc>& cb);
|
||
template <class InputIterator>
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_11dd04145492c82a959b1df1167b4e217">circular_buffer_space_optimized</a>(InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type());
|
||
template <class InputIterator>
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_196c63e0ecd56f6f1ac87bc79d2fd5b9f">circular_buffer_space_optimized</a>(capacity_type capacity_ctrl, InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type());
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_16839c3ea656ff0f800e38096748fe8ac">~circular_buffer_space_optimized</a>();
|
||
|
||
allocator_type <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a20b7d0e7a4da0af13286df9f53d660c">get_allocator</a>() const;
|
||
allocator_type& <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1af7758a36ac2f84a3024b50b4fc7e098">get_allocator</a>();
|
||
iterator <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin</a>();
|
||
iterator <a href="circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end</a>();
|
||
const_iterator <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_10640d3d41c13b6089b6f169224cf1038">begin</a>() const;
|
||
const_iterator <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_17890810d07bc595cfb87f9c47cb075ac">end</a>() const;
|
||
reverse_iterator <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1db3d6b10b6763549f54d2627228fa7aa">rbegin</a>();
|
||
reverse_iterator <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1cff9236a50107188b8942847a4dc2697">rend</a>();
|
||
const_reverse_iterator <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1765d91bf48341907418433a1e3aab026">rbegin</a>() const;
|
||
const_reverse_iterator <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_108dbf538b00a14daf5582ece80746fc3">rend</a>() const;
|
||
reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1d219f0d3203fb43b964a8cf63f1865cd">operator[]</a>(size_type index);
|
||
const_reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1eb0a7fe7f8a56a4dc4c933b93adfcef4">operator[]</a>(size_type index) const;
|
||
reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1cd84838cb4fffb6c113fd0297e502edc">at</a>(size_type index);
|
||
const_reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1b233a298f5845a0fcf2ecc56f4170810">at</a>(size_type index) const;
|
||
reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_10d5fdeabeb352f47d1f7bb1ea8d9819f">front</a>();
|
||
reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1d985d974020f88bb4255d8edbae0a30a">back</a>();
|
||
const_reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_10df8595d83bb9d8a7ce50aabc678f90b">front</a>() const;
|
||
const_reference <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1027201797868c6274feb6712f670a132">back</a>() const;
|
||
array_range <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1957cccdcb0c4ef7d80a34a990065818d">array_one</a>();
|
||
array_range <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1f5081a54afbc2dfc1a7fb20329df7d5b">array_two</a>();
|
||
const_array_range <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_10f4b157e27b1170a571417986b239945">array_one</a>() const;
|
||
const_array_range <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1bb8eb0f298ad2012c55c5303e1f174d5">array_two</a>() const;
|
||
pointer <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1ea728bf57f91aa8946eddf76ce816a4e">linearize</a>();
|
||
bool <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_120f64448dc0723cc68c1096f6b00bc0a">is_linearized</a>() const;
|
||
void <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1c591bb9e271b10b5240afcff3bd2c619">rotate</a>(const_iterator new_begin);
|
||
size_type <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size</a>() const;
|
||
size_type <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7">max_size</a>() const;
|
||
bool <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15be1c2a005ec9828549ef6dd7ebed583">empty</a>() const;
|
||
bool <a href="#classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954">full</a>() const;
|
||
size_type <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve</a>() const;
|
||
const capacity_type& <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity</a>() const;
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_149f28bc5b33d2062b9f6a33b48264e3f">set_capacity</a>(const capacity_type& capacity_ctrl);
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1f244ff5576b79f8d60e273c02d71c9f2">resize</a>(size_type new_size, const_reference item = value_type());
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_10f096c108ebde69ae83a9de41b3bea56">rset_capacity</a>(const capacity_type& capacity_ctrl);
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1d45e2e72d9e3fb42e090ebc47ac8d7ee">rresize</a>(size_type new_size, const_reference item = value_type());
|
||
circular_buffer_space_optimized<T, Alloc>& <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a>(const circular_buffer_space_optimized<T, Alloc>& cb);
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1">assign</a>(size_type n, const_reference item);
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf">assign</a>(capacity_type capacity_ctrl, size_type n, const_reference item);
|
||
template <class InputIterator>
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb">assign</a>(InputIterator first, InputIterator last);
|
||
template <class InputIterator>
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1e9347091d2d644854af0821d4b46869b">assign</a>(capacity_type capacity_ctrl, InputIterator first, InputIterator last);
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_14fd3b613f754d529ca250f2563b2f863">swap</a>(circular_buffer_space_optimized<T, Alloc>& cb);
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cf3ffed54f5fece9315fb96726e5e205">push_back</a>(const_reference item = value_type());
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1f0484fd492b377ff80c0bcb76183162c">push_front</a>(const_reference item = value_type());
|
||
void <a href="#classboost_1_1circular__buffer__space__optimized_19c4290c18ab3dd2462dc01fb8368dff6">pop_back</a>();
|
||
void <a href="#classboost_1_1circular__buffer__space__optimized_1d7d496c40fc053258ac7d19cf5261788">pop_front</a>();
|
||
iterator <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_145877a0d46400f4894a13d25d138c130">insert</a>(iterator pos, const_reference item = value_type());
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1dc2060ce1105d80429ff3f004ca0691b">insert</a>(iterator pos, size_type n, const_reference item);
|
||
template <class InputIterator>
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19eec983bc010f2e8415618455dd81da0">insert</a>(iterator pos, InputIterator first, InputIterator last);
|
||
iterator <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cb3586429e49eeb2df2d2a09e19775de">rinsert</a>(iterator pos, const_reference item = value_type());
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_11eff7ec0eb603d489bd12f8c48928c9d">rinsert</a>(iterator pos, size_type n, const_reference item);
|
||
template <class InputIterator>
|
||
void <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1faeda7342f4717d7fb6b4589cb43b74e">rinsert</a>(iterator pos, InputIterator first, InputIterator last);
|
||
iterator <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_136feadef225bd8a10962a92c4ffcdfd3">erase</a>(iterator pos);
|
||
iterator <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19e9a4e0dfca27329da78e014d97201ca">erase</a>(iterator first, iterator last);
|
||
iterator <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_16e96800422211d02621526c894b71fa1">rerase</a>(iterator pos);
|
||
iterator <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_154fd4c2a67c7d6de6cbf6c8255729e98">rerase</a>(iterator first, iterator last);
|
||
void <a href="#classboost_1_1circular__buffer__space__optimized_12aa1dd29bd9509b5482ca2666c61deab">clear</a>();
|
||
};
|
||
|
||
template <class T, class Alloc>
|
||
bool <a href=
|
||
"circular_buffer.html#namespaceboost_1d35871e838359b5215e1cbb353663207">operator==</a>(const circular_buffer_space_optimized<T, Alloc>& lhs, const circular_buffer_space_optimized<T, Alloc>& rhs);
|
||
template <class T, class Alloc>
|
||
bool <a href=
|
||
"circular_buffer.html#namespaceboost_195b08213f201c2067d8acb024756329d">operator<</a>(const circular_buffer_space_optimized<T, Alloc>& lhs, const circular_buffer_space_optimized<T, Alloc>& rhs);
|
||
template <class T, class Alloc>
|
||
bool <a href=
|
||
"circular_buffer.html#namespaceboost_1f5717e2f6532581a6492ff1839b18f6d">operator!=</a>(const circular_buffer_space_optimized<T, Alloc>& lhs, const circular_buffer_space_optimized<T, Alloc>& rhs);
|
||
template <class T, class Alloc>
|
||
bool <a href=
|
||
"circular_buffer.html#namespaceboost_1f575d7a9741c2044424de50c966c12f3">operator></a>(const circular_buffer_space_optimized<T, Alloc>& lhs, const circular_buffer_space_optimized<T, Alloc>& rhs);
|
||
template <class T, class Alloc>
|
||
bool <a href=
|
||
"circular_buffer.html#namespaceboost_179abcbacd24b67f08185db54aec8600d">operator<=</a>(const circular_buffer_space_optimized<T, Alloc>& lhs, const circular_buffer_space_optimized<T, Alloc>& rhs);
|
||
template <class T, class Alloc>
|
||
bool <a href=
|
||
"circular_buffer.html#namespaceboost_11c31150380272af67deebef578c80b05">operator>=</a>(const circular_buffer_space_optimized<T, Alloc>& lhs, const circular_buffer_space_optimized<T, Alloc>& rhs);
|
||
template <class T, class Alloc>
|
||
void <a href=
|
||
"circular_buffer.html#namespaceboost_14aa8f6a2c9640f3f22e266f0fca85777">swap</a>(circular_buffer_space_optimized<T, Alloc>& lhs, circular_buffer_space_optimized<T, Alloc>& rhs);
|
||
|
||
} // namespace boost
|
||
</pre>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<h2>
|
||
<a name="rationale" id="rationale">Rationale</a>
|
||
</h2>
|
||
<p>
|
||
The auto-resizing mode of the space optimized circular buffer can be useful in situations when the container can
|
||
possibly store large number of elements but most of its lifetime the container stores just few of them. The usage
|
||
of the <code>circular_buffer_space_optimized</code> will result in decreased memory consumption and can improve
|
||
the CPU cache effectiveness.
|
||
</p>
|
||
<h2>
|
||
<a name="header" id="header">Header Files</a>
|
||
</h2>
|
||
<p>
|
||
The <code>circular_buffer_space_optimized</code> is defined in the file <code><a href=
|
||
"../../../boost/circular_buffer.hpp">boost/circular_buffer.hpp</a></code>. There is also a forward declaration
|
||
for the <code>circular_buffer_space_optimized</code> in the header file <code><a href=
|
||
"../../../boost/circular_buffer_fwd.hpp">boost/circular_buffer_fwd.hpp</a></code>.
|
||
</p>
|
||
<h2>
|
||
<a name="model" id="model">Modelled concepts</a>
|
||
</h2>
|
||
<p>
|
||
<a href="http://www.sgi.com/tech/stl/RandomAccessContainer.html">Random Access Container</a>, <a href=
|
||
"http://www.sgi.com/tech/stl/FrontInsertionSequence.html">Front Insertion Sequence</a> and <a href=
|
||
"http://www.sgi.com/tech/stl/BackInsertionSequence.html">Back Insertion Sequence</a>.
|
||
</p>
|
||
<h2>
|
||
<a name="types" id="types">Specific Public Types</a>
|
||
</h2>
|
||
<p>
|
||
Following public types are specific to the <code>circular_buffer_space_optimized</code>. Description of the
|
||
public types common with the <code>circular_buffer</code> can be found in the <code>circular_buffer</code>'s
|
||
<a href="circular_buffer.html#types">documentation</a>.
|
||
</p>
|
||
<div id="srcdoc_types">
|
||
<table id="table_public_types" border="1" cellpadding="3">
|
||
<tr>
|
||
<th>
|
||
Type
|
||
</th>
|
||
<th>
|
||
Description
|
||
</th>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0"><code>capacity_type</code></a>
|
||
</td>
|
||
<td>
|
||
Capacity controller of the space optimized circular buffer.
|
||
<pre>
|
||
class capacity_control {
|
||
size_type m_capacity;
|
||
size_type m_min_capacity;
|
||
public:
|
||
capacity_control(size_type capacity, size_type min_capacity = 0) : m_capacity(capacity), m_min_capacity(min_capacity) {};
|
||
size_type capacity() const { return m_capacity; }
|
||
size_type min_capacity() const { return m_min_capacity; }
|
||
operator size_type() const { return m_capacity; }
|
||
};
|
||
</pre>
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>capacity >= min_capacity</code>
|
||
</dd>
|
||
</dl>The <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a></code>
|
||
represents the capacity of the <code>circular_buffer_space_optimized</code> and the
|
||
<code>min_capacity()</code> determines the minimal allocated size of its internal buffer. The converting
|
||
constructor of the <code>capacity_control</code> allows implicit conversion from
|
||
<code>size_type</code>-like types which ensures compatibility of creating an instance of the
|
||
<code>circular_buffer_space_optimized</code> with other STL containers. On the other hand the operator
|
||
<code>size_type()</code> provides implicit conversion to the <code>size_type</code> which allows to treat
|
||
the capacity of the <code>circular_buffer_space_optimized</code> the same way as in the <code><a href=
|
||
"circular_buffer.html">circular_buffer</a></code>.
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<h2>
|
||
<a name="constructors" id="constructors">Constructors and Destructor</a>
|
||
</h2>
|
||
<div id="srcdoc_constructors">
|
||
<table id="table_constructors" border="1" cellpadding="3">
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1a05f824b31cd93d7695f4039edc7597f" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1a05f824b31cd93d7695f4039edc7597f"></a><code><b>explicit
|
||
circular_buffer_space_optimized(const <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>&
|
||
alloc = allocator_type());</b></code><br>
|
||
<br>
|
||
Create an empty space optimized circular buffer with zero capacity.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
== 0 && <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.min_capacity()
|
||
== 0 && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
|
||
0</code>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>alloc</code>
|
||
</dt>
|
||
<dd>
|
||
The allocator.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
Nothing.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Constant.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Warning:</b>
|
||
</dt>
|
||
<dd>
|
||
Since Boost version 1.36 the behaviour of this constructor has changed. Now it creates a space
|
||
optimized circular buffer with zero capacity.
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1741159a0511a4e0fed6eaab6d6959fa7" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1741159a0511a4e0fed6eaab6d6959fa7"></a><code><b>explicit
|
||
circular_buffer_space_optimized(<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>
|
||
capacity_ctrl, const <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>&
|
||
alloc = allocator_type());</b></code><br>
|
||
<br>
|
||
Create an empty space optimized circular buffer with the specified capacity.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
|
||
capacity_ctrl && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
|
||
0</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>capacity_ctrl.min_capacity()</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>capacity_ctrl</code>
|
||
</dt>
|
||
<dd>
|
||
The capacity controller representing the maximum number of elements which can be stored in the
|
||
<code>circular_buffer_space_optimized</code> and the minimal allocated size of the internal buffer.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>alloc</code>
|
||
</dt>
|
||
<dd>
|
||
The allocator.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Constant.
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1f8c9fa872f9a84d454d7e245cc2eadbd" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1f8c9fa872f9a84d454d7e245cc2eadbd"></a><code><b>circular_buffer_space_optimized(<a href="#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>
|
||
capacity_ctrl, <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item, const <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>&
|
||
alloc = allocator_type());</b></code><br>
|
||
<br>
|
||
Create a full space optimized circular buffer with the specified capacity filled with
|
||
<code>capacity_ctrl.capacity()</code> copies of <code>item</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
|
||
capacity_ctrl && <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954">full()</a>
|
||
&& (*this)[0] == item && (*this)[1] == item && ... && (*this)
|
||
[capacity_ctrl.capacity() - 1] == item</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>capacity_ctrl.capacity()</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>capacity_ctrl</code>
|
||
</dt>
|
||
<dd>
|
||
The capacity controller representing the maximum number of elements which can be stored in the
|
||
<code>circular_buffer_space_optimized</code> and the minimal allocated size of the internal buffer.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element the created <code>circular_buffer_space_optimized</code> will be filled with.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>alloc</code>
|
||
</dt>
|
||
<dd>
|
||
The allocator.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the <code>capacity_ctrl.capacity()</code>).
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1d29ce80b10d4a3250fedeb9427210d96" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1d29ce80b10d4a3250fedeb9427210d96"></a><code><b>circular_buffer_space_optimized(<a href="#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>
|
||
capacity_ctrl, <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a> n,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item, const <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>&
|
||
alloc = allocator_type());</b></code><br>
|
||
<br>
|
||
Create a space optimized circular buffer with the specified capacity filled with <code>n</code> copies of
|
||
<code>item</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>capacity_ctrl.capacity() >= n</code>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
|
||
capacity_ctrl && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == n
|
||
&& (*this)[0] == item && (*this)[1] == item && ... && (*this)[n - 1] ==
|
||
item</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>max[n,
|
||
capacity_ctrl.min_capacity()]</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>capacity_ctrl</code>
|
||
</dt>
|
||
<dd>
|
||
The capacity controller representing the maximum number of elements which can be stored in the
|
||
<code>circular_buffer_space_optimized</code> and the minimal allocated size of the internal buffer.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>n</code>
|
||
</dt>
|
||
<dd>
|
||
The number of elements the created <code>circular_buffer_space_optimized</code> will be filled
|
||
with.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element the created <code>circular_buffer_space_optimized</code> will be filled with.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>alloc</code>
|
||
</dt>
|
||
<dd>
|
||
The allocator.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the <code>n</code>).
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1d9f273c1a794f84484d220e977a3e24b" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1d9f273c1a794f84484d220e977a3e24b"></a><code><b>circular_buffer_space_optimized(const
|
||
circular_buffer_space_optimized<T,Alloc>& cb);</b></code><br>
|
||
<br>
|
||
The copy constructor.
|
||
<p>
|
||
Creates a copy of the specified <code>circular_buffer_space_optimized</code>.
|
||
</p>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>*this == cb</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>cb.size()</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>cb</code>
|
||
</dt>
|
||
<dd>
|
||
The <code>circular_buffer_space_optimized</code> to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of <code>cb</code>).
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_11dd04145492c82a959b1df1167b4e217" name=
|
||
"classboost_1_1circular__buffer__space__optimized_11dd04145492c82a959b1df1167b4e217"></a> <code><b>template
|
||
<class InputIterator><br>
|
||
circular_buffer_space_optimized(InputIterator first, InputIterator last, const <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>&
|
||
alloc = allocator_type());</b></code><br>
|
||
<br>
|
||
Create a full space optimized circular buffer filled with a copy of the range.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
Valid range <code>[first, last)</code>.<br>
|
||
<code>first</code> and <code>last</code> have to meet the requirements of <a href=
|
||
"http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
== std::distance(first, last) && <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.min_capacity()
|
||
== 0 && <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954">full()</a>
|
||
&& (*this)[0]== *first && (*this)[1] == *(first + 1) && ... &&
|
||
(*this)[std::distance(first, last) - 1] == *(last - 1)</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>std::distance(first, last)</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>first</code>
|
||
</dt>
|
||
<dd>
|
||
The beginning of the range to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>last</code>
|
||
</dt>
|
||
<dd>
|
||
The end of the range to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>alloc</code>
|
||
</dt>
|
||
<dd>
|
||
The allocator.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the <code>std::distance(first, last)</code>).
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_196c63e0ecd56f6f1ac87bc79d2fd5b9f" name=
|
||
"classboost_1_1circular__buffer__space__optimized_196c63e0ecd56f6f1ac87bc79d2fd5b9f"></a> <code><b>template
|
||
<class InputIterator><br>
|
||
circular_buffer_space_optimized(<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>
|
||
capacity_ctrl, InputIterator first, InputIterator last, const <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_14e07c6ddfe89debe384e59bed06e7cb7">allocator_type</a>&
|
||
alloc = allocator_type());</b></code><br>
|
||
<br>
|
||
Create a space optimized circular buffer with the specified capacity (and the minimal guaranteed amount of
|
||
allocated memory) filled with a copy of the range.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
Valid range <code>[first, last)</code>.<br>
|
||
<code>first</code> and <code>last</code> have to meet the requirements of <a href=
|
||
"http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
|
||
capacity_ctrl && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>
|
||
<= std::distance(first, last) && (*this)[0]== (last - capacity_ctrl.capacity()) &&
|
||
(*this)[1] == *(last - capacity_ctrl.capacity() + 1) && ... &&
|
||
(*this)[capacity_ctrl.capacity() - 1] == *(last - 1)</code><br>
|
||
<br>
|
||
If the number of items to be copied from the range <code>[first, last)</code> is greater than the
|
||
specified <code>capacity_ctrl.capacity()</code> then only elements from the range <code>[last -
|
||
capacity_ctrl.capacity(), last)</code> will be copied.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>max[capacity_ctrl.min_capacity(),
|
||
min[capacity_ctrl.capacity(), std::distance(first, last)]]</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>capacity_ctrl</code>
|
||
</dt>
|
||
<dd>
|
||
The capacity controller representing the maximum number of elements which can be stored in the
|
||
<code>circular_buffer_space_optimized</code> and the minimal allocated size of the internal buffer.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>first</code>
|
||
</dt>
|
||
<dd>
|
||
The beginning of the range to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>last</code>
|
||
</dt>
|
||
<dd>
|
||
The end of the range to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>alloc</code>
|
||
</dt>
|
||
<dd>
|
||
The allocator.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in <code>std::distance(first, last)</code>; in <code>min[capacity_ctrl.capacity(),
|
||
std::distance(first, last)]</code> if the <code>InputIterator</code> is a <a href=
|
||
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_16839c3ea656ff0f800e38096748fe8ac" name=
|
||
"classboost_1_1circular__buffer__space__optimized_16839c3ea656ff0f800e38096748fe8ac"></a><code><b>~circular_buffer_space_optimized();</b></code><br>
|
||
|
||
<br>
|
||
The destructor.
|
||
<p>
|
||
Destroys the <code>circular_buffer_space_optimized</code>.
|
||
</p>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
Nothing.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (including
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_12aa1dd29bd9509b5482ca2666c61deab">clear()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<h2>
|
||
<a name="methods" id="methods">Specific Public Member Functions</a>
|
||
</h2>
|
||
<p>
|
||
Following public member functions of the <code>circular_buffer_space_optimized</code> have different behaviour
|
||
from the base <code>circular_buffer</code>. Description of the public member functions with the same behaviour
|
||
can be found in the <code>circular_buffer</code>'s <a href="circular_buffer.html#methods">documentation</a>.
|
||
</p>
|
||
<div id="srcdoc_methods">
|
||
<table id="table_methods" border="1" cellpadding="3">
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954" name=
|
||
"classboost_1_1circular__buffer__space__optimized_142f4a13c50904a4ac0bf746c88451954"></a><code><b>bool
|
||
full() const;</b></code><br>
|
||
<br>
|
||
Is the <code>circular_buffer_space_optimized</code> full?
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>true</code> if the number of elements stored in the <code>circular_buffer_space_optimized</code>
|
||
equals the capacity of the <code>circular_buffer_space_optimized</code>; <code>false</code> otherwise.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
Nothing.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
No-throw.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Does not invalidate any iterators.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Constant (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15be1c2a005ec9828549ef6dd7ebed583">empty()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f" name=
|
||
"classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f"></a><code><b><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a>
|
||
reserve() const;</b></code><br>
|
||
<br>
|
||
Get the maximum number of elements which can be inserted into the
|
||
<code>circular_buffer_space_optimized</code> without overwriting any of already stored elements.
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
- <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
Nothing.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
No-throw.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Does not invalidate any iterators.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Constant (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a></code>,
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>,
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7">max_size()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa"></a><code><b>const
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>&
|
||
capacity() const;</b></code><br>
|
||
<br>
|
||
Get the capacity of the <code>circular_buffer_space_optimized</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
The capacity controller representing the maximum number of elements which can be stored in the
|
||
<code>circular_buffer_space_optimized</code> and the minimal allocated size of the internal buffer.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
Nothing.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
No-throw.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Does not invalidate any iterators.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Constant (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a></code>,
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a></code>,
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_157e2d506bc274b2a63fbe1b8fcafebd7">max_size()</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_149f28bc5b33d2062b9f6a33b48264e3f">set_capacity(const
|
||
capacity_type&)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_149f28bc5b33d2062b9f6a33b48264e3f" name=
|
||
"classboost_1_1circular__buffer__space__optimized_149f28bc5b33d2062b9f6a33b48264e3f"></a><code><b>void
|
||
set_capacity(const <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>&
|
||
capacity_ctrl);</b></code><br>
|
||
<br>
|
||
Change the capacity (and the minimal guaranteed amount of allocated memory) of the
|
||
<code>circular_buffer_space_optimized</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
|
||
capacity_ctrl && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>
|
||
<= capacity_ctrl.capacity()</code><br>
|
||
<br>
|
||
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is greater
|
||
than the desired new capacity then number of <code>[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> -
|
||
capacity_ctrl.capacity()]</code> <b>last</b> elements will be removed and the new size will be equal to
|
||
<code>capacity_ctrl.capacity()</code>.<br>
|
||
<br>
|
||
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is lower
|
||
than the new capacity then the amount of allocated memory in the internal buffer may be accommodated as
|
||
necessary but it will never drop below <code>capacity_ctrl.min_capacity()</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>capacity_ctrl</code>
|
||
</dt>
|
||
<dd>
|
||
The new capacity controller.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Strong.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in <code>min[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>,
|
||
capacity_ctrl.capacity()]</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Note:</b>
|
||
</dt>
|
||
<dd>
|
||
To explicitly clear the extra allocated memory use the <b>shrink-to-fit</b> technique:<br>
|
||
<br>
|
||
<code>boost::circular_buffer_space_optimized<int> cb(1000);<br>
|
||
...<br>
|
||
boost::circular_buffer_space_optimized<int>(cb).swap(cb);</code><br>
|
||
<br>
|
||
For more information about the shrink-to-fit technique in STL see <a href=
|
||
"http://www.gotw.ca/gotw/054.htm">http://www.gotw.ca/gotw/054.htm</a>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_10f096c108ebde69ae83a9de41b3bea56">rset_capacity(const
|
||
capacity_type&)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1f244ff5576b79f8d60e273c02d71c9f2">resize(size_type,
|
||
const_reference)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1f244ff5576b79f8d60e273c02d71c9f2" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1f244ff5576b79f8d60e273c02d71c9f2"></a><code><b>void
|
||
resize(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a>
|
||
new_size, <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item = value_type());</b></code><br>
|
||
<br>
|
||
Change the size of the <code>circular_buffer_space_optimized</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
|
||
new_size && <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
>= new_size</code><br>
|
||
<br>
|
||
If the new size is greater than the current size, copies of <code>item</code> will be inserted at the
|
||
<b>back</b> of the of the <code>circular_buffer_space_optimized</code> in order to achieve the desired
|
||
size. In the case the resulting size exceeds the current capacity the capacity will be set to
|
||
<code>new_size</code>.<br>
|
||
<br>
|
||
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is greater
|
||
than the desired new size then number of <code>[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> -
|
||
new_size]</code> <b>last</b> elements will be removed. (The capacity will remain unchanged.)<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be accommodated as necessary.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>new_size</code>
|
||
</dt>
|
||
<dd>
|
||
The new size.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element the <code>circular_buffer_space_optimized</code> will be filled with in order to gain
|
||
the requested size. (See the <i>Effect</i>.)
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the new size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1d45e2e72d9e3fb42e090ebc47ac8d7ee">rresize(size_type,
|
||
const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_149f28bc5b33d2062b9f6a33b48264e3f">set_capacity(const
|
||
capacity_type&)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_10f096c108ebde69ae83a9de41b3bea56" name=
|
||
"classboost_1_1circular__buffer__space__optimized_10f096c108ebde69ae83a9de41b3bea56"></a><code><b>void
|
||
rset_capacity(const <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>&
|
||
capacity_ctrl);</b></code><br>
|
||
<br>
|
||
Change the capacity (and the minimal guaranteed amount of allocated memory) of the
|
||
<code>circular_buffer_space_optimized</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
|
||
capacity_ctrl && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>
|
||
<= capacity_ctrl</code><br>
|
||
<br>
|
||
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is greater
|
||
than the desired new capacity then number of <code>[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> -
|
||
capacity_ctrl.capacity()]</code> <b>first</b> elements will be removed and the new size will be equal
|
||
to <code>capacity_ctrl.capacity()</code>.<br>
|
||
<br>
|
||
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is lower
|
||
than the new capacity then the amount of allocated memory in the internal buffer may be accommodated as
|
||
necessary but it will never drop below <code>capacity_ctrl.min_capacity()</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>capacity_ctrl</code>
|
||
</dt>
|
||
<dd>
|
||
The new capacity controller.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Strong.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in <code>min[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>,
|
||
capacity_ctrl.capacity()]</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_149f28bc5b33d2062b9f6a33b48264e3f">set_capacity(const
|
||
capacity_type&)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1d45e2e72d9e3fb42e090ebc47ac8d7ee">rresize(size_type,
|
||
const_reference)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1d45e2e72d9e3fb42e090ebc47ac8d7ee" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1d45e2e72d9e3fb42e090ebc47ac8d7ee"></a><code><b>void
|
||
rresize(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a>
|
||
new_size, <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item = value_type());</b></code><br>
|
||
<br>
|
||
Change the size of the <code>circular_buffer_space_optimized</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
|
||
new_size && <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
>= new_size</code><br>
|
||
<br>
|
||
If the new size is greater than the current size, copies of <code>item</code> will be inserted at the
|
||
<b>front</b> of the of the <code>circular_buffer_space_optimized</code> in order to achieve the desired
|
||
size. In the case the resulting size exceeds the current capacity the capacity will be set to
|
||
<code>new_size</code>.<br>
|
||
<br>
|
||
If the current number of elements stored in the <code>circular_buffer_space_optimized</code> is greater
|
||
than the desired new size then number of <code>[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> -
|
||
new_size]</code> <b>first</b> elements will be removed. (The capacity will remain unchanged.)<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be accommodated as necessary.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>new_size</code>
|
||
</dt>
|
||
<dd>
|
||
The new size.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element the <code>circular_buffer_space_optimized</code> will be filled with in order to gain
|
||
the requested size. (See the <i>Effect</i>.)
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the new size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1f244ff5576b79f8d60e273c02d71c9f2">resize(size_type,
|
||
const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_10f096c108ebde69ae83a9de41b3bea56">rset_capacity(const
|
||
capacity_type&)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8" name=
|
||
"classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8"></a><code><b>circular_buffer_space_optimized<T,Alloc>&
|
||
operator=(const circular_buffer_space_optimized<T,Alloc>& cb);</b></code><br>
|
||
<br>
|
||
The assign operator.
|
||
<p>
|
||
Makes this <code>circular_buffer_space_optimized</code> to become a copy of the specified
|
||
<code>circular_buffer_space_optimized</code>.
|
||
</p>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>*this == cb</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>cb.size()</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>cb</code>
|
||
</dt>
|
||
<dd>
|
||
The <code>circular_buffer_space_optimized</code> to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Strong.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to this <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of <code>cb</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1">assign(size_type,
|
||
const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf">assign(capacity_type,
|
||
size_type, const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb">assign(InputIterator,
|
||
InputIterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1e9347091d2d644854af0821d4b46869b">assign(capacity_type,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1" name=
|
||
"classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1"></a><code><b>void
|
||
assign(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a> n,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item);</b></code><br>
|
||
<br>
|
||
Assign <code>n</code> items into the space optimized circular buffer.
|
||
<p>
|
||
The content of the <code>circular_buffer_space_optimized</code> will be removed and replaced with
|
||
<code>n</code> copies of the <code>item</code>.
|
||
</p>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
== n && <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.min_capacity()
|
||
== 0 && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == n
|
||
&& (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1]
|
||
== item</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>n</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>n</code>
|
||
</dt>
|
||
<dd>
|
||
The number of elements the <code>circular_buffer_space_optimized</code> will be filled with.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element the <code>circular_buffer_space_optimized</code> will be filled with.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the <code>n</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf">assign(capacity_type,
|
||
size_type, const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb">assign(InputIterator,
|
||
InputIterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1e9347091d2d644854af0821d4b46869b">assign(capacity_type,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf"></a><code><b>void
|
||
assign(<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>
|
||
capacity_ctrl, <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a> n,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item);</b></code><br>
|
||
<br>
|
||
Assign <code>n</code> items into the space optimized circular buffer specifying the capacity.
|
||
<p>
|
||
The capacity of the <code>circular_buffer_space_optimized</code> will be set to the specified value and
|
||
the content of the <code>circular_buffer_space_optimized</code> will be removed and replaced with
|
||
<code>n</code> copies of the <code>item</code>.
|
||
</p>
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>capacity_ctrl.capacity() >= n</code>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
|
||
capacity_ctrl && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> == n
|
||
&& (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1]
|
||
== item</code><br>
|
||
<br>
|
||
The amount of allocated memory will be <code>max[n, capacity_ctrl.min_capacity()]</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>capacity_ctrl</code>
|
||
</dt>
|
||
<dd>
|
||
The new capacity controller.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>n</code>
|
||
</dt>
|
||
<dd>
|
||
The number of elements the <code>circular_buffer_space_optimized</code> will be filled with.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element the <code>circular_buffer_space_optimized</code> will be filled with.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the <code>n</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1">assign(size_type,
|
||
const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb">assign(InputIterator,
|
||
InputIterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1e9347091d2d644854af0821d4b46869b">assign(capacity_type,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb"></a> <code><b>template
|
||
<class InputIterator><br>
|
||
void assign(InputIterator first, InputIterator last);</b></code><br>
|
||
<br>
|
||
Assign a copy of the range into the space optimized circular buffer.
|
||
<p>
|
||
The content of the <code>circular_buffer_space_optimized</code> will be removed and replaced with copies
|
||
of elements from the specified range.
|
||
</p>
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
Valid range <code>[first, last)</code>.<br>
|
||
<code>first</code> and <code>last</code> have to meet the requirements of <a href=
|
||
"http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
== std::distance(first, last) && <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.min_capacity()
|
||
== 0 && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
|
||
std::distance(first, last) && (*this)[0]== *first && (*this)[1] == *(first + 1)
|
||
&& ... && (*this)[std::distance(first, last) - 1] == *(last - 1)</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>std::distance(first, last)</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>first</code>
|
||
</dt>
|
||
<dd>
|
||
The beginning of the range to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>last</code>
|
||
</dt>
|
||
<dd>
|
||
The end of the range to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the <code>std::distance(first, last)</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1">assign(size_type,
|
||
const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf">assign(capacity_type,
|
||
size_type, const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1e9347091d2d644854af0821d4b46869b">assign(capacity_type,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1e9347091d2d644854af0821d4b46869b" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1e9347091d2d644854af0821d4b46869b"></a> <code><b>template
|
||
<class InputIterator><br>
|
||
void assign(<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1051350e031c50c8b4a7ca1e1902e92f0">capacity_type</a>
|
||
capacity_ctrl, InputIterator first, InputIterator last);</b></code><br>
|
||
<br>
|
||
Assign a copy of the range into the space optimized circular buffer specifying the capacity.
|
||
<p>
|
||
The capacity of the <code>circular_buffer_space_optimized</code> will be set to the specified value and
|
||
the content of the <code>circular_buffer_space_optimized</code> will be removed and replaced with copies
|
||
of elements from the specified range.
|
||
</p>
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
Valid range <code>[first, last)</code>.<br>
|
||
<code>first</code> and <code>last</code> have to meet the requirements of <a href=
|
||
"http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a> ==
|
||
capacity_ctrl && <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a>
|
||
<= std::distance(first, last) && (*this)[0]== *(last - capacity) && (*this)[1] ==
|
||
*(last - capacity + 1) && ... && (*this)[capacity - 1] == *(last - 1)</code><br>
|
||
<br>
|
||
If the number of items to be copied from the range <code>[first, last)</code> is greater than the
|
||
specified <code>capacity</code> then only elements from the range <code>[last - capacity, last)</code>
|
||
will be copied.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer is <code>max[std::distance(first, last),
|
||
capacity_ctrl.min_capacity()]</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>capacity_ctrl</code>
|
||
</dt>
|
||
<dd>
|
||
The new capacity controller.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>first</code>
|
||
</dt>
|
||
<dd>
|
||
The beginning of the range to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>last</code>
|
||
</dt>
|
||
<dd>
|
||
The end of the range to be copied.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in <code>std::distance(first, last)</code>; in <code>min[capacity_ctrl.capacity(),
|
||
std::distance(first, last)]</code> if the <code>InputIterator</code> is a <a href=
|
||
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_177e35432c5e69b7a16ef7d937950e7a8">operator=</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_17ca4fda9526d0dad99706763c3b2d9f1">assign(size_type,
|
||
const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1108055ae3f6b1635e1428b0455902cbf">assign(capacity_type,
|
||
size_type, const_reference)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1417de2c2419c44d83a92c463762df5fb">assign(InputIterator,
|
||
InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_14fd3b613f754d529ca250f2563b2f863" name=
|
||
"classboost_1_1circular__buffer__space__optimized_14fd3b613f754d529ca250f2563b2f863"></a><code><b>void
|
||
swap(circular_buffer_space_optimized<T,Alloc>& cb);</b></code><br>
|
||
<br>
|
||
Swap the contents of two space optimized circular buffers.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>this</code> contains elements of <code>cb</code> and vice versa; the capacity and the amount of
|
||
allocated memory in the internal buffer of <code>this</code> equal to the capacity and the amount of
|
||
allocated memory of <code>cb</code> and vice versa.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>cb</code>
|
||
</dt>
|
||
<dd>
|
||
The <code>circular_buffer_space_optimized</code> whose content will be swapped.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
Nothing.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
No-throw.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators of both <code>circular_buffer_space_optimized</code> containers. (On the
|
||
other hand the iterators still point to the same elements but within another container. If you want to
|
||
rely on this feature you have to turn the <a href="circular_buffer.html#debug">Debug Support</a> off
|
||
otherwise an assertion will report an error if such invalidated iterator is used.)
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Constant (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"circular_buffer.html#namespaceboost_14aa8f6a2c9640f3f22e266f0fca85777">swap(circular_buffer_space_optimized<T,
|
||
Alloc>&, circular_buffer_space_optimized<T, Alloc>&)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1cf3ffed54f5fece9315fb96726e5e205" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1cf3ffed54f5fece9315fb96726e5e205"></a><code><b>void
|
||
push_back(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item = value_type());</b></code><br>
|
||
<br>
|
||
Insert a new element at the end of the space optimized circular buffer.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
if <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
> 0</code> then <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1d985d974020f88bb4255d8edbae0a30a">back()</a> ==
|
||
item</code><br>
|
||
If the <code>circular_buffer_space_optimized</code> is full, the first element will be removed. If the
|
||
capacity is <code>0</code>, nothing will be inserted.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively increased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1f0484fd492b377ff80c0bcb76183162c">push_front(const_reference)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19c4290c18ab3dd2462dc01fb8368dff6">pop_back()</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1d7d496c40fc053258ac7d19cf5261788">pop_front()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1f0484fd492b377ff80c0bcb76183162c" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1f0484fd492b377ff80c0bcb76183162c"></a><code><b>void
|
||
push_front(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item = value_type());</b></code><br>
|
||
<br>
|
||
Insert a new element at the beginning of the space optimized circular buffer.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
if <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity()
|
||
> 0</code> then <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_10d5fdeabeb352f47d1f7bb1ea8d9819f">front()</a> ==
|
||
item</code><br>
|
||
If the <code>circular_buffer_space_optimized</code> is full, the last element will be removed. If the
|
||
capacity is <code>0</code>, nothing will be inserted.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively increased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cf3ffed54f5fece9315fb96726e5e205">push_back(const_reference)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19c4290c18ab3dd2462dc01fb8368dff6">pop_back()</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1d7d496c40fc053258ac7d19cf5261788">pop_front()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_19c4290c18ab3dd2462dc01fb8368dff6" name=
|
||
"classboost_1_1circular__buffer__space__optimized_19c4290c18ab3dd2462dc01fb8368dff6"></a><code><b>void
|
||
pop_back();</b></code><br>
|
||
<br>
|
||
Remove the last element from the space optimized circular buffer.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>!empty()</code>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The last element is removed from the <code>circular_buffer_space_optimized</code>.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively decreased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1d7d496c40fc053258ac7d19cf5261788">pop_front()</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cf3ffed54f5fece9315fb96726e5e205">push_back(const_reference)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1f0484fd492b377ff80c0bcb76183162c">push_front(const_reference)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1d7d496c40fc053258ac7d19cf5261788" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1d7d496c40fc053258ac7d19cf5261788"></a><code><b>void
|
||
pop_front();</b></code><br>
|
||
<br>
|
||
Remove the first element from the space optimized circular buffer.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>!empty()</code>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The first element is removed from the <code>circular_buffer_space_optimized</code>.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively decreased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19c4290c18ab3dd2462dc01fb8368dff6">pop_back()</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cf3ffed54f5fece9315fb96726e5e205">push_back(const_reference)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1f0484fd492b377ff80c0bcb76183162c">push_front(const_reference)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_145877a0d46400f4894a13d25d138c130" name=
|
||
"classboost_1_1circular__buffer__space__optimized_145877a0d46400f4894a13d25d138c130"></a><code><b><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
insert(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a> pos,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item = value_type());</b></code><br>
|
||
<br>
|
||
Insert an element at the specified position.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> or
|
||
its end.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The <code>item</code> will be inserted at the position <code>pos</code>.<br>
|
||
If the <code>circular_buffer_space_optimized</code> is full, the first element will be overwritten. If
|
||
the <code>circular_buffer_space_optimized</code> is full and the <code>pos</code> points to
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a></code>,
|
||
then the <code>item</code> will not be inserted. If the capacity is <code>0</code>, nothing will be
|
||
inserted.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively increased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>pos</code>
|
||
</dt>
|
||
<dd>
|
||
An iterator specifying the position where the <code>item</code> will be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
Iterator to the inserted element or <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a></code>
|
||
if the <code>item</code> is not inserted. (See the <i>Effect</i>.)
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1dc2060ce1105d80429ff3f004ca0691b">insert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19eec983bc010f2e8415618455dd81da0">insert(iterator,
|
||
InputIterator, InputIterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cb3586429e49eeb2df2d2a09e19775de">rinsert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_11eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1faeda7342f4717d7fb6b4589cb43b74e">rinsert(iterator,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1dc2060ce1105d80429ff3f004ca0691b" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1dc2060ce1105d80429ff3f004ca0691b"></a><code><b>void
|
||
insert(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a> pos,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a> n,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item);</b></code><br>
|
||
<br>
|
||
Insert <code>n</code> copies of the <code>item</code> at the specified position.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> or
|
||
its end.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The number of <code>min[n, (pos - <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>) +
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]</code>
|
||
elements will be inserted at the position <code>pos</code>.<br>
|
||
The number of <code>min[pos - <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>,
|
||
max[0, n - <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]]</code>
|
||
elements will be overwritten at the beginning of the <code>circular_buffer_space_optimized</code>.<br>
|
||
(See <i>Example</i> for the explanation.)<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively increased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>pos</code>
|
||
</dt>
|
||
<dd>
|
||
An iterator specifying the position where the <code>item</code>s will be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>n</code>
|
||
</dt>
|
||
<dd>
|
||
The number of <code>item</code>s the to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element whose copies will be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in <code>min[<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity(),
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
|
||
n]</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Example:</b>
|
||
</dt>
|
||
<dd>
|
||
Consider a <code>circular_buffer_space_optimized</code> with the capacity of 6 and the size of 4. Its
|
||
internal buffer may look like the one below.<br>
|
||
<br>
|
||
<code>|1|2|3|4| | |</code><br>
|
||
<code>p ---^</code><br>
|
||
<br>
|
||
After inserting 5 elements at the position <code>p</code>:<br>
|
||
<br>
|
||
<code>insert(p, (size_t)5, 0);</code><br>
|
||
<br>
|
||
actually only 4 elements get inserted and elements <code>1</code> and <code>2</code> are overwritten.
|
||
This is due to the fact the insert operation preserves the capacity. After insertion the internal
|
||
buffer looks like this:<br>
|
||
<br>
|
||
<code>|0|0|0|0|3|4|</code><br>
|
||
<br>
|
||
For comparison if the capacity would not be preserved the internal buffer would then result in
|
||
<code>|1|2|0|0|0|0|0|3|4|</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_145877a0d46400f4894a13d25d138c130">insert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19eec983bc010f2e8415618455dd81da0">insert(iterator,
|
||
InputIterator, InputIterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cb3586429e49eeb2df2d2a09e19775de">rinsert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_11eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1faeda7342f4717d7fb6b4589cb43b74e">rinsert(iterator,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_19eec983bc010f2e8415618455dd81da0" name=
|
||
"classboost_1_1circular__buffer__space__optimized_19eec983bc010f2e8415618455dd81da0"></a> <code><b>template
|
||
<class InputIterator><br>
|
||
void insert(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a> pos,
|
||
InputIterator first, InputIterator last);</b></code><br>
|
||
<br>
|
||
Insert the range <code>[first, last)</code> at the specified position.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> or
|
||
its end.<br>
|
||
Valid range <code>[first, last)</code> where <code>first</code> and <code>last</code> meet the
|
||
requirements of an <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
Elements from the range <code>[first + max[0, distance(first, last) - (pos - <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>) -
|
||
<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>],
|
||
last)</code> will be inserted at the position <code>pos</code>.<br>
|
||
The number of <code>min[pos - <a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a>,
|
||
max[0, distance(first, last) - <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]]</code>
|
||
elements will be overwritten at the beginning of the <code>circular_buffer_space_optimized</code>.<br>
|
||
(See <i>Example</i> for the explanation.)<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively increased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>pos</code>
|
||
</dt>
|
||
<dd>
|
||
An iterator specifying the position where the range will be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>first</code>
|
||
</dt>
|
||
<dd>
|
||
The beginning of the range to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>last</code>
|
||
</dt>
|
||
<dd>
|
||
The end of the range to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in <code>[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
|
||
std::distance(first, last)]</code>; in <code>min[<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity(),
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
|
||
std::distance(first, last)]</code> if the <code>InputIterator</code> is a <a href=
|
||
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Example:</b>
|
||
</dt>
|
||
<dd>
|
||
Consider a <code>circular_buffer_space_optimized</code> with the capacity of 6 and the size of 4. Its
|
||
internal buffer may look like the one below.<br>
|
||
<br>
|
||
<code>|1|2|3|4| | |</code><br>
|
||
<code>p ---^</code><br>
|
||
<br>
|
||
After inserting a range of elements at the position <code>p</code>:<br>
|
||
<br>
|
||
<code>int array[] = { 5, 6, 7, 8, 9 };</code><br>
|
||
<code>insert(p, array, array + 5);</code><br>
|
||
<br>
|
||
actually only elements <code>6</code>, <code>7</code>, <code>8</code> and <code>9</code> from the
|
||
specified range get inserted and elements <code>1</code> and <code>2</code> are overwritten. This is
|
||
due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks
|
||
like this:<br>
|
||
<br>
|
||
<code>|6|7|8|9|3|4|</code><br>
|
||
<br>
|
||
For comparison if the capacity would not be preserved the internal buffer would then result in
|
||
<code>|1|2|5|6|7|8|9|3|4|</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_145877a0d46400f4894a13d25d138c130">insert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1dc2060ce1105d80429ff3f004ca0691b">insert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cb3586429e49eeb2df2d2a09e19775de">rinsert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_11eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1faeda7342f4717d7fb6b4589cb43b74e">rinsert(iterator,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1cb3586429e49eeb2df2d2a09e19775de" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1cb3586429e49eeb2df2d2a09e19775de"></a><code><b><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
rinsert(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a> pos,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item = value_type());</b></code><br>
|
||
<br>
|
||
Insert an element before the specified position.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> or
|
||
its end.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The <code>item</code> will be inserted before the position <code>pos</code>.<br>
|
||
If the <code>circular_buffer_space_optimized</code> is full, the last element will be overwritten. If
|
||
the <code>circular_buffer_space_optimized</code> is full and the <code>pos</code> points to
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>,
|
||
then the <code>item</code> will not be inserted. If the capacity is <code>0</code>, nothing will be
|
||
inserted.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively increased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>pos</code>
|
||
</dt>
|
||
<dd>
|
||
An iterator specifying the position before which the <code>item</code> will be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
Iterator to the inserted element or <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>
|
||
if the <code>item</code> is not inserted. (See the <i>Effect</i>.)
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_11eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1faeda7342f4717d7fb6b4589cb43b74e">rinsert(iterator,
|
||
InputIterator, InputIterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_145877a0d46400f4894a13d25d138c130">insert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1dc2060ce1105d80429ff3f004ca0691b">insert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19eec983bc010f2e8415618455dd81da0">insert(iterator,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_11eff7ec0eb603d489bd12f8c48928c9d" name=
|
||
"classboost_1_1circular__buffer__space__optimized_11eff7ec0eb603d489bd12f8c48928c9d"></a><code><b>void
|
||
rinsert(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a> pos,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_19ba12c0142a21a7d960877c22fa3ea00">size_type</a> n,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1a8397191092f5bacee991b623ca4b910">const_reference</a>
|
||
item);</b></code><br>
|
||
<br>
|
||
Insert <code>n</code> copies of the <code>item</code> before the specified position.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> or
|
||
its end.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The number of <code>min[n, (<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> -
|
||
pos) + <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]</code>
|
||
elements will be inserted before the position <code>pos</code>.<br>
|
||
The number of <code>min[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> -
|
||
pos, max[0, n - <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]]</code>
|
||
elements will be overwritten at the end of the <code>circular_buffer_space_optimized</code>.<br>
|
||
(See <i>Example</i> for the explanation.)<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively increased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>pos</code>
|
||
</dt>
|
||
<dd>
|
||
An iterator specifying the position where the <code>item</code>s will be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>n</code>
|
||
</dt>
|
||
<dd>
|
||
The number of <code>item</code>s the to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>item</code>
|
||
</dt>
|
||
<dd>
|
||
The element whose copies will be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in <code>min[<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity(),
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
|
||
n]</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Example:</b>
|
||
</dt>
|
||
<dd>
|
||
Consider a <code>circular_buffer_space_optimized</code> with the capacity of 6 and the size of 4. Its
|
||
internal buffer may look like the one below.<br>
|
||
<br>
|
||
<code>|1|2|3|4| | |</code><br>
|
||
<code>p ---^</code><br>
|
||
<br>
|
||
After inserting 5 elements before the position <code>p</code>:<br>
|
||
<br>
|
||
<code>rinsert(p, (size_t)5, 0);</code><br>
|
||
<br>
|
||
actually only 4 elements get inserted and elements <code>3</code> and <code>4</code> are overwritten.
|
||
This is due to the fact the rinsert operation preserves the capacity. After insertion the internal
|
||
buffer looks like this:<br>
|
||
<br>
|
||
<code>|1|2|0|0|0|0|</code><br>
|
||
<br>
|
||
For comparison if the capacity would not be preserved the internal buffer would then result in
|
||
<code>|1|2|0|0|0|0|0|3|4|</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cb3586429e49eeb2df2d2a09e19775de">rinsert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1faeda7342f4717d7fb6b4589cb43b74e">rinsert(iterator,
|
||
InputIterator, InputIterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_145877a0d46400f4894a13d25d138c130">insert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1dc2060ce1105d80429ff3f004ca0691b">insert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19eec983bc010f2e8415618455dd81da0">insert(iterator,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_1faeda7342f4717d7fb6b4589cb43b74e" name=
|
||
"classboost_1_1circular__buffer__space__optimized_1faeda7342f4717d7fb6b4589cb43b74e"></a> <code><b>template
|
||
<class InputIterator><br>
|
||
void rinsert(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a> pos,
|
||
InputIterator first, InputIterator last);</b></code><br>
|
||
<br>
|
||
Insert the range <code>[first, last)</code> before the specified position.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> or
|
||
its end.<br>
|
||
Valid range <code>[first, last)</code> where <code>first</code> and <code>last</code> meet the
|
||
requirements of an <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
Elements from the range <code>[first, last - max[0, distance(first, last) - (<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> -
|
||
pos) - <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>])</code>
|
||
will be inserted before the position <code>pos</code>.<br>
|
||
The number of <code>min[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a> -
|
||
pos, max[0, distance(first, last) - <a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_170eec72a6e8d088b58e26ac7e2dd7c9f">reserve()</a>]]</code>
|
||
elements will be overwritten at the end of the <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer">circular_buffer</a></code>.<br>
|
||
(See <i>Example</i> for the explanation.)<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively increased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>pos</code>
|
||
</dt>
|
||
<dd>
|
||
An iterator specifying the position where the range will be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>first</code>
|
||
</dt>
|
||
<dd>
|
||
The beginning of the range to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>last</code>
|
||
</dt>
|
||
<dd>
|
||
The end of the range to be inserted.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::T(const T&)</code> throws.
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in <code>[<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
|
||
std::distance(first, last)]</code>; in <code>min[<a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1aa2695c84ac9fc912e28d1a5920dadfa">capacity()</a>.capacity(),
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> +
|
||
std::distance(first, last)]</code> if the <code>InputIterator</code> is a <a href=
|
||
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Example:</b>
|
||
</dt>
|
||
<dd>
|
||
Consider a <code>circular_buffer_space_optimized</code> with the capacity of 6 and the size of 4. Its
|
||
internal buffer may look like the one below.<br>
|
||
<br>
|
||
<code>|1|2|3|4| | |</code><br>
|
||
<code>p ---^</code><br>
|
||
<br>
|
||
After inserting a range of elements before the position <code>p</code>:<br>
|
||
<br>
|
||
<code>int array[] = { 5, 6, 7, 8, 9 };</code><br>
|
||
<code>insert(p, array, array + 5);</code><br>
|
||
<br>
|
||
actually only elements <code>5</code>, <code>6</code>, <code>7</code> and <code>8</code> from the
|
||
specified range get inserted and elements <code>3</code> and <code>4</code> are overwritten. This is
|
||
due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks
|
||
like this:<br>
|
||
<br>
|
||
<code>|1|2|5|6|7|8|</code><br>
|
||
<br>
|
||
For comparison if the capacity would not be preserved the internal buffer would then result in
|
||
<code>|1|2|5|6|7|8|9|3|4|</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1cb3586429e49eeb2df2d2a09e19775de">rinsert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_11eff7ec0eb603d489bd12f8c48928c9d">rinsert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_145877a0d46400f4894a13d25d138c130">insert(iterator,
|
||
value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_1dc2060ce1105d80429ff3f004ca0691b">insert(iterator,
|
||
size_type, value_type)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19eec983bc010f2e8415618455dd81da0">insert(iterator,
|
||
InputIterator, InputIterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_136feadef225bd8a10962a92c4ffcdfd3" name=
|
||
"classboost_1_1circular__buffer__space__optimized_136feadef225bd8a10962a92c4ffcdfd3"></a><code><b><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
erase(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
pos);</b></code><br>
|
||
<br>
|
||
Remove an element at the specified position.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> (but
|
||
not an <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The element at the position <code>pos</code> is removed.<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively decreased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>pos</code>
|
||
</dt>
|
||
<dd>
|
||
An iterator pointing at the element to be removed.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
Iterator to the first element remaining beyond the removed element or <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>
|
||
if no such element exists.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19e9a4e0dfca27329da78e014d97201ca">erase(iterator,
|
||
iterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_16e96800422211d02621526c894b71fa1">rerase(iterator)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_154fd4c2a67c7d6de6cbf6c8255729e98">rerase(iterator,
|
||
iterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_12aa1dd29bd9509b5482ca2666c61deab">clear()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_19e9a4e0dfca27329da78e014d97201ca" name=
|
||
"classboost_1_1circular__buffer__space__optimized_19e9a4e0dfca27329da78e014d97201ca"></a><code><b><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
erase(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a> first,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
last);</b></code><br>
|
||
<br>
|
||
Erase the range <code>[first, last)</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
Valid range <code>[first, last)</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The elements from the range <code>[first, last)</code> are removed. (If <code>first == last</code>
|
||
nothing is removed.)<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively decreased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>first</code>
|
||
</dt>
|
||
<dd>
|
||
The beginning of the range to be removed.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>last</code>
|
||
</dt>
|
||
<dd>
|
||
The end of the range to be removed.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
Iterator to the first element remaining beyond the removed elements or <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>
|
||
if no such element exists.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_136feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_16e96800422211d02621526c894b71fa1">rerase(iterator)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_154fd4c2a67c7d6de6cbf6c8255729e98">rerase(iterator,
|
||
iterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_12aa1dd29bd9509b5482ca2666c61deab">clear()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_16e96800422211d02621526c894b71fa1" name=
|
||
"classboost_1_1circular__buffer__space__optimized_16e96800422211d02621526c894b71fa1"></a><code><b><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
rerase(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
pos);</b></code><br>
|
||
<br>
|
||
Remove an element at the specified position.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
<code>pos</code> is a valid iterator pointing to the <code>circular_buffer_space_optimized</code> (but
|
||
not an <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).<br>
|
||
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively decreased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The element at the position <code>pos</code> is removed.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>pos</code>
|
||
</dt>
|
||
<dd>
|
||
An iterator pointing at the element to be removed.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
Iterator to the first element remaining in front of the removed element or <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a></code>
|
||
if no such element exists.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Note:</b>
|
||
</dt>
|
||
<dd>
|
||
Basically there is no difference between <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_136feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</a></code>
|
||
and this method. It is implemented only for consistency with the base <code><a href=
|
||
"circular_buffer.html">circular_buffer</a></code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_136feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19e9a4e0dfca27329da78e014d97201ca">erase(iterator,
|
||
iterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_154fd4c2a67c7d6de6cbf6c8255729e98">rerase(iterator,
|
||
iterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_12aa1dd29bd9509b5482ca2666c61deab">clear()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_154fd4c2a67c7d6de6cbf6c8255729e98" name=
|
||
"classboost_1_1circular__buffer__space__optimized_154fd4c2a67c7d6de6cbf6c8255729e98"></a><code><b><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
rerase(<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a> first,
|
||
<a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_11b8a33f2dc8519b8a7d344ed4408c532">iterator</a>
|
||
last);</b></code><br>
|
||
<br>
|
||
Erase the range <code>[first, last)</code>.
|
||
<dl>
|
||
<dt>
|
||
<b>Precondition:</b>
|
||
</dt>
|
||
<dd>
|
||
Valid range <code>[first, last)</code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
The elements from the range <code>[first, last)</code> are removed. (If <code>first == last</code>
|
||
nothing is removed.)<br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively decreased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Parameter(s):</b>
|
||
</dt>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>first</code>
|
||
</dt>
|
||
<dd>
|
||
The beginning of the range to be removed.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
<dd>
|
||
<dl compact>
|
||
<dt>
|
||
<code>last</code>
|
||
</dt>
|
||
<dd>
|
||
The end of the range to be removed.
|
||
</dd>
|
||
</dl>
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Returns:</b>
|
||
</dt>
|
||
<dd>
|
||
Iterator to the first element remaining in front of the removed elements or <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_158d1ede2e85f5d46eda8db3f0c4efef0">begin()</a></code>
|
||
if no such element exists.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
<dd>
|
||
Whatever <code>T::operator = (const T&)</code> throws.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Note:</b>
|
||
</dt>
|
||
<dd>
|
||
Basically there is no difference between <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19e9a4e0dfca27329da78e014d97201ca">erase(iterator,
|
||
iterator)</a></code> and this method. It is implemented only for consistency with the base
|
||
<code><a href="circular_buffer.html">circular_buffer</a></code>.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_136feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19e9a4e0dfca27329da78e014d97201ca">erase(iterator,
|
||
iterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_16e96800422211d02621526c894b71fa1">rerase(iterator)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_12aa1dd29bd9509b5482ca2666c61deab">clear()</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<a id="classboost_1_1circular__buffer__space__optimized_12aa1dd29bd9509b5482ca2666c61deab" name=
|
||
"classboost_1_1circular__buffer__space__optimized_12aa1dd29bd9509b5482ca2666c61deab"></a><code><b>void
|
||
clear();</b></code><br>
|
||
<br>
|
||
Remove all stored elements from the space optimized circular buffer.
|
||
<dl>
|
||
<dt>
|
||
<b>Effect:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_15fa0edd153e2591dd6bf070eb663ee32">size()</a> ==
|
||
0</code><br>
|
||
<br>
|
||
The amount of allocated memory in the internal buffer may be predictively decreased.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Throws:</b>
|
||
</dt>
|
||
<dd>
|
||
An allocation error if memory is exhausted (<code>std::bad_alloc</code> if the standard allocator is
|
||
used).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Exception Safety:</b>
|
||
</dt>
|
||
<dd>
|
||
Basic.
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Iterator Invalidation:</b>
|
||
</dt>
|
||
<dd>
|
||
Invalidates all iterators pointing to the <code>circular_buffer_space_optimized</code> (except
|
||
iterators equal to <code><a href=
|
||
"circular_buffer.html#classboost_1_1circular__buffer_1babfa093dad7801223b80626b598dee1">end()</a></code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>Complexity:</b>
|
||
</dt>
|
||
<dd>
|
||
Linear (in the size of the <code>circular_buffer_space_optimized</code>).
|
||
</dd>
|
||
</dl>
|
||
<dl>
|
||
<dt>
|
||
<b>See Also:</b>
|
||
</dt>
|
||
<dd>
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_16839c3ea656ff0f800e38096748fe8ac">~circular_buffer_space_optimized()</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_136feadef225bd8a10962a92c4ffcdfd3">erase(iterator)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_19e9a4e0dfca27329da78e014d97201ca">erase(iterator,
|
||
iterator)</a></code>, <code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_16e96800422211d02621526c894b71fa1">rerase(iterator)</a></code>,
|
||
<code><a href=
|
||
"#classboost_1_1circular__buffer__space__optimized_154fd4c2a67c7d6de6cbf6c8255729e98">rerase(iterator,
|
||
iterator)</a></code>
|
||
</dd>
|
||
</dl>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<h2>
|
||
<a name="see" id="see">See also</a>
|
||
</h2>
|
||
<p>
|
||
<code><a href="circular_buffer.html">boost::circular_buffer</a>, <a href=
|
||
"http://www.sgi.com/tech/stl/Vector.html">std::vector</a></code>
|
||
</p>
|
||
<h2>
|
||
<a name="ack" id="ack">Acknowledgements</a>
|
||
</h2>
|
||
<p>
|
||
The idea of the space optimized circular buffer has been introduced by Pavel Vozenilek.
|
||
</p>
|
||
<h2>
|
||
<a name="relnotes" id="relnotes">Release Notes</a>
|
||
</h2>
|
||
<dl>
|
||
<dd>
|
||
<h3>
|
||
Boost 1.37
|
||
</h3>
|
||
</dd>
|
||
<dd>
|
||
<ul>
|
||
<li>Added new methods <code>is_linearized()</code> and <code>rotate(const_iterator)</code>.
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
<h3>
|
||
Boost 1.36
|
||
</h3>
|
||
</dd>
|
||
<dd>
|
||
<ul>
|
||
<li>Changed behaviour of the <code>circular_buffer_space_optimized(const allocator_type&)</code>
|
||
constructor. Since this version the constructor sets the capacity to zero.
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
<dd>
|
||
<h3>
|
||
Boost 1.35
|
||
</h3>
|
||
</dd>
|
||
<dd>
|
||
<ul>
|
||
<li>Initial release.
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
<hr size="1">
|
||
<p>
|
||
<small>Copyright <20> 2003-2008 Jan Gaspar</small>
|
||
</p>
|
||
<p>
|
||
<small>Use, modification, and distribution is subject to the Boost Software License, Version 1.0.<br>
|
||
(See accompanying file <code>LICENSE_1_0.txt</code> or copy at <a href=
|
||
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</small>
|
||
</p>
|
||
</body>
|
||
</html>
|