vValue::Expr::Bindings::Legacy::Callback< T > Class Template Reference

Stores a function pointer to a function within another class and offers functions to get that function's return value. More...

#include <vebLegacy.h>

Inheritance diagram for vValue::Expr::Bindings::Legacy::Callback< T >:

Inheritance graph
[legend]
Collaboration diagram for vValue::Expr::Bindings::Legacy::Callback< T >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef boost::shared_ptr
< Base >(T::* 
cb_ptr )(void)
 convinience typedef for a callback that can be used with this class

Public Member Functions

 Callback (cb_ptr value, T *hud)
 Basic constructor.
 Callback (Callback const &other)
 Copy constructor.
void operator= (Callback const &other)
 overloaded assignment operator
Basecopy (void) const
virtual ~Callback ()
virtual Variant GetValue (void) const
 Returns the value in its native format.
virtual int GetInt (void) const
 Returns an integer using the current value.
virtual float GetFloat (void) const
 Returns a float using the current value.
virtual tString GetString (Base const *other=0) const
 Returns a String using the current value using Output().
bool operator== (Base const &other) const
 compares two values
bool operator!= (Base const &other) const
 compares two values
bool operator>= (Base const &other) const
 compares two values
bool operator<= (Base const &other) const
 compares two values
bool operator> (Base const &other) const
 compares two values
bool operator< (Base const &other) const
 compares two values

Private Attributes

cb_ptr m_value
 Pointer to the function.
T * m_cockpit
 Pointer to the object that the function will be called within.


Detailed Description

template<typename T>
class vValue::Expr::Bindings::Legacy::Callback< T >

Stores a function pointer to a function within another class and offers functions to get that function's return value.

Definition at line 44 of file vebLegacy.h.


Member Typedef Documentation

template<typename T>
typedef boost::shared_ptr<Base>(T::* vValue::Expr::Bindings::Legacy::Callback< T >::cb_ptr)(void)

convinience typedef for a callback that can be used with this class


Constructor & Destructor Documentation

template<typename T>
vValue::Expr::Bindings::Legacy::Callback< T >::Callback ( cb_ptr  value,
T *  hud 
) [inline]

Basic constructor.

Initializes the Callback object to a given callback function and object

Parameters:
value the callback to be used
hud the Cockpit to call the callback from

Definition at line 74 of file vebLegacy.h.

Referenced by vValue::Expr::Bindings::Legacy::Callback< T >::copy().

00074                                                               :
00075         Base(),
00076         m_value(value),
00077         m_cockpit(hud)
00078 { }

Here is the caller graph for this function:

template<typename T>
vValue::Expr::Bindings::Legacy::Callback< T >::Callback ( Callback< T > const &  other  )  [inline]

Copy constructor.

Initializes the Callback object using the information from another one

Parameters:
other another Callback object

Definition at line 82 of file vebLegacy.h.

00082                                                                :
00083         Base(other),
00084         m_value(other.m_value),
00085         m_cockpit(other.m_cockpit)
00086 { }

template<typename T>
virtual vValue::Expr::Bindings::Legacy::Callback< T >::~Callback (  )  [inline, virtual]

Definition at line 56 of file vebLegacy.h.

00056 { };


Member Function Documentation

template<typename T>
void vValue::Expr::Bindings::Legacy::Callback< T >::operator= ( Callback< T > const &  other  )  [inline]

overloaded assignment operator

Does nothing different than the default assignment operator, but gets rid of a compiler warning

Parameters:
other the Callback to be copied

Definition at line 96 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00096                                                                       {
00097     this->Base::operator=(other);
00098     m_value=other.m_value;
00099     m_cockpit=other.m_cockpit;
00100 }

template<typename T>
Base * vValue::Expr::Bindings::Legacy::Callback< T >::copy ( void   )  const [inline, virtual]

Overwritten copy function

Returns:
a new copy of the current object

Reimplemented from vValue::Expr::Core::Base.

Definition at line 90 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::Callback().

00090                                                        {
00091     return new Callback(*this);
00092 }

Here is the call graph for this function:

template<typename T>
Variant vValue::Expr::Bindings::Legacy::Callback< T >::GetValue ( void   )  const [inline, virtual]

Returns the value in its native format.

Returns the result of calling the stored callback

Returns:
a variant containing the current value

Reimplemented from vValue::Expr::Core::Base.

Definition at line 104 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00104                                                          {
00105     return (m_cockpit->*m_value)()->GetValue();
00106 }

template<typename T>
int vValue::Expr::Bindings::Legacy::Callback< T >::GetInt ( void   )  const [inline, virtual]

Returns an integer using the current value.

Returns the result of calling the stored callback as an integer

