10 #include "../core/element.h" 11 #include "../core/updater.h" 20 for (
auto it = new_chain.begin(); it != new_chain.end(); ++it)
22 if (std::find(chain.begin(), chain.end(), *it) == chain.end())
24 bool it_is_inserted =
false;
26 for (
auto jt = chain.begin(); jt != chain.end(); ++jt)
28 bool jt_should_be_after_it =
false;
30 for (
auto kt = it+1; kt != new_chain.end(); ++kt)
34 jt_should_be_after_it =
true;
39 if (jt_should_be_after_it)
41 chain.insert(jt, *it);
42 it_is_inserted =
true;
61 item.first->increment_bookings();
71 item.first->update_data(item.second);
81 item.first->decrement_bookings();
This file has a definition of Generator class, which is one of the cores of this program.
void generate_data()
Hello to this Generator object.
void merge_update_chain(const Vec< UpdatePair > &new_chain)
std::vector< T > Vec
Vec is an alias for vector (same as list in Python).
void finish_using_generated_data()
Goodbye to this object.
Vec< UpdatePair > update_chain
const Vec< UpdatePair > & get_update_chain()
Get update_chain of this object.
void book_to_generate_data()
Appoint to this Generator object.