Changeset dd7c44 for src/CodePatterns/Observer/Observable.hpp
- Timestamp:
- Oct 30, 2015, 11:43:20 AM (10 years ago)
- Children:
- 6e2f3b
- Parents:
- 1f96ec
- git-author:
- Frederik Heber <heber@…> (07/10/15 09:44:07)
- git-committer:
- Frederik Heber <heber@…> (10/30/15 11:43:20)
- File:
-
- 1 edited
-
src/CodePatterns/Observer/Observable.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodePatterns/Observer/Observable.hpp
r1f96ec rdd7c44 45 45 */ 46 46 class Observable : public Observer { 47 //!> grant Relay access to NotificationChannels as we know it uses the mutex as well 48 friend class Relay; 47 49 public: 48 50 //!> typedef for a vector of channels … … 134 136 135 137 protected: 138 139 static void insertNotificationChannel( std::pair<Observable*, Channels *> _pair); 140 static void eraseNotificationChannel(Observable * const _target); 141 static bool isNotificationChannelPresent(const Observable * const _target); 142 static const Channels *getNotificationChannels(const Observable * const _target); 143 static Notification_ptr getNotificationChannel(const Observable * const _target, const size_t _no); 144 145 private: 136 146 137 147 typedef std::map<Observable*, Channels *> ChannelMap; … … 188 198 #define PASTE_HELPER(a,b) a ## b 189 199 #define OBSERVE Observable::_Observable_protector PASTE(_scope_obs_protector_,__LINE__)(this) 190 #define NOTIFY(channelno) do{Observable::enque_notification_internal(this, NotificationChannels[this]->getChannel(channelno));}while(0)200 #define NOTIFY(channelno) do{Observable::enque_notification_internal(this,Observable::getNotificationChannel(this,channelno));}while(0) 191 201 #define LOCK_OBSERVABLE(observable) Observable::_Observable_protector PASTE(_scope_obs_protector_,__LINE__)(&(observable)) 192 202
Note:
See TracChangeset
for help on using the changeset viewer.