Returns:
an integer containing the current value

Reimplemented from vValue::Expr::Core::Base.

Definition at line 116 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00116                                                        {
00117     return (m_cockpit->*m_value)()->GetInt();
00118 }

template<typename T>
float vValue::Expr::Bindings::Legacy::Callback< T >::GetFloat ( void   )  const [inline, virtual]

Returns a float using the current value.

Returns the result of calling the stored callback as a float

Returns:
a float containing the current value

Reimplemented from vValue::Expr::Core::Base.

Definition at line 122 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00122                                                            {
00123     return (m_cockpit->*m_value)()->GetFloat();
00124 }

template<typename T>
tString vValue::Expr::Bindings::Legacy::Callback< T >::GetString ( Base const *  other = 0  )  const [inline, virtual]

Returns a String using the current value using Output().

Returns the result of calling the stored callback as a string

Returns:
a string containing the current value

Reimplemented from vValue::Expr::Core::Base.

Definition at line 110 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00110                                                                            {
00111     return (m_cockpit->*m_value)()->GetString(other == 0 ? this : other);
00112 }

template<typename T>
bool vValue::Expr::Bindings::Legacy::Callback< T >::operator== ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 126 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00126 { return *(m_cockpit->*m_value)() == other; }

template<typename T>
bool vValue::Expr::Bindings::Legacy::Callback< T >::operator!= ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 127 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00127 { return *(m_cockpit->*m_value)() != other; }

template<typename T>
bool vValue::Expr::Bindings::Legacy::Callback< T >::operator>= ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 128 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00128 { return *(m_cockpit->*m_value)() >= other; }

template<typename T>
bool vValue::Expr::Bindings::Legacy::Callback< T >::operator<= ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 129 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00129 { return *(m_cockpit->*m_value)() <= other; }

template<typename T>
bool vValue::Expr::Bindings::Legacy::Callback< T >::operator> ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 130 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00130 { return *(m_cockpit->*m_value)() >  other; }

template<typename T>
bool vValue::Expr::Bindings::Legacy::Callback< T >::operator< ( Base const &  other  )  const [inline, virtual]

compares two values

Reimplemented from vValue::Expr::Core::Base.

Definition at line 131 of file vebLegacy.h.

References vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit, and vValue::Expr::Bindings::Legacy::Callback< T >::m_value.

00131 { return *(m_cockpit->*m_value)() <  other; }


Member Data Documentation

template<typename T>
cb_ptr vValue::Expr::Bindings::Legacy::Callback< T >::m_value [private]

Pointer to the function.

Definition at line 48 of file vebLegacy.h.

Referenced by vValue::Expr::Bindings::Legacy::Callback< T >::GetFloat(), vValue::Expr::Bindings::Legacy::Callback< T >::GetInt(), vValue::Expr::Bindings::Legacy::Callback< T >::GetString(), vValue::Expr::Bindings::Legacy::Callback< T >::GetValue(), vValue::Expr::Bindings::Legacy::Callback< T >::operator!=(), vValue::Expr::Bindings::Legacy::Callback< T >::operator<(), vValue::Expr::Bindings::Legacy::Callback< T >::operator<=(), vValue::Expr::Bindings::Legacy::Callback< T >::operator=(), vValue::Expr::Bindings::Legacy::Callback< T >::operator==(), vValue::Expr::Bindings::Legacy::Callback< T >::operator>(), and vValue::Expr::Bindings::Legacy::Callback< T >::operator>=().

template<typename T>
T* vValue::Expr::Bindings::Legacy::Callback< T >::m_cockpit [private]

Pointer to the object that the function will be called within.

Definition at line 49 of file vebLegacy.h.

Referenced by vValue::Expr::Bindings::Legacy::Callback< T >::GetFloat(), vValue::Expr::Bindings::Legacy::Callback< T >::GetInt(), vValue::Expr::Bindings::Legacy::Callback< T >::GetString(), vValue::Expr::Bindings::Legacy::Callback< T >::GetValue(), vValue::Expr::Bindings::Legacy::Callback< T >::operator!=(), vValue::Expr::Bindings::Legacy::Callback< T >::operator<(), vValue::Expr::Bindings::Legacy::Callback< T >::operator<=(), vValue::Expr::Bindings::Legacy::Callback< T >::operator=(), vValue::Expr::Bindings::Legacy::Callback< T >::operator==(), vValue::Expr::Bindings::Legacy::Callback< T >::operator>(), and vValue::Expr::Bindings::Legacy::Callback< T >::operator>=().


The documentation for this class was generated from the following file:
Generated on Sun Mar 16 00:05:32 2008 for Armagetron Advanced by  doxygen 1.5.4