OpenCV  2.4.13.7
Open Source Computer Vision
cv::Seq< _Tp > Class Template Reference

#include <core.hpp>

Public Types

typedef SeqIterator< _Tp > iterator
 
typedef SeqIterator< _Tp > const_iterator
 

Public Member Functions

 Seq ()
 the default constructor More...
 
 Seq (const CvSeq *seq)
 the constructor for wrapping CvSeq structure. The real element type in CvSeq should match _Tp. More...
 
 Seq (MemStorage &storage, int headerSize=sizeof(CvSeq))
 creates the empty sequence that resides in the specified storage More...
 
_Tp & operator[] (int idx)
 returns read-write reference to the specified element More...
 
const _Tp & operator[] (int idx) const
 returns read-only reference to the specified element More...
 
SeqIterator< _Tp > begin () const
 returns iterator pointing to the beginning of the sequence More...
 
SeqIterator< _Tp > end () const
 returns iterator pointing to the element following the last sequence element More...
 
size_t size () const
 returns the number of elements in the sequence More...
 
int type () const
 returns the type of sequence elements (CV_8UC1 ... CV_64FC(CV_CN_MAX) ...) More...
 
int depth () const
 returns the depth of sequence elements (CV_8U ... CV_64F) More...
 
int channels () const
 returns the number of channels in each sequence element More...
 
size_t elemSize () const
 returns the size of each sequence element More...
 
size_t index (const _Tp &elem) const
 returns index of the specified sequence element More...
 
void push_back (const _Tp &elem)
 appends the specified element to the end of the sequence More...
 
void push_front (const _Tp &elem)
 appends the specified element to the front of the sequence More...
 
void push_back (const _Tp *elems, size_t count)
 appends zero or more elements to the end of the sequence More...
 
void push_front (const _Tp *elems, size_t count)
 appends zero or more elements to the front of the sequence More...
 
void insert (int idx, const _Tp &elem)
 inserts the specified element to the specified position More...
 
void insert (int idx, const _Tp *elems, size_t count)
 inserts zero or more elements to the specified position More...
 
void remove (int idx)
 removes element at the specified position More...
 
void remove (const Range &r)
 removes the specified subsequence More...
 
_Tp & front ()
 returns reference to the first sequence element More...
 
const _Tp & front () const
 returns read-only reference to the first sequence element More...
 
_Tp & back ()
 returns reference to the last sequence element More...
 
const _Tp & back () const
 returns read-only reference to the last sequence element More...
 
bool empty () const
 returns true iff the sequence contains no elements More...
 
void clear ()
 removes all the elements from the sequence More...
 
void pop_front ()
 removes the first element from the sequence More...
 
void pop_back ()
 removes the last element from the sequence More...
 
void pop_front (_Tp *elems, size_t count)
 removes zero or more elements from the beginning of the sequence More...
 
void pop_back (_Tp *elems, size_t count)
 removes zero or more elements from the end of the sequence More...
 
void copyTo (vector< _Tp > &vec, const Range &range=Range::all()) const
 copies the whole sequence or the sequence slice to the specified vector More...
 
 operator vector< _Tp > () const
 returns the vector containing all the sequence elements More...
 

Public Attributes

CvSeqseq
 

Detailed Description

template<typename _Tp>
class cv::Seq< _Tp >

Template Sequence Class derived from CvSeq

The class provides more convenient access to sequence elements, STL-style operations and iterators.

Note
The class is targeted for simple data types, i.e. no constructors or destructors are called for the sequence elements.

Member Typedef Documentation

§ const_iterator

template<typename _Tp>
typedef SeqIterator<_Tp> cv::Seq< _Tp >::const_iterator

§ iterator

template<typename _Tp>
typedef SeqIterator<_Tp> cv::Seq< _Tp >::iterator

Constructor & Destructor Documentation

§ Seq() [1/3]

template<typename _Tp >
cv::Seq< _Tp >::Seq ( )
inline

the default constructor

§ Seq() [2/3]

template<typename _Tp >
cv::Seq< _Tp >::Seq ( const CvSeq< _Tp > *  seq)
inline

the constructor for wrapping CvSeq structure. The real element type in CvSeq should match _Tp.

§ Seq() [3/3]

template<typename _Tp >
cv::Seq< _Tp >::Seq ( MemStorage storage,
int  headerSize = sizeof(CvSeq< _Tp >) 
)
inline

creates the empty sequence that resides in the specified storage

Member Function Documentation

§ back() [1/2]

template<typename _Tp >
_Tp & cv::Seq< _Tp >::back ( )
inline

returns reference to the last sequence element

§ back() [2/2]

template<typename _Tp >
const _Tp & cv::Seq< _Tp >::back ( ) const
inline

returns read-only reference to the last sequence element

§ begin()

template<typename _Tp >
SeqIterator< _Tp > cv::Seq< _Tp >::begin ( ) const
inline

