list-container.h revision a4030d5ca449e7e384bc699cd249ee704faaeab0
/*
* Inkscape::Util::ListContainer - encapsulates lists as STL containers,
* providing fast appending
*
* Authors:
* MenTaLguY <mental@rydia.net>
*
* Copyright (C) 2005 MenTaLguY
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <limits>
/* default constructible */
ListContainer() {}
/* assignable */
}
clear();
}
return *this;
}
}
/* equality comparable */
while ( iter && other_iter ) {
if (!( *iter == *other_iter )) {
return false;
}
++iter;
++other_iter;
}
return !iter && !other_iter;
}
}
/* lessthan comparable */
while ( iter && other_iter ) {
if ( *iter < *other_iter ) {
return true;
} else if ( *other_iter < *iter ) {
return false;
}
++iter;
++other_iter;
}
return bool(other_iter);
}
}
/* container */
typedef List<T const> const_iterator;
size++;
}
return size;
}
}
/* sequence */
}
}
}
}
for ( ; i != j ; ++i ) {
push_back(*i);
}
}
if (position) {
return added;
} else {
return _head;
}
} else {
return _tail;
}
}
{
}
}
}
if ( i == _head ) {
if ( !j || !rest(j) ) {
}
} else {
if (j) {
} else {
}
}
}
void clear() {
}
MutableList<T> before;
MutableList<T> iter;
size--;
}
if (size) {
if (empty()) {
} else {
}
} else if (iter) {
if (before) {
} else {
}
}
}
}
/* front insertion sequence */
if (_head) {
} else {
}
}
void pop_front() {
if (_head) {
if (!_head) {
}
}
}
/* back insertion sequence */
if (_tail) {
} else {
}
}
// we're not required to provide pop_back if we can't
// implement it efficiently
/* additional */
MutableList<T> detatchList() {
return list;
}
if (pos) {
}
} else {
}
}
{
}
{
}
if (!position) {
pop_front();
} else {
}
}
}
MutableList<T> _head;
MutableList<T> _tail;
return iter;
}
}
return MutableList<T>();
}
return;
}
if (empty()) { /* if empty, just take the whole thing */
} else if (pos) {
} else { /* insert somewhere in the middle */
}
} else { /* append */
}
}
ListContainer const &temp)
{
return;
}
if (empty()) { /* if empty, just take the whole thing */
} else if (pos) {
} else { /* insert somewhere in the middle */
}
} else { /* prepend */
}
}
};
}
}
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :