Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 31, 2008, 3:31:21 AM (16 years ago)
Author:
landauf
Message:
  • added EventListener: this class fires an event if another class with a specified name fires
  • added EventDispatcher: this class dispatches events to several other classes (EventTarget) if it gets an event itself
  • added EventTarget: used in EventDispatcher to access all classes with a specified name
  • added XMLNameListener: this listener gets called every time a new class was loaded through XML with a name != "". used to find classes with a given name even if they're not existing at the moment.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/core/BaseObject.h

    r2065 r2074  
    115115            void fireEvent();
    116116            void fireEvent(bool activate);
     117            void fireEvent(bool activate, BaseObject* originator);
     118            void fireEvent(Event& event);
    117119
    118120            virtual void processEvent(Event& event);
    119121
     122            inline void registerEventListener(BaseObject* object, const std::string& sectionname)
     123                { this->eventListeners_[object] = sectionname; }
     124            inline void unregisterEventListener(BaseObject* object)
     125                { this->eventListeners_.erase(object); }
     126
    120127            void addEvent(BaseObject* event, const std::string& sectionname);
     128            void removeEvent(BaseObject* event);
    121129            BaseObject* getEvent(unsigned int index) const;
    122130
     
    136144
    137145        private:
     146            void setXMLName(const std::string& name);
    138147            Template* getTemplate(unsigned int index) const;
    139148
Note: See TracChangeset for help on using the changeset viewer.