Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionQueue.hpp

    ra61dbb r11d433  
    2424#include "Actions/Action.hpp"
    2525#include "Actions/ActionState.hpp"
     26#include "Actions/ActionStatusList.hpp"
    2627
    2728#ifdef HAVE_ACTION_THREAD
     
    2930void waitQueue();
    3031#endif
     32
     33class CommandLineParser;
    3134
    3235namespace MoleCuilder {
     
    6063   * \param state whether Actions needs to be filled via a Dialog or not
    6164   */
    62   void queueAction(Action *_action, enum Action::QueryOptions state = Action::Interactive);
     65  void queueAction(const Action * const _action, enum Action::QueryOptions state = Action::Interactive);
    6366
    6467  /** Returns the spawned action by token \a name.
     
    133136  { return run_thread; }
    134137#endif
     138
     139  /** Getter to ref to list of status messages.
     140   *
     141   * This is meant for UIs to registers as Observables.
     142   *
     143   * \return ref to StatusList variable
     144   */
     145  ActionStatusList& getStatusList()
     146  { return StatusList; }
    135147
    136148private:
    137149  //!> grant Action access to internal history functions.
    138150  friend class Action;
     151  //!> grant CommandLineParser access to stop and clearQueue()
     152  friend class ::CommandLineParser;
    139153
    140154  /** Wrapper function to add state to ActionHistory.
     
    145159  void addElement(Action* _Action, ActionState::ptr _state);
    146160
     161  /** Advocate function to add status message to the list.
     162   *
     163   */
     164  void pushStatus(const std::string &_msg)
     165  { StatusList.pushMessage(_msg); }
     166
    147167  /** Wrapper function to clear ActionHistory.
    148168   *
    149169   */
    150170  void clear();
     171
     172  /** Clears all actions currently present in the actionqueues.
     173   *
     174   */
     175  void clearQueue();
    151176
    152177#ifdef HAVE_ACTION_THREAD
     
    231256  boost::mutex mtx_idle;
    232257#endif
     258
     259  //!> internal list of status messages from Actions for UIs to display
     260  ActionStatusList StatusList;
    233261};
    234262
Note: See TracChangeset for help on using the changeset viewer.