Changes in src/Actions/ActionQueue.hpp [8859b5:11d433]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/ActionQueue.hpp
r8859b5 r11d433 16 16 #include "CodePatterns/Singleton.hpp" 17 17 18 #include "CodePatterns/Observer/Channels.hpp"19 #include "CodePatterns/Observer/Observable.hpp"20 18 21 19 #ifdef HAVE_ACTION_THREAD … … 33 31 #endif 34 32 33 class CommandLineParser; 34 35 35 namespace MoleCuilder { 36 36 … … 38 38 class ActionRegistry; 39 39 class ActionTrait; 40 41 namespace Queuedetail {42 template <class T> const T* lastChanged()43 {44 ASSERT(0, "Queuedetail::lastChanged() - only specializations may be used.");45 return NULL;46 }47 }48 40 49 41 /** This class combines the whole handling of Actions into a single class. … … 52 44 * automatically queued and placed into a History after execution. 53 45 */ 54 class ActionQueue : public Singleton<ActionQueue> , public Observable46 class ActionQueue : public Singleton<ActionQueue> 55 47 { 56 48 friend class Singleton<ActionQueue>; … … 59 51 typedef std::vector< Action * > ActionQueue_t; 60 52 61 //!> channels for this observable62 enum NotificationType {63 ActionQueued, // new action was queued64 NotificationType_MAX // denotes the maximum of available notification types65 };66 67 //>! access to last changed element (atom or molecule)68 template <class T> const T* lastChanged() const69 { return Queuedetail::lastChanged<T>(); }70 71 53 /** Queues the Action with \a name to be called. 72 54 * … … 81 63 * \param state whether Actions needs to be filled via a Dialog or not 82 64 */ 83 void queueAction( Action *_action, enum Action::QueryOptions state = Action::Interactive);65 void queueAction(const Action * const _action, enum Action::QueryOptions state = Action::Interactive); 84 66 85 67 /** Returns the spawned action by token \a name. … … 167 149 //!> grant Action access to internal history functions. 168 150 friend class Action; 151 //!> grant CommandLineParser access to stop and clearQueue() 152 friend class ::CommandLineParser; 169 153 170 154 /** Wrapper function to add state to ActionHistory. … … 185 169 */ 186 170 void clear(); 171 172 /** Clears all actions currently present in the actionqueues. 173 * 174 */ 175 void clearQueue(); 187 176 188 177 #ifdef HAVE_ACTION_THREAD … … 233 222 ~ActionQueue(); 234 223 235 private:236 friend const Action *Queuedetail::lastChanged<Action>();237 static const Action *_lastchangedaction;238 239 224 //!> ActionRegistry to spawn new actions 240 225 ActionRegistry *AR; … … 275 260 ActionStatusList StatusList; 276 261 }; 277 namespace Queuedetail {278 template <> inline const Action* lastChanged<Action>() { return ActionQueue::_lastchangedaction; }279 }280 262 281 263 };
Note:
See TracChangeset
for help on using the changeset viewer.