STK::Proxy< TYPE > Class Template Reference
[Subproject STKernel::Base]

#include <STK_Proxy.h>

Inherits STK::IProxy.

List of all members.

Public Member Functions

 Proxy (TYPE &x)
Proxyoperator= (const TYPE &x)
virtual ~Proxy ()
Proxyoperator= (const Proxy< TYPE > &x)
Proxyoperator= (const ConstProxy< TYPE > &x)
 operator TYPE & ()
 operator TYPE const & () const

Protected Attributes

TYPE & x_
 A reference on the object wrapped.


Detailed Description

template<class TYPE>
class STK::Proxy< TYPE >

The Proxy classe allow to surdefine operators and methods for every kind of class without using dynamic_cast.

This class allow:

Definition at line 107 of file STK_Proxy.h.


Constructor & Destructor Documentation

template<class TYPE>
STK::Proxy< TYPE >::Proxy ( TYPE &  x  )  [inline]

Default Ctor : create a reference of the Real x.

Parameters:
x the object to wrap

Definition at line 116 of file STK_Proxy.h.

00116                            : x_(x)
00117      { ;}

template<class TYPE>
virtual STK::Proxy< TYPE >::~Proxy (  )  [inline, virtual]

Virtual Dtor.

Definition at line 130 of file STK_Proxy.h.

00130 {}


Member Function Documentation

template<class TYPE>
Proxy& STK::Proxy< TYPE >::operator= ( const TYPE &  x  )  [inline]

overwrite with a TYPE.

Parameters:
x the value to wrapp

Definition at line 122 of file STK_Proxy.h.

References STK::Proxy< TYPE >::x_.

00123      {
00124        x_ = x;
00125        return *this;
00126      }

template<class TYPE>
Proxy& STK::Proxy< TYPE >::operator= ( const Proxy< TYPE > &  x  )  [inline]

overwrite with a Proxy<TYPE>.

Parameters:
x a wrapped value to copy

Definition at line 135 of file STK_Proxy.h.

References STK::Proxy< TYPE >::x_.

00136      {
00137        x_ = x;
00138        return *this;
00139      }

template<class TYPE>
Proxy& STK::Proxy< TYPE >::operator= ( const ConstProxy< TYPE > &  x  )  [inline]

overwrite with a ConstProxy<TYPE>.

Parameters:
x a constant wrapped value to set

Definition at line 144 of file STK_Proxy.h.

References STK::Proxy< TYPE >::x_.

00145      {
00146        x_ = x;
00147        return *this;
00148      }

template<class TYPE>
STK::Proxy< TYPE >::operator TYPE & (  )  [inline]

Conversion operator to TYPE.

Definition at line 152 of file STK_Proxy.h.

References STK::Proxy< TYPE >::x_.

00153      { return x_;}

template<class TYPE>
STK::Proxy< TYPE >::operator TYPE const & (  )  const [inline]

Constant Conversion operator to TYPE.

Definition at line 157 of file STK_Proxy.h.

References STK::Proxy< TYPE >::x_.

00158      { return x_;}


Member Data Documentation

template<class TYPE>
TYPE& STK::Proxy< TYPE >::x_ [protected]


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

Generated on Fri Sep 25 10:31:01 2009 for STK++ by  doxygen 1.5.8