DGtal 1.4.0
|
Aim: This class implements a dynamic adapter to an instance of a model of back insertion sequence in order to get a stack interface. This class is a model of CStack. More...
#include <DGtal/base/BackInsertionSequenceToStackAdapter.h>
Public Types | |
typedef TSequence | Container |
typedef Container::value_type | value_type |
typedef Container::value_type | Value |
typedef Container::size_type | size_type |
typedef Container::size_type | Size |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((boost::BackInsertionSequence< Container >)) | |
BackInsertionSequenceToStackAdapter (Alias< Container > aContainer) | |
Size | size () const |
bool | empty () const |
Value & | top () |
const Value & | top () const |
void | push (const Value &aValue) |
void | pop () |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Attributes | |
Container * | myContainerPtr |
Aim: This class implements a dynamic adapter to an instance of a model of back insertion sequence in order to get a stack interface. This class is a model of CStack.
TSequence | a model of boost::BackInsertionSequence |
Definition at line 62 of file BackInsertionSequenceToStackAdapter.h.
typedef TSequence DGtal::BackInsertionSequenceToStackAdapter< TSequence >::Container |
Type of the underlying container
Definition at line 71 of file BackInsertionSequenceToStackAdapter.h.
typedef Container::size_type DGtal::BackInsertionSequenceToStackAdapter< TSequence >::Size |
Type used to represent the size of the container
Definition at line 90 of file BackInsertionSequenceToStackAdapter.h.
typedef Container::size_type DGtal::BackInsertionSequenceToStackAdapter< TSequence >::size_type |
STL-like type used to represent the size of the container
Definition at line 86 of file BackInsertionSequenceToStackAdapter.h.
typedef Container::value_type DGtal::BackInsertionSequenceToStackAdapter< TSequence >::Value |
Type of elements
Definition at line 81 of file BackInsertionSequenceToStackAdapter.h.
typedef Container::value_type DGtal::BackInsertionSequenceToStackAdapter< TSequence >::value_type |
STL-like type of elements
Definition at line 77 of file BackInsertionSequenceToStackAdapter.h.
DGtal::BackInsertionSequenceToStackAdapter< TSequence >::BackInsertionSequenceToStackAdapter | ( | Alias< Container > | aContainer | ) |
Constructor.
aContainer | a container to adapt |
DGtal::BackInsertionSequenceToStackAdapter< TSequence >::BOOST_CONCEPT_ASSERT | ( | (boost::BackInsertionSequence< Container >) | ) |
bool DGtal::BackInsertionSequenceToStackAdapter< TSequence >::empty | ( | ) | const |
Tests whether the container is empty or not.
bool DGtal::BackInsertionSequenceToStackAdapter< TSequence >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
void DGtal::BackInsertionSequenceToStackAdapter< TSequence >::pop | ( | ) |
Removes the element on top of the stack. This method calls method pop_back of the underlying container.
void DGtal::BackInsertionSequenceToStackAdapter< TSequence >::push | ( | const Value & | aValue | ) |
Inserts an element above the current top element. This method calls method push_back of the underlying container.
aValue | any value |
void DGtal::BackInsertionSequenceToStackAdapter< TSequence >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Size DGtal::BackInsertionSequenceToStackAdapter< TSequence >::size | ( | ) | const |
Returns the size of the container.
Value & DGtal::BackInsertionSequenceToStackAdapter< TSequence >::top | ( | ) |
Access to the top element, ie. the element available at the back of the underlying container. This method indeed calls method back of the underlying container.
const Value & DGtal::BackInsertionSequenceToStackAdapter< TSequence >::top | ( | ) | const |
Access to the top element, ie. the element available at the back of the underlying container. This method indeed calls method back of the underlying container.
|
private |
Pointer to the underlying container
Definition at line 166 of file BackInsertionSequenceToStackAdapter.h.