DGtal  0.9.3beta
Public Types | Public Member Functions | Private Attributes
DGtal::concepts::CStack< T > Struct Template Reference

#include <DGtal/base/CStack.h>

Inheritance diagram for DGtal::concepts::CStack< T >:
[legend]
Collaboration diagram for DGtal::concepts::CStack< T >:
[legend]

Public Types

typedef T::value_type Value
 
typedef T::size_type Size
 

Public Member Functions

 BOOST_CONCEPT_USAGE (CStack)
 
void checkConstConstraints () const
 

Private Attributes

myX
 
Value myV
 
Size myS
 
bool myB
 

Detailed Description

template<typename T>
struct DGtal::concepts::CStack< T >

Aim: This concept gathers classes that provide a stack interface.

Description of concept 'CStack'

Refinement of copy constructible and assignable

Inner types :

Notation

Definitions

Valid expressions and semantics

| Name | Expression | Type requirements | Return type | Precondition | Semantics | Post condition | Complexity | |----—+---------—+----------------—+---------------------—+-----------—+---------------------------------—+-------------—+---------—| | size | x.size() | | Size | | returns the number of elements | | O(1) | | empty | x.empty() | | bool | | 'true' is empty, 'false' otherwise | | O(1) | | top | x.top() | | Value& or const Value& | | returns the top element | | O(1) | | push | x.push(v) | | void | | inserts a new element at the top | | O(1) | | pop | x.pop() | | void | | removes the top element | | O(1) |

Models

std::stack, BackInsertionSequenceToStackAdapter, FrontInsertionSequenceToStackAdapter are the usual models of CStack.

Template Parameters
Tthe type that should be a model of CStack.

Definition at line 91 of file CStack.h.

Member Typedef Documentation

template<typename T >
typedef T::size_type DGtal::concepts::CStack< T >::Size

Definition at line 96 of file CStack.h.

template<typename T >
typedef T::value_type DGtal::concepts::CStack< T >::Value

Definition at line 95 of file CStack.h.

Member Function Documentation

template<typename T >
DGtal::concepts::CStack< T >::BOOST_CONCEPT_USAGE ( CStack< T >  )
inline

Definition at line 98 of file CStack.h.

References DGtal::concepts::CStack< T >::checkConstConstraints(), DGtal::concepts::CStack< T >::myV, DGtal::concepts::CStack< T >::myX, and DGtal::concepts::ConceptUtils::sameType().

99  {
101  myX.push( myV );
102  myX.pop();
103 
104  // check const methods.
106  }
void checkConstConstraints() const
Definition: CStack.h:107
void sameType(const T &t1, const T &t2)
template<typename T >
void DGtal::concepts::CStack< T >::checkConstConstraints ( ) const
inline

Field Documentation

template<typename T >
bool DGtal::concepts::CStack< T >::myB
private

Definition at line 118 of file CStack.h.

Referenced by DGtal::concepts::CStack< T >::checkConstConstraints().

template<typename T >
Size DGtal::concepts::CStack< T >::myS
private

Definition at line 117 of file CStack.h.

Referenced by DGtal::concepts::CStack< T >::checkConstConstraints().

template<typename T >
Value DGtal::concepts::CStack< T >::myV
private
template<typename T >
T DGtal::concepts::CStack< T >::myX
private

The documentation for this struct was generated from the following file: