Changeset 959c82 for src/CodePatterns/Observer/Observable.hpp
- Timestamp:
- Oct 30, 2015, 11:43:20 AM (10 years ago)
- Children:
- 1f96ec
- Parents:
- e24dde
- git-author:
- Frederik Heber <heber@…> (07/04/15 22:33:12)
- git-committer:
- Frederik Heber <heber@…> (10/30/15 11:43:20)
- File:
-
- 1 edited
-
src/CodePatterns/Observer/Observable.hpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodePatterns/Observer/Observable.hpp
re24dde r959c82 18 18 #include <string> 19 19 #include <boost/function.hpp> 20 #include <boost/thread.hpp>21 20 22 21 #include "CodePatterns/Range.hpp" 23 22 #include "CodePatterns/Observer/defs.hpp" 23 #include "CodePatterns/Observer/GlobalObservableInfo.hpp" 24 24 #include "CodePatterns/Observer/Observer.hpp" 25 25 26 26 class Graveyard; 27 class scoped_lock; 27 28 28 29 /** … … 48 49 typedef std::vector<size_t> channels_t; 49 50 50 Observable(std::string _name, const channels_t &_channels = channels_t()); 51 Observable( 52 std::string _name, 53 const channels_t &_channels = channels_t()); 51 54 virtual ~Observable(); 52 53 /** This class is only used to distinguish from size_t in the overload.54 *55 * It encapsulates a const int (the priority level) and checks valid bounds56 * in constructor.57 *58 */59 class PriorityLevel {60 public:61 explicit PriorityLevel(const int i);62 ~PriorityLevel();63 64 const int level;65 private:66 static range<int> ValidRange;67 };68 55 69 56 private: … … 92 79 * ussually no need to order the update sequence. 93 80 */ 94 virtual void signOn(Observer *target, PriorityLevel priority = PriorityDefault) const; 81 virtual void signOn( 82 Observer * target, 83 GlobalObservableInfo::PriorityLevel priority = GlobalObservableInfo::PriorityDefault) const; 95 84 96 85 /** … … 106 95 Observer *target, 107 96 size_t channelno, 108 PriorityLevel priority = PriorityDefault) const; 97 GlobalObservableInfo::PriorityLevel priority = 98 GlobalObservableInfo::PriorityDefault) const; 109 99 110 100 /** … … 143 133 static void enque_notification_internal(Observable *publisher, Notification_ptr notification); 144 134 135 protected: 136 145 137 typedef std::map<Observable*, Channels *> ChannelMap; 146 138 static ChannelMap NotificationChannels; 147 148 static PriorityLevel PriorityDefault;149 150 protected:151 typedef std::multimap<int,Observer*> callees_t;152 typedef std::set<Notification*> notificationSet;153 static std::map<Observable*, int> depth;154 static std::map<Observable*,callees_t> callTable;155 static std::map<Observable*,notificationSet> notifications;156 static std::set<Observable*> busyObservables;157 158 static boost::recursive_mutex ObservablesMapLock; //!< a lock for the pointer of the instance159 139 160 140 private:
Note:
See TracChangeset
for help on using the changeset viewer.
