Sirikata
|
This class gives listeners an interface to register themselves and a mechanism to notify listeners Users of this class should remember to notify new listeners. More...
#include <ListenerProvider.hpp>
Public Member Functions | |
virtual void | addListener (ListenerPtr p) |
This function adds a new listener to listen for notification This may be called during a notify call, but new functions will not be called until the next notification. | |
virtual void | removeListener (ListenerPtr p) |
This function removes a listener from listening for notification This may be called during a notify call on the currently notified listener only. | |
Protected Types | |
typedef std::vector< ListenerPtr > | ListenerVector |
typedef std::map< ListenerPtr, uint32 > | ListenerMap |
Protected Member Functions | |
virtual | ~Provider () |
virtual void | listenerAdded (ListenerPtr) |
This function is called with a new listener just after every listener is added to the callbacks (Override for interesting behavior, such as feeding the initial values to it) | |
virtual void | listenerRemoved (ListenerPtr) |
This function is called with the dated listener just before that listener is removed from the callbacks (Override for interesting behavior) | |
virtual void | firstListenerAdded (ListenerPtr) |
This function is called with a new listener when the first listener signs up (Override to propogate network requests for example) | |
virtual void | lastListenerRemoved (ListenerPtr) |
This function is called with the defunct listener just before the last listener is removed frmo the callbacks. Override for interesting behavior. | |
template<typename T > | |
void | notify (T func) |
This function notifies all listeners. | |
template<typename T , typename A > | |
void | notify (T func, A newA) |
This function notifies all listeners. | |
template<typename T , typename A , typename B > | |
void | notify (T func, A newA, B newB) |
This function notifies all listeners. | |
template<typename T , typename A , typename B , typename C > | |
void | notify (T func, A newA, B newB, C newC) |
This function notifies all listeners. | |
template<typename T , typename A , typename B , typename C , typename D > | |
void | notify (T func, A newA, B newB, C newC, D newD) |
This function notifies all listeners. | |
template<typename T , typename A , typename B , typename C , typename D , typename E > | |
void | notify (T func, A newA, B newB, C newC, D newD, E newE) |
This function notifies all listeners. | |
template<typename T , typename A , typename B , typename C , typename D , typename E , typename F > | |
void | notify (T func, A newA, B newB, C newC, D newD, E newE, F newF) |
This function notifies all listeners. | |
template<typename T , typename A , typename B , typename C , typename D , typename E , typename F , typename G > | |
void | notify (T func, A newA, B newB, C newC, D newD, E newE, F newF, G newG) |
This function notifies all listeners. | |
template<typename T , typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H > | |
void | notify (T func, A newA, B newB, C newC, D newD, E newE, F newF, G newG, H newH) |
This function notifies all listeners. | |
template<typename T , typename A , typename B , typename C , typename D , typename E , typename F , typename G , typename H , typename I > | |
void | notify (T func, A newA, B newB, C newC, D newD, E newE, F newF, G newG, H newH, I newI) |
This function notifies all listeners. | |
Protected Attributes | |
ListenerVector | mListeners |
A list of listeners interested in updates from this class. | |
ListenerMap | mListenerIndex |
A map from listener pointers to indexes in the listeners vector. |
This class gives listeners an interface to register themselves and a mechanism to notify listeners Users of this class should remember to notify new listeners.
typedef std::map<ListenerPtr,uint32> Sirikata::Provider< ListenerPtr >::ListenerMap [protected] |
typedef std::vector<ListenerPtr> Sirikata::Provider< ListenerPtr >::ListenerVector [protected] |
virtual Sirikata::Provider< ListenerPtr >::~Provider | ( | ) | [inline, protected, virtual] |
virtual void Sirikata::Provider< ListenerPtr >::addListener | ( | ListenerPtr | p | ) | [inline, virtual] |
This function adds a new listener to listen for notification This may be called during a notify call, but new functions will not be called until the next notification.
Referenced by Sirikata::ObjectHost::addServerIDMap(), Sirikata::Command::HttpCommander::HttpCommander(), Sirikata::Graphics::OgreSystem::initialize(), Sirikata::LocationService::LocationService(), Sirikata::Graphics::OgreSystemInputHandler::OgreSystemInputHandler(), Sirikata::Proximity::Proximity(), and Sirikata::Environment::start().
virtual void Sirikata::Provider< ListenerPtr >::firstListenerAdded | ( | ListenerPtr | ) | [inline, protected, virtual] |
This function is called with a new listener when the first listener signs up (Override to propogate network requests for example)
Referenced by Sirikata::Provider< EntityListener * >::addListener().
virtual void Sirikata::Provider< ListenerPtr >::lastListenerRemoved | ( | ListenerPtr | ) | [inline, protected, virtual] |
This function is called with the defunct listener just before the last listener is removed frmo the callbacks. Override for interesting behavior.
Referenced by Sirikata::Provider< EntityListener * >::removeListener().
virtual void Sirikata::Provider< ListenerPtr >::listenerAdded | ( | ListenerPtr | ) | [inline, protected, virtual] |
This function is called with a new listener just after every listener is added to the callbacks (Override for interesting behavior, such as feeding the initial values to it)
Referenced by Sirikata::Provider< EntityListener * >::addListener().
virtual void Sirikata::Provider< ListenerPtr >::listenerRemoved | ( | ListenerPtr | ) | [inline, protected, virtual] |
This function is called with the dated listener just before that listener is removed from the callbacks (Override for interesting behavior)
Referenced by Sirikata::Provider< EntityListener * >::removeListener().
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA, | ||
B | newB, | ||
C | newC, | ||
D | newD, | ||
E | newE, | ||
F | newF, | ||
G | newG, | ||
H | newH | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the first argument passed to func |
newB | is the second argument passed to func |
newC | is the third argument passed to func |
newD | is the fourth argument passed to func |
newE | is the fifth argument passed to func |
newF | is the sixth argument passed to func |
newG | is the seventh argument passed to func |
newH | is the eighth argument passed to func |
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA, | ||
B | newB, | ||
C | newC, | ||
D | newD, | ||
E | newE, | ||
F | newF | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the first argument passed to func |
newB | is the second argument passed to func |
newC | is the third argument passed to func |
newD | is the fourth argument passed to func |
newE | is the fifth argument passed to func |
newF | is the sixth argument passed to func |
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA, | ||
B | newB, | ||
C | newC, | ||
D | newD, | ||
E | newE | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the first argument passed to func |
newB | is the second argument passed to func |
newC | is the third argument passed to func |
newD | is the fourth argument passed to func |
newE | is the fifth argument passed to func |
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA, | ||
B | newB, | ||
C | newC, | ||
D | newD | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the first argument passed to func |
newB | is the second argument passed to func |
newC | is the third argument passed to func |
newD | is the fourth argument passed to func |
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA, | ||
B | newB | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the first argument passed to func |
newB | is the second argument passed to func |
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA, | ||
B | newB, | ||
C | newC, | ||
D | newD, | ||
E | newE, | ||
F | newF, | ||
G | newG, | ||
H | newH, | ||
I | newI | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the first argument passed to func |
newB | is the second argument passed to func |
newC | is the third argument passed to func |
newD | is the fourth argument passed to func |
newE | is the fifth argument passed to func |
newF | is the sixth argument passed to func |
newG | is the seventh argument passed to func |
newH | is the eighth argument passed to func |
newI | is the eighth argument passed to func |
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA, | ||
B | newB, | ||
C | newC, | ||
D | newD, | ||
E | newE, | ||
F | newF, | ||
G | newG | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the first argument passed to func |
newB | is the second argument passed to func |
newC | is the third argument passed to func |
newD | is the fourth argument passed to func |
newE | is the fifth argument passed to func |
newF | is the sixth argument passed to func |
newG | is the seventh argument passed to func |
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func | ) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
Referenced by Sirikata::ProxyObject::destroy(), Sirikata::SpaceNodeSessionManager::fireSpaceNodeSession(), Sirikata::SpaceNodeSessionManager::fireSpaceNodeSessionEnded(), Sirikata::ObjectHost::handleObjectConnected(), Sirikata::ObjectHost::handleObjectDisconnected(), Sirikata::ObjectHost::handleObjectMigrated(), Sirikata::ProxyObject::invalidate(), Sirikata::ProxyObject::setBounds(), Sirikata::ProxyObject::setIsAggregate(), Sirikata::ProxyObject::setLocation(), Sirikata::ProxyObject::setMesh(), Sirikata::ProxyObject::setOrientation(), Sirikata::ProxyObject::setPhysics(), and Sirikata::ProxyObject::validate().
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA, | ||
B | newB, | ||
C | newC | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the first argument passed to func |
newB | is the second argument passed to func |
newC | is the third argument passed to func |
void Sirikata::Provider< ListenerPtr >::notify | ( | T | func, |
A | newA | ||
) | [inline, protected] |
This function notifies all listeners.
Listeners may add other listeners or remove themselves, though undefined behavior results from removing other listeners during the call.
func | which must be a member function of ListenerPtr gets called on all listeners |
newA | is the singular argument passed to func |
virtual void Sirikata::Provider< ListenerPtr >::removeListener | ( | ListenerPtr | p | ) | [inline, virtual] |
This function removes a listener from listening for notification This may be called during a notify call on the currently notified listener only.
Referenced by Sirikata::Graphics::OgreSystem::stop(), Sirikata::Environment::stop(), Sirikata::Command::HttpCommander::~HttpCommander(), Sirikata::LocationService::~LocationService(), Sirikata::Graphics::OgreSystemInputHandler::~OgreSystemInputHandler(), and Sirikata::Proximity::~Proximity().
ListenerMap Sirikata::Provider< ListenerPtr >::mListenerIndex [protected] |
A map from listener pointers to indexes in the listeners vector.
Referenced by Sirikata::Provider< EntityListener * >::addListener(), and Sirikata::Provider< EntityListener * >::removeListener().
ListenerVector Sirikata::Provider< ListenerPtr >::mListeners [protected] |
A list of listeners interested in updates from this class.
Referenced by Sirikata::Provider< EntityListener * >::addListener(), Sirikata::Provider< EntityListener * >::notify(), and Sirikata::Provider< EntityListener * >::removeListener().