27 #ifndef CPP_PTHREADS_ATTR_H_
28 #define CPP_PTHREADS_ATTR_H_
35 template<
class Base>
class Attr;
37 template<
class Base,
typename T>
struct Access;
38 template<
class Base,
typename T>
struct Delegate;
46 template<
class Base,
typename T>
61 template<
class Base,
typename T>
89 template<
class Base2,
typename T>
friend class Assignment;
90 template<
class Base2,
typename T>
friend class Access;
91 template<
class Base2,
typename T>
friend class Delegate;
116 return assignment.
set(*
this);
141 return access.get(*
this, value);
166 template<
typename T,
typename U>
169 int return_val = access.get(*
this, tVal);
191 assignment.
set(*
this);
220 access.get(*
this, value);
232 template<
class Base,
typename T>
243 m_attr.get(access, value);
260 template<
typename T,
unsigned int ID>
287 operator const T&()
const {
TypeWrap(const T &data)
initialize the stored data to data
template used to resolve the pthreads_xxx_t object corresponding to the Attr<Base> object ...
T operator[](const Access< Base, T > &access) const
map operator for retrieval, ignores error values returned
Delegate< Base, T > operator[](const Access< Base, T > &access)
map operator, unsafe assignment and retrieval, ignores error values returned
two-way delegate, may assign or retrieve (unsafely) an attribute value of an attribute object ...
Assignment(const T &value)
constructs an assignment object from a value
Attr< Base > & operator<<(const T &value)
stream assignment, unsafe, ignores error values returned
TypeWrap< T, ID > & operator=(const T &data)
assigns the value to data
Provides a unique type that acts like a native type.
int init()
initialize the attribute object
since a template parameter cannot be a friend (until C++-11) this template simply allows us to work a...
AttrType< Base >::type m_data
the wrapped pthreads_XXXattr_t object
Delegate(Attr< Base > &attr)
Attributes object for type Base.
T m_value
storage for the value to be assigned
int set(Attr< Base > &attr) const
sets the attribute value of attr to the value stored in this object
assignment delegate, an object which can assign an attribute value to an attribute object ...
int set(const T &value)
safe assignment of an attribute by value, use only when type is implied
int destroy()
destroy the attribute object
access delegate, an object which can access an attribute value of an attribute object ...