CppDelegate::Internal::DelegateMemento Class Reference

#include <Delegate.h>

Inherited by CppDelegate::Internal::ClosurePtr< GenericMemFunc, StaticFuncPtr, UnvoidStaticFuncPtr >.

List of all members.

Public Member Functions

 DelegateMemento ()
void Clear ()
bool IsEqual (const DelegateMemento &x) const
bool IsLess (const DelegateMemento &right) const
bool operator! () const
bool Empty () const
DelegateMementooperator= (const DelegateMemento &right)
bool operator< (const DelegateMemento &right)
bool operator> (const DelegateMemento &right)
 DelegateMemento (const DelegateMemento &right)

Protected Types

typedef void(Internal::GenericClass::*) GenericMemFuncType ()

Protected Member Functions

void SetMementoFrom (const DelegateMemento &right)

Protected Attributes

Internal::GenericClass * m_pthis
GenericMemFuncType m_pFunction


Detailed Description

Definition at line 431 of file Delegate.h.


Member Typedef Documentation

typedef void(Internal::GenericClass::*) CppDelegate::Internal::DelegateMemento::GenericMemFuncType() [protected]

Definition at line 435 of file Delegate.h.


Constructor & Destructor Documentation

CppDelegate::Internal::DelegateMemento::DelegateMemento (  )  [inline]

Definition at line 451 of file Delegate.h.

00451 : m_pthis(0), m_pFunction(0) {};

CppDelegate::Internal::DelegateMemento::DelegateMemento ( const DelegateMemento right  )  [inline]

Definition at line 501 of file Delegate.h.

00501                                                         : 
00502                 m_pthis(right.m_pthis), m_pFunction(right.m_pFunction)
00503 #if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
00504                 , m_pStaticFunction (right.m_pStaticFunction)
00505 #endif
00506                 {}


Member Function Documentation

void CppDelegate::Internal::DelegateMemento::Clear (  )  [inline]

Definition at line 452 of file Delegate.h.

00452 {       m_pthis=0; m_pFunction=0;       }

bool CppDelegate::Internal::DelegateMemento::IsEqual ( const DelegateMemento x  )  const [inline]

Definition at line 465 of file Delegate.h.

00465                                                             {
00466                 return m_pthis==x.m_pthis && m_pFunction==x.m_pFunction;
00467         }

bool CppDelegate::Internal::DelegateMemento::IsLess ( const DelegateMemento right  )  const [inline]

Definition at line 470 of file Delegate.h.

00470                                                                {
00471                 // deal with static function pointers first
00472 #if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
00473                 if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0) 
00474                                 return m_pStaticFunction < right.m_pStaticFunction;
00475 #endif
00476                 if (m_pthis !=right.m_pthis) return m_pthis < right.m_pthis;
00477         // There are no ordering operators for member function pointers, 
00478         // but we can fake one by comparing each byte. The resulting ordering is
00479         // arbitrary (and compiler-dependent), but it permits storage in ordered STL containers.
00480                 return memcmp(&m_pFunction, &right.m_pFunction, sizeof(m_pFunction)) < 0;
00481 
00482         }

bool CppDelegate::Internal::DelegateMemento::operator! (  )  const [inline]

Definition at line 486 of file Delegate.h.

00487         { return m_pthis==0 && m_pFunction==0; }

bool CppDelegate::Internal::DelegateMemento::Empty (  )  const [inline]

Definition at line 488 of file Delegate.h.

00489         { return m_pthis==0 && m_pFunction==0; }

DelegateMemento& CppDelegate::Internal::DelegateMemento::operator= ( const DelegateMemento right  )  [inline]

Definition at line 491 of file Delegate.h.

00491                                                                      {
00492                 SetMementoFrom(right); 
00493                 return *this;
00494         }

bool CppDelegate::Internal::DelegateMemento::operator< ( const DelegateMemento right  )  [inline]

Definition at line 495 of file Delegate.h.

00495                                                              {
00496                 return IsLess(right);
00497         }

bool CppDelegate::Internal::DelegateMemento::operator> ( const DelegateMemento right  )  [inline]

Definition at line 498 of file Delegate.h.

00498                                                              {
00499                 return right.IsLess(*this);
00500         }

void CppDelegate::Internal::DelegateMemento::SetMementoFrom ( const DelegateMemento right  )  [inline, protected]

Definition at line 508 of file Delegate.h.

00508                                                            {
00509                 m_pFunction = right.m_pFunction;
00510                 m_pthis = right.m_pthis;
00511 #if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
00512                 m_pStaticFunction = right.m_pStaticFunction;
00513 #endif
00514         }


Member Data Documentation

Internal::GenericClass* CppDelegate::Internal::DelegateMemento::m_pthis [protected]

Definition at line 436 of file Delegate.h.

GenericMemFuncType CppDelegate::Internal::DelegateMemento::m_pFunction [protected]

Definition at line 437 of file Delegate.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 15 23:41:51 2007 for AVR C++ Lib (common) by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi