#ifndef __BOUNDED_HPP #define __BOUNDED_HPP #include "except.hpp" template class Bounded { public: Bounded(); Bounded(const Bounded&); ~Bounded(); Bounded operator=(const Bounded&); void clear(); void insert(const Item &); void insert(const Item &, unsigned before); void append(const Item &); void append(const Item &, unsigned after); void remove(unsigned at); void replace(unsigned at, const Item &); unsigned available() const; int isEmpty() const; unsigned length() const; const Item& first() const; const Item& last() const; const Item& itemAt(unsigned at) const; Item& itemAt(unsigned at); const Item& operator[](unsigned at) const { return itemAt(at); } Item& operator[](unsigned at) { return itemAt(at); } unsigned location(const Item &i) const; protected: Item rep[Size]; unsigned left,items; void expandLeft(unsigned from); void expandRight(unsigned from); void shrinkLeft(unsigned from); void shrinkRight(unsigned from); }; #include "bounded.cpp" #endif