21 #ifndef GRT_OBSERVER_MANAGER_HEADER
22 #define GRT_OBSERVER_MANAGER_HEADER
25 #include "../DataStructures/Vector.h"
33 template <
class NotifyType>
48 for(
size_t i=0; i<rhs.observers.size(); i++){
49 observers.push_back( rhs.observers[i] );
58 const size_t numObservers = observers.size();
59 for(
size_t i=0; i<numObservers; i++){
61 if( ptr == &newObserver ){
67 observers.push_back( &newObserver );
74 const size_t numObservers = observers.size();
75 for(
size_t i=0; i<numObservers; i++){
77 if( ptr == &oldObserver ){
78 observers.erase( observers.begin() + i );
85 bool removeAllObservers(){
90 bool notifyObservers(
const NotifyType &data){
93 const size_t numObservers = observers.size();
94 for(
size_t i=0; i<numObservers; i++){