OSB_LIB::CallBack Class Reference

List of all members.

Detailed Description

Abstract base for call back objects.

Definition at line 59 of file callback.h.

Public Types

Public Member Functions

Protected Member Functions

Private Member Functions


Member Typedef Documentation

typedef std::auto_ptr<CallBack> OSB_LIB::CallBack::AutoPtr

Short-hand for an auto pointer.

For details see quality manual, implementation patterns: Virtual copy construction.

Definition at line 67 of file callback.h.


Constructor & Destructor Documentation

OSB_LIB::CallBack::CallBack (  )  [inline]

Empty default constructor.

Definition at line 136 of file callback.h.

OSB_LIB::CallBack::~CallBack (  )  [inline, virtual]

Empty virtual destructor.

Definition at line 140 of file callback.h.

OSB_LIB::CallBack::CallBack ( const CallBack rhs  )  [inline, protected]

Copying for derived classes only.

Definition at line 149 of file callback.h.


Member Function Documentation

CallBack::AutoPtr OSB_LIB::CallBack::clone (  )  const [inline]

Virtual copy construction.

For details see quality manual, implementation patterns.

Definition at line 144 of file callback.h.

References cloneP().

virtual CallBack* OSB_LIB::CallBack::cloneP (  )  const [private, pure virtual]

Virtual copy construction.

For details see quality manual, implementation patterns.

Referenced by clone().

template<typename T>
const T * OSB_LIB::CallBack::isa ( const T *&  ptr  )  const

Downcasting: see isa(T*&).

Definition at line 166 of file callback.h.

template<typename T>
T * OSB_LIB::CallBack::isa ( T *&  ptr  ) 

Downcast to a derived class.

The function uses dynamic_cast<P*> to downcast to an object of a derived class.

          ptr = dynamic_cast<P*>(this);
          return ptr;

The typical use is:

          void foo(const CallBack& cb)
          {
              ...
              MyCallBack* pCb = 0;
              if (0 != cb.isa(pCb)) {
                  // work with pCb
              }
          }

Parameters:
ptr Pointer to cast, gets the result of the downcast.
Returns:
The argument pointer `ptr' after the downcast,
its value is 0 if the cast fails.

Definition at line 159 of file callback.h.

virtual void OSB_LIB::CallBack::operator() (  )  const [pure virtual]

Execute the call back.

Note:
The function is const until we know better:
The callback class itself should not be modified.

CallBack & OSB_LIB::CallBack::operator= ( const CallBack rhs  )  [inline, protected]

Assignment or derived classes only.

Definition at line 153 of file callback.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:10:52 2006 for OSB Library by  doxygen 1.4.7