51 p_increment = increment;
78 s <<
"{" << p_vector.n() <<
"|";
80 if (p_front >= p_back)
82 for(
int i0=0; i0<p_back; i0++)
84 for(
int i=p_back; i<p_front; i++)
85 s << p_vector(i) <<
"//";
86 for(
int in=p_front; in <p_vector.n(); in++)
91 for(
int ii=0; ii<p_front; ii++)
92 s << p_vector(ii) <<
"//";
93 for(
int i0=p_front; i0<p_back; i0++)
95 for(
int i=p_back; i<p_vector.n(); i++)
96 s << p_vector(i) <<
"//";
109 p_vector.resize(p_vector.n()+p_increment,
true);
112 p_vector.resize(p_vector.n()+p_increment,
false);
114 if (p_front >= p_back)
115 for(
int i=p_back, j=0; i<p_front; i++, j++)
116 p_vector[j] = tmp[i];
120 for(
int i=p_back; i<tmp.
n(); i++, j++)
121 p_vector[j] = tmp[i];
123 for(
int ii=0; ii<p_front; ii++, j++)
124 p_vector[j] = tmp[ii];
136 return p_front==p_back;
143 for(
int i=0; i<p_vector.n(); i++)
150 int next_front= p_front+1;
151 if (next_front >= p_vector.n())
154 if (next_front==p_back)
161 p_vector[p_front] = it;
174 p_front=p_vector.n()-1;
176 return p_vector[p_front];
185 int pos = p_front-1-n;
187 if (p_front < p_back)
200 return p_vector[pos];
206 int next_back = p_back-1;
209 next_back = p_vector.n()-1;
211 if (next_back == p_front)
218 p_vector[p_back=next_back] = it;
228 int old_back = p_back;
230 if (p_back >= p_vector.n())
233 return p_vector[old_back];
void clear(void)
Empty it out.
bool is_empty(void) const
Is there anything to get?
std::ostream & print(std::ostream &s) const
print picture of state. Mostly useful for debugging.
static const T * Filler
Used to fill empty spaces when possible.
INLINE ssize_t n() const
number of items in vector.