27 #ifndef _UCOMMON_COUNTER_H_ 28 #define _UCOMMON_COUNTER_H_ 30 #ifndef _UCOMMON_CONFIG_H_ 46 unsigned value, cycle;
78 inline unsigned operator*() {
86 inline operator unsigned() {
94 void operator=(
unsigned value);
111 SeqCounter(
void *start,
size_t size,
unsigned count);
115 void *get(
unsigned idx);
143 inline bool operator*() {
147 inline void operator=(
bool v) {
151 inline operator bool() {
166 inline T *
get(
unsigned idx) {
167 return static_cast<T *>(SeqCounter::get(idx));
184 return static_cast<T *>(SeqCounter::get());
192 return reference_cast<T&>(SeqCounter::get());
199 inline operator T&() {
200 return reference_cast<T&>(SeqCounter::get());
209 return reference_cast<T&>(
get(offset));
Automatically return a sequence of untyped objects.
A template to return a sequence of objects of a specified type.
counter counter_t
A convenience typecast for integer counters.
void operator=(unsigned inc_offset)
Used to directly assign sequence position in template.
T &() limit(T &value, T &low, T &high)
Convenience macro to range restrict values.
T & operator *()
Return next typed member of the sequence by pointer reference.
Various miscellaneous platform specific headers and defines.
Common namespace for all ucommon objects.
toggle toggle_t
A convenience typecast for auto-toggled bools.
Automatic integer counting class.
T & operator[](unsigned offset)
Return a specific typed member from the sequence list.
T * get(void)
Return next typed member of the sequence.
Automatically toggle a bool on each reference.
sequence(T *array, unsigned size)
Create a template auto-sequence from a list of typed pointers.
unsigned range(void)
Get the range of values before recycling.
void operator=(unsigned value)
Assign the value of the counter.