7 #ifndef SRC_INCLUDE_ACTIONS_H_ 8 #define SRC_INCLUDE_ACTIONS_H_ 61 throw std::runtime_error(
"Empty actions list!");
64 ActionPtr act = std::move(
data_.back());
77 for (
auto& a : new_acts) {
90 data_.push_back(std::move(action));
95 ActionList::size_type
size()
const {
return data_.size(); }
101 std::vector<ActionPtr>::const_reverse_iterator
begin()
const {
102 return data_.crbegin();
106 std::vector<ActionPtr>::const_reverse_iterator
end()
const {
107 return data_.crend();
119 static bool cmp(
const ActionPtr& a,
const ActionPtr& b) {
120 return a->time_of_execution() > b->time_of_execution();
135 #endif // SRC_INCLUDE_ACTIONS_H_ Actions & operator=(const Actions &)=delete
Cannot be copied.
void insert(ActionPtr &&action)
Insert an action into this container.
The Actions class abstracts the storage and manipulation of actions.
void insert(ActionList &&new_acts)
Insert a list of actions into this object.
Actions(ActionList &&action_list)
Creates a new Actions object from an ActionList.
std::vector< ActionPtr >::const_reverse_iterator begin() const
Actions()
Default constructor, creating an empty Actions object.
ActionPtr pop()
Return the first action in the list and removes it from the list.
void clear()
Delete all actions.
std::vector< ActionPtr >::const_reverse_iterator end() const
static bool cmp(const ActionPtr &a, const ActionPtr &b)
Compare two action pointer such that the maximum is the most recent action.
ActionList::size_type size() const
std::vector< ActionPtr > data_
Dynamic data.