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>

Inheritance diagram for ucommon::sequence< T >:
Inheritance graph
[legend]
Collaboration diagram for ucommon::sequence< T >:
Collaboration graph
[legend]

Public Member Functions

T * get (void)
 Return next typed member of the sequence. More...
 
T & operator * ()
 Return next typed member of the sequence by pointer reference. More...
 
 operator T & ()
 Return next typed member of the sequence by casted reference. More...
 
T & operator[] (unsigned offset)
 Return a specific typed member from the sequence list. More...
 
 sequence (T *array, unsigned size)
 Create a template auto-sequence from a list of typed pointers. More...
 
- Public Member Functions inherited from ucommon::SeqCounter
void operator= (unsigned inc_offset)
 Used to directly assign sequence position in template. More...
 

Protected Member Functions

T * get (unsigned idx)
 
- Protected Member Functions inherited from ucommon::SeqCounter
void * get (void)
 
void * get (unsigned idx)
 
 SeqCounter (void *start, size_t size, unsigned count)
 
- Protected Member Functions inherited from ucommon::counter
 counter ()
 Initialize integer counter of unknown size.
 
 counter (unsigned limit)
 Initialize integer counter for a range of values. More...
 
unsigned get (void)
 Get the next counter value. More...
 
unsigned operator * ()
 Reference next counter value through pointer operation. More...
 
 operator unsigned ()
 Reference next counter value by casting to integer. More...
 
void operator= (unsigned value)
 Assign the value of the counter. More...
 
unsigned range (void)
 Get the range of values before recycling. More...
 

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()

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 *()

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 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[] ( 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: