QtDesignPatterns/commandpattern/broker.h

23 lines
328 B
C++

#include <vector>
#include "interface.h"
class Broker
{
public:
void addOrder(Order *order)
{
vector.push_back(order);
}
void executeAllOrder()
{
for(auto it : vector)
{
it->execute();
}
vector.clear();
}
private:
std::vector<Order *> vector;
};