Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Private Attributes
CallbackManager Class Reference

#include <callback_manager.hpp>

Collaboration diagram for CallbackManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CallbackManager ()
 ~CallbackManager ()
void update (float dt) const
void initAll () const
void reset () const
void clear (CallbackType cbType)
void addCallback (Callback *c, CallbackType t)
void handleExplosion (const btVector3 &pos, const MovingPhysics *mo) const

Private Attributes

std::vector< Callback * > m_allCallbacks [CB_MAX]

Detailed Description

Definition at line 36 of file callback_manager.hpp.


Constructor & Destructor Documentation

Definition at line 25 of file callback_manager.cpp.

{
    for(int i=0; i<CB_MAX; i++)
    {
        m_allCallbacks[i].clear();
    }
}   // CallbackManager

Definition at line 34 of file callback_manager.cpp.

{
    for(int i=0; i<CB_MAX; i++)
    {
        for(std::vector<Callback*>::const_iterator c = m_allCallbacks[i].begin();
            c != m_allCallbacks[i].end(); c++)
        {
            MovingPhysics *mp = dynamic_cast<MovingPhysics*>(*c);
            if(mp)
            {
                ssgDeRefDelete(mp);
            }
            else
            {
                delete *c;
            }
            m_allCallbacks[i].clear();
        }   // for c in m_allCallbacks[i]
    }   // for i <CB_MAX
}   // ~CallbackManager

Member Function Documentation

Definition at line 56 of file callback_manager.cpp.

{
    m_allCallbacks[t].push_back(c);
        MovingPhysics *mp = dynamic_cast<MovingPhysics*>(c);
        if(mp)
        {
            mp->ref();
        }
}   // addCallback

Here is the caller graph for this function:

Definition at line 69 of file callback_manager.cpp.

{
    for(std::vector<Callback*>::const_iterator c = m_allCallbacks[cbType].begin();
        c != m_allCallbacks[cbType].end(); c++)
    {
        MovingPhysics *mp = dynamic_cast<MovingPhysics*>(*c);
        if(mp)
        {
            ssgDeRefDelete(mp);
        }
        else
        {
            delete *c;
        }
    }

    m_allCallbacks[cbType].clear();
}  // clear

Here is the caller graph for this function:

void CallbackManager::handleExplosion ( const btVector3 pos,
const MovingPhysics mo 
) const

Definition at line 125 of file callback_manager.cpp.

{
    for(int i=0; i<CB_MAX; i++)
    {
        for(std::vector<Callback*>::const_iterator c = m_allCallbacks[i].begin();
            c != m_allCallbacks[i].end(); c++)
            (*c)->handleExplosion(pos, mp==(*c));
    }   // for i

}   // handleExplosion

Here is the caller graph for this function:

void CallbackManager::initAll ( ) const

Definition at line 100 of file callback_manager.cpp.

{
    for(int i=0; i<CB_MAX; i++)
    {
        for(std::vector<Callback*>::const_iterator c = m_allCallbacks[i].begin();
            c != m_allCallbacks[i].end(); c++)
            (*c)->init();
    }   // for i

}   // initAll

Here is the caller graph for this function:

void CallbackManager::reset ( ) const

Definition at line 113 of file callback_manager.cpp.

{
    for(int i=0; i<CB_MAX; i++)
    {
        for(std::vector<Callback*>::const_iterator c = m_allCallbacks[i].begin();
            c != m_allCallbacks[i].end(); c++)
            (*c)->reset();
    }   // for i

}   // initAll

Here is the caller graph for this function:

void CallbackManager::update ( float  dt) const

Definition at line 89 of file callback_manager.cpp.

{
    for(int i=0; i<CB_MAX; i++)
    {
        for(std::vector<Callback*>::const_iterator c = m_allCallbacks[i].begin();
            c != m_allCallbacks[i].end(); c++)
            (*c)->update(dt);
    }   // for i

}   // update

Here is the caller graph for this function:


Member Data Documentation

Definition at line 38 of file callback_manager.hpp.


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