Changeset e24dde for src/CodePatterns/Cacheable.hpp
- Timestamp:
- Oct 30, 2015, 11:43:20 AM (10 years ago)
- Children:
- 959c82
- Parents:
- 454bc54
- git-author:
- Frederik Heber <heber@…> (06/21/15 11:28:54)
- git-committer:
- Frederik Heber <heber@…> (10/30/15 11:43:20)
- File:
-
- 1 edited
-
src/CodePatterns/Cacheable.hpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodePatterns/Cacheable.hpp
r454bc54 re24dde 31 31 class State{ 32 32 public: 33 State(Cacheable * _owner) :33 State(Cacheable * const _owner) : 34 34 busy(false), 35 35 owner(_owner) … … 45 45 protected: 46 46 bool busy; 47 Cacheable * owner;47 Cacheable * const owner; 48 48 }; 49 49 50 50 class InvalidState : public State{ 51 51 public: 52 InvalidState(Cacheable * _owner):52 InvalidState(Cacheable * const _owner): 53 53 State(_owner) 54 54 {} … … 80 80 class ValidState : public State{ 81 81 public: 82 ValidState(Cacheable * _owner) :82 ValidState(Cacheable * const _owner) : 83 83 State(_owner) 84 84 {} … … 112 112 class DestroyedState : public State { 113 113 public: 114 DestroyedState(Cacheable * _owner) :114 DestroyedState(Cacheable * const _owner) : 115 115 State(_owner) 116 116 {} … … 145 145 public: 146 146 Cacheable( 147 Observable *_owner,148 const boost::function<T()> _recalcMethod,147 const Observable * const _owner, 148 const boost::function<T()> &_recalcMethod, 149 149 const std::string &name, 150 150 const Observable::channels_t &_channels = Observable::channels_t()); … … 167 167 // destroyed state is not predefined, because we rarely enter that state and never leave 168 168 169 const Observable * owner;169 const Observable * const owner; 170 170 const boost::function<T()> recalcMethod; 171 171 … … 180 180 template<typename T> 181 181 Cacheable<T>::Cacheable( 182 Observable *_owner,183 const boost::function<T()> _recalcMethod,182 const Observable * const _owner, 183 const boost::function<T()> &_recalcMethod, 184 184 const std::string &_name, 185 185 const Observable::channels_t &_channels) : … … 234 234 owner->signOff(this,*iter); 235 235 } 236 const_cast<const Observable *&>(owner) = NULL; 236 237 } 237 238 } … … 283 284 { 284 285 public: 285 Cacheable(Observable *_owner, boost::function<T()> _recalcMethod,std::string name); 286 Cacheable( 287 const Observable * const _owner, 288 boost::function<T()> &_recalcMethod, 289 std::string name, 290 const Observable::channels_t &_channels); 286 291 virtual ~Cacheable(); 287 292 … … 299 304 300 305 template<typename T> 301 Cacheable<T>::Cacheable(Observable *_owner, boost::function<T()> _recalcMethod, std::string name) : 306 Cacheable<T>::Cacheable( 307 const Observable * const _owner, 308 boost::function<T()> &_recalcMethod, 309 std::string name, 310 const Observable::channels_t &_channels) : 302 311 Observer(name), 303 312 recalcMethod(_recalcMethod)
Note:
See TracChangeset
for help on using the changeset viewer.
