UCommon
Public Member Functions | Protected Member Functions
ucommon::sequence< T > Class Template Reference

A template to return a sequence of objects of a specified type. More...

#include <counter.h>

Inherits SeqCounter.

Public Member Functions

T * get (void)
 Return next typed member of the sequence.
 
 operator T& ()
 Return next typed member of the sequence by casted reference.
 
T & operator* ()
 Return next typed member of the sequence by pointer reference.
 
T & operator[] (unsigned offset)
 Return a specific typed member from the sequence list.
 
 sequence (T *array, unsigned size)
 Create a template auto-sequence from a list of typed pointers.
 

Protected Member Functions

T * get (unsigned idx)
 

Detailed Description

template<class T>
class ucommon::sequence< T >

A template to return a sequence of objects of a specified type.

This is used to return a different member in a sequence of objects of a specified type during each reference to the sequencer.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 163 of file counter.h.

Constructor & Destructor Documentation

◆ sequence()

template<class T >
ucommon::sequence< T >::sequence ( T *  array,
unsigned  size 
)
inline

Create a template auto-sequence from a list of typed pointers.

Parameters
arrayof typed values to sequence on reference.
sizeof list of typed values.

Definition at line 176 of file counter.h.

Member Function Documentation

◆ get() [1/2]

template<class T >
T * ucommon::sequence< T >::get ( unsigned  idx)
inlineprotected

Definition at line 166 of file counter.h.

◆ get() [2/2]

template<class T >
T * ucommon::sequence< T >::get ( void  )
inline

Return next typed member of the sequence.

Returns
next typed member of sequence.

Definition at line 183 of file counter.h.

◆ operator T&()

template<class T >
ucommon::sequence< T >::operator T& ( )
inline

Return next typed member of the sequence by casted reference.

Returns
next typed member of sequence.

Definition at line 199 of file counter.h.

◆ operator*()

template<class T >
T & ucommon::sequence< T >::operator* ( )
inline

Return next typed member of the sequence by pointer reference.

Returns
next typed member of sequence.

Definition at line 191 of file counter.h.

◆ operator[]()

template<class T >
T & ucommon::sequence< T >::operator[] ( unsigned  offset)
inline

Return a specific typed member from the sequence list.

Parameters
offsetof member to return.
Returns
typed value at the specified offset.

Definition at line 208 of file counter.h.

Here is the call graph for this function:

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