returns iterator pointing to the beginning of the sequence

§ channels()

template<typename _Tp >
int cv::Seq< _Tp >::channels ( ) const
inline

returns the number of channels in each sequence element

§ clear()

template<typename _Tp >
void cv::Seq< _Tp >::clear ( )
inline

removes all the elements from the sequence

§ copyTo()

template<typename _Tp >
void cv::Seq< _Tp >::copyTo ( vector< _Tp > &  vec,
const Range range = Range::all() 
) const
inline

copies the whole sequence or the sequence slice to the specified vector

§ depth()

template<typename _Tp >
int cv::Seq< _Tp >::depth ( ) const
inline

returns the depth of sequence elements (CV_8U ... CV_64F)

§ elemSize()

template<typename _Tp >
size_t cv::Seq< _Tp >::elemSize ( ) const
inline

returns the size of each sequence element

§ empty()

template<typename _Tp >
bool cv::Seq< _Tp >::empty ( ) const
inline

returns true iff the sequence contains no elements

§ end()

template<typename _Tp >
SeqIterator< _Tp > cv::Seq< _Tp >::end ( ) const
inline

returns iterator pointing to the element following the last sequence element

§ front() [1/2]

template<typename _Tp >
_Tp & cv::Seq< _Tp >::front ( )
inline

returns reference to the first sequence element

§ front() [2/2]

template<typename _Tp >
const _Tp & cv::Seq< _Tp >::front ( ) const
inline

returns read-only reference to the first sequence element

§ index()

template<typename _Tp >
size_t cv::Seq< _Tp >::index ( const _Tp &  elem) const
inline

returns index of the specified sequence element

§ insert() [1/2]

template<typename _Tp >
void cv::Seq< _Tp >::insert ( int  idx,
const _Tp &  elem 
)
inline

inserts the specified element to the specified position

§ insert() [2/2]

template<typename _Tp >
void cv::Seq< _Tp >::insert ( int  idx,
const _Tp *  elems,
size_t  count 
)
inline

inserts zero or more elements to the specified position

§ operator vector< _Tp >()

template<typename _Tp >
cv::Seq< _Tp >::operator vector< _Tp > ( ) const
inline

returns the vector containing all the sequence elements

§ operator[]() [1/2]

template<typename _Tp >
_Tp & cv::Seq< _Tp >::operator[] ( int  idx)
inline

returns read-write reference to the specified element

§ operator[]() [2/2]

template<typename _Tp >
const _Tp & cv::Seq< _Tp >::operator[] ( int  idx) const
inline

returns read-only reference to the specified element

§ pop_back() [1/2]

template<typename _Tp >
void cv::Seq< _Tp >::pop_back ( )
inline

removes the last element from the sequence

§ pop_back() [2/2]

template<typename _Tp >
void cv::Seq< _Tp >::pop_back ( _Tp *  elems,
size_t  count 
)
inline

removes zero or more elements from the end of the sequence

§ pop_front() [1/2]

template<typename _Tp >
void cv::Seq< _Tp >::pop_front ( )
inline

removes the first element from the sequence

§ pop_front() [2/2]

template<typename _Tp >
void cv::Seq< _Tp >::pop_front ( _Tp *  elems,
size_t  count 
)
inline

removes zero or more elements from the beginning of the sequence

§ push_back() [1/2]

template<typename _Tp >
void cv::Seq< _Tp >::push_back ( const _Tp &  elem)
inline

appends the specified element to the end of the sequence

§ push_back() [2/2]

template<typename _Tp >
void cv::Seq< _Tp >::push_back ( const _Tp *  elems,
size_t  count 
)
inline

appends zero or more elements to the end of the sequence

§ push_front() [1/2]

template<typename _Tp >
void cv::Seq< _Tp >::push_front ( const _Tp &  elem)
inline

appends the specified element to the front of the sequence

§ push_front() [2/2]

template<typename _Tp >
void cv::Seq< _Tp >::push_front ( const _Tp *  elems,
size_t  count 
)
inline

appends zero or more elements to the front of the sequence

§ remove() [1/2]

template<typename _Tp >
void cv::Seq< _Tp >::remove ( int  idx)
inline

removes element at the specified position

§ remove() [2/2]

template<typename _Tp >
void cv::Seq< _Tp >::remove ( const Range r)
inline

removes the specified subsequence

§ size()

template<typename _Tp >
size_t cv::Seq< _Tp >::size ( ) const
inline

returns the number of elements in the sequence

§ type()

template<typename _Tp >
int cv::Seq< _Tp >::type ( ) const
inline

returns the type of sequence elements (CV_8UC1 ... CV_64FC(CV_CN_MAX) ...)

Member Data Documentation

§ seq

template<typename _Tp>
CvSeq* cv::Seq< _Tp >::seq

The documentation for this class was generated from the following files: