Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 > Class Template Reference

#include <at_unionptr.h>

Inheritance diagram for at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >:

Inheritance graph
[legend]
Collaboration diagram for at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >:

Collaboration graph
[legend]
List of all members.

Public Methods

w_enum_type Get (w_type_0 &o_param_0, w_type_1 &o_param_1, w_type_2 &o_param_2=(*static_cast< UnionPtr_Empty_A * >(0)), w_type_3 &o_param_3=(*static_cast< UnionPtr_Empty_B * >(0))) const
UnionPtr & operator= (const w_type_0 i_value)
UnionPtr & operator= (const w_type_1 i_value)
UnionPtr & operator= (const w_type_2 i_value)
UnionPtr & operator= (const w_type_3 i_value)
bool operator== (const UnionPtr &i_value) const
 UnionPtr ()
 UnionPtr (const w_type_0 i_value)
 UnionPtr (const w_type_1 i_value)
 UnionPtr (const w_type_2 i_value)
 UnionPtr (const w_type_3 i_value)

Public Attributes

t_PtrUnion m_value

Detailed Description

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
class at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >

UnionPtr is simply a class that contains a single value of multiple types. Only 1 value may be stored but that value may have 4 possible types.

As an optimization, UnionPtr uses the unused bits in a pointer to distinguish between the 4 types. This may also be implemented using member variables if this turns out to be a problem on some architectures. Obviously this will not work with structures that allow alignment by byte or allocators that allow allocation on other than multiples of 4.

Parameters:
w_enum_type  contains the enumerator type that describes the types. The enumerator values must be 0..3 that correspond to each possible type.
w_type_0  Is the type corresponding to enumerator with value 0.
w_type_1  Is the type corresponding to enumerator with value 1.
w_type_2  Is the type corresponding to enumerator with value 2.
w_type_3  Is the type corresponding to enumerator with value 3.


Constructor & Destructor Documentation

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::UnionPtr   [inline]
 

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::UnionPtr const w_type_0    i_value [inline]
 

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::UnionPtr const w_type_1    i_value [inline]
 

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::UnionPtr const w_type_2    i_value [inline]
 

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::UnionPtr const w_type_3    i_value [inline]
 


Member Function Documentation

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
w_enum_type at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::Get w_type_0 &    o_param_0,
w_type_1 &    o_param_1,
w_type_2 &    o_param_2 = ( * static_cast< UnionPtr_Empty_A * >( 0 ) ),
w_type_3 &    o_param_3 = ( * static_cast< UnionPtr_Empty_B * >( 0 ) )
const [inline]
 

Will fetch the pointer in question and return the pointer type. This is just one inline to allow for compiler optimization.

Parameters:
o_param_N  are references to values.
Returns:
nothing

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
UnionPtr& at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::operator= const w_type_3    i_value [inline]
 

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
UnionPtr& at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::operator= const w_type_2    i_value [inline]
 

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
UnionPtr& at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::operator= const w_type_1    i_value [inline]
 

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
UnionPtr& at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::operator= const w_type_0    i_value [inline]
 

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
bool at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::operator== const UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 > &    i_value const [inline]
 


Member Data Documentation

template<typename w_enum_type, typename w_type_0, typename w_type_1, typename w_type_2 = UnionPtr_Empty_A, typename w_type_3 = UnionPtr_Empty_B>
t_PtrUnion at::UnionPtr< w_enum_type, w_type_0, w_type_1, w_type_2, w_type_3 >::m_value
 


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

Generated for Austria by doxygen and MakeXS at Sun Oct 24 17:35:34 PDT 2004