SaltAPI  1.1
An API for the HTTPd / Zia by Salty Studio.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ProcessingList.hpp
Go to the documentation of this file.
1 //
2 // Created by wery_a on 07/01/17.
3 //
4 
5 #ifndef API_V2_PROCESSINGLIST_HPP
6 #define API_V2_PROCESSINGLIST_HPP
7 
8 #include <list>
9 #include <functional>
10 
11 namespace HTTP {
12  class Request;
13 
14  class Response;
15 
16  class ProcessingList;
17 
21 // typedef bool (EventFunction)(Request *req, Response *res, ProcessingList *pl);
22  typedef std::function<bool(Request *req, Response *res, ProcessingList *pl)> EventFunction;
23 
24  typedef std::list<EventFunction> EventFunctionList;
25 
27  public:
29 
30  virtual ~ProcessingList();
31 
32  private:
33  EventFunctionList m_events;
34 
35  public:
40  bool pop();
41 
46  EventFunctionList::iterator begin();
47 
52  EventFunctionList::iterator end();
53 
59  bool push(EventFunction eventFunction);
60 
61 
68  bool pushBefore(EventFunction eventFunction, EventFunctionList::const_iterator ref);
69 
76  bool pushAfter(EventFunction eventFunction, EventFunctionList::const_iterator ref);
77 
82  bool next(Request *req, Response *res);
83  };
84 }
85 
86 #endif //API_V2_PROCESSINGLIST_HPP
bool next(Request *req, Response *res)
pop current event and call next event
EventFunctionList::iterator begin()
bool pushBefore(EventFunction eventFunction, EventFunctionList::const_iterator ref)
push eventFunction before iterator
bool pop()
pop first elem
std::list< EventFunction > EventFunctionList
bool push(EventFunction eventFunction)
push back eventFunction
EventFunctionList::iterator end()
bool pushAfter(EventFunction eventFunction, EventFunctionList::const_iterator ref)
push eventFunction after iterator
std::function< bool(Request *req, Response *res, ProcessingList *pl)> EventFunction