File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::concepts::CStack< T > Struct Template Reference

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

#include <DGtal/base/CStack.h>

Inheritance 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

  • Value type of element stored in the stack
  • Size type that represents the number of elements

Notation

  • X : A type that is a model of CStack
  • x : object of type X
  • v : object of type Value

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

◆ Size

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

Definition at line 96 of file CStack.h.

◆ Value

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

Definition at line 95 of file CStack.h.

Member Function Documentation

◆ BOOST_CONCEPT_USAGE()

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

Definition at line 98 of file CStack.h.

99 {
101 myX.push( myV );
102 myX.pop();
103
104 // check const methods.
106 }
void sameType(const T &, const T &)
void checkConstConstraints() const
Definition CStack.h:107

References checkConstConstraints(), myV, myX, and DGtal::concepts::ConceptUtils::sameType().

◆ checkConstConstraints()

template<typename T>
void DGtal::concepts::CStack< T >::checkConstConstraints ( ) const
inline

Field Documentation

◆ myB

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

Definition at line 118 of file CStack.h.

Referenced by checkConstConstraints().

◆ myS

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

Definition at line 117 of file CStack.h.

Referenced by checkConstConstraints().

◆ myV

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

Definition at line 116 of file CStack.h.

Referenced by BOOST_CONCEPT_USAGE(), and checkConstConstraints().

◆ myX

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

Definition at line 115 of file CStack.h.

Referenced by BOOST_CONCEPT_USAGE(), and checkConstConstraints().


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