StuBS
PerCore< T > Class Template Reference

Handy interface for core local variables Example usage: More...

#include <object/percore.h>

Collaboration diagram for PerCore< T >:
[legend]

Classes

struct  cache_aligned
 

Public Member Functions

 PerCore ()
 
 PerCore (const T &val)
 
T & get ()
 
const T & get () const
 
const T & set (const T &value)
 
T * operator-> ()
 
const T * operator-> () const
 
T & operator* ()
 
const T & operator* () const
 
T * operator& ()
 
T & operator* () volatile
 
T & operator= (T &val)
 
operator++ (int)
 
T & operator++ ()
 
operator-- (int)
 
T & operator-- ()
 
bool operator== (const T &val) const
 
bool operator!= (const T &val) const
 
T & operator[] (unsigned index)
 Access the variable of another CPU.
 
T & operator[] (unsigned index) volatile
 
const T & operator[] (unsigned index) const
 

Static Private Member Functions

static int cpuid ()
 

Private Attributes

struct PerCore::cache_aligned instances [SIZE]
 

Static Private Attributes

static const int SIZE = Core::MAX
 

Detailed Description

template<typename T>
class PerCore< T >

Handy interface for core local variables Example usage:

PerCore<int> value(1); // initialized to 1
value++; // value for X is now 2
value.set(42);
Handy interface for core local variables Example usage:
Definition percore.h:21

Class Documentation

◆ PerCore::cache_aligned

struct PerCore::cache_aligned
template<typename T>
struct PerCore< T >::cache_aligned
Class Members
T value

Constructor & Destructor Documentation

◆ PerCore() [1/2]

template<typename T >
PerCore< T >::PerCore ( )
inline

◆ PerCore() [2/2]

template<typename T >
PerCore< T >::PerCore ( const T &  val)
inlineexplicit

Member Function Documentation

◆ cpuid()

template<typename T >
static int PerCore< T >::cpuid ( )
inlinestaticprivate

◆ get() [1/2]

template<typename T >
T & PerCore< T >::get ( )
inline

◆ get() [2/2]

template<typename T >
const T & PerCore< T >::get ( ) const
inline

◆ set()

template<typename T >
const T & PerCore< T >::set ( const T &  value)
inline

◆ operator->() [1/2]

template<typename T >
T * PerCore< T >::operator-> ( )
inline

◆ operator->() [2/2]

template<typename T >
const T * PerCore< T >::operator-> ( ) const
inline

◆ operator*() [1/3]

template<typename T >
T & PerCore< T >::operator* ( )
inline

◆ operator*() [2/3]

template<typename T >
const T & PerCore< T >::operator* ( ) const
inline

◆ operator&()

template<typename T >
T * PerCore< T >::operator& ( )
inline

◆ operator*() [3/3]

template<typename T >
T & PerCore< T >::operator* ( ) volatile
inline

◆ operator=()

template<typename T >
T & PerCore< T >::operator= ( T &  val)
inline

◆ operator++() [1/2]

template<typename T >
T PerCore< T >::operator++ ( int  )
inline

◆ operator++() [2/2]

template<typename T >
T & PerCore< T >::operator++ ( )
inline

◆ operator--() [1/2]

template<typename T >
T PerCore< T >::operator-- ( int  )
inline

◆ operator--() [2/2]

template<typename T >
T & PerCore< T >::operator-- ( )
inline

◆ operator==()

template<typename T >
bool PerCore< T >::operator== ( const T &  val) const
inline

◆ operator!=()

template<typename T >
bool PerCore< T >::operator!= ( const T &  val) const
inline

◆ operator[]() [1/3]

template<typename T >
T & PerCore< T >::operator[] ( unsigned  index)
inline

Access the variable of another CPU.

◆ operator[]() [2/3]

template<typename T >
T & PerCore< T >::operator[] ( unsigned  index) volatile
inline

◆ operator[]() [3/3]

template<typename T >
const T & PerCore< T >::operator[] ( unsigned  index) const
inline

Member Data Documentation

◆ SIZE

template<typename T >
const int PerCore< T >::SIZE = Core::MAX
staticprivate

◆ instances

template<typename T >
struct PerCore::cache_aligned PerCore< T >::instances[SIZE]
private

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