 |
Version: SMASH-2.0
|
|
Go to the documentation of this file.
7 #ifndef SRC_INCLUDE_SMASH_ACTIONS_H_
8 #define SRC_INCLUDE_SMASH_ACTIONS_H_
42 explicit Actions(ActionList&& action_list) :
data_(std::move(action_list)) {
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_SMASH_ACTIONS_H_
std::vector< ActionPtr > data_
Dynamic data.
void insert(ActionList &&new_acts)
Insert a list of actions into this object.
void insert(ActionPtr &&action)
Insert an action into this container.
Actions(ActionList &&action_list)
Creates a new Actions object from an ActionList.
std::vector< ActionPtr >::const_reverse_iterator end() const
Actions()
Default constructor, creating an empty Actions object.
std::vector< ActionPtr >::const_reverse_iterator begin() const
ActionPtr pop()
Return the first action in the list and removes it from the list.
void clear()
Delete all actions.
ActionList::size_type size() const
Actions & operator=(const Actions &)=delete
Cannot be copied.
static bool cmp(const ActionPtr &a, const ActionPtr &b)
Compare two action pointer such that the maximum is the most recent action.