DGtal
1.5.beta
|
Aim: This class implements a dynamic adapter to an instance of a model of front insertion sequence in order to get a stack interface. This class is a model of CStack. More...
#include <DGtal/base/FrontInsertionSequenceToStackAdapter.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::FrontInsertionSequence< Container >)) | |
FrontInsertionSequenceToStackAdapter (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 front insertion sequence in order to get a stack interface. This class is a model of CStack.
TSequence | a model of boost::FrontInsertionSequence |
Definition at line 62 of file FrontInsertionSequenceToStackAdapter.h.
typedef TSequence DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::Container |
Type of the underlying container
Definition at line 71 of file FrontInsertionSequenceToStackAdapter.h.
typedef Container::size_type DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::Size |
Type used to represent the size of the container
Definition at line 91 of file FrontInsertionSequenceToStackAdapter.h.
typedef Container::size_type DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::size_type |
STL-like type used to represent the size of the container
Definition at line 87 of file FrontInsertionSequenceToStackAdapter.h.
typedef Container::value_type DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::Value |
Type of elements
Definition at line 82 of file FrontInsertionSequenceToStackAdapter.h.
typedef Container::value_type DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::value_type |
STL-like type of elements
Definition at line 78 of file FrontInsertionSequenceToStackAdapter.h.
DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::FrontInsertionSequenceToStackAdapter | ( | Alias< Container > | aContainer | ) |
Constructor.
aContainer | a container to adapt |
DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::BOOST_CONCEPT_ASSERT | ( | (boost::FrontInsertionSequence< Container >) | ) |
bool DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::empty | ( | ) | const |
Tests whether the container is empty or not.
bool DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
void DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::pop | ( | ) |
Removes the element on top of the stack. This method calls method pop_front of the underlying container.
void DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::push | ( | const Value & | aValue | ) |
Inserts an element above the current top element. This method calls method push_front of the underlying container.
aValue | any value |
void DGtal::FrontInsertionSequenceToStackAdapter< 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::FrontInsertionSequenceToStackAdapter< TSequence >::size | ( | ) | const |
Returns the size of the container.
Value& DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::top | ( | ) |
Access to the top element, ie. the element available at the front of the underlying container. This method indeed calls method front of the underlying container.
const Value& DGtal::FrontInsertionSequenceToStackAdapter< TSequence >::top | ( | ) | const |
Access to the top element, ie. the element available at the front of the underlying container. This method indeed calls method front of the underlying container.
|
private |
Pointer to the underlying container
Definition at line 167 of file FrontInsertionSequenceToStackAdapter.h.