SaltAPI  1.1
An API for the HTTPd / Zia by Salty Studio.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ProcessingList.cpp
Go to the documentation of this file.
1 //
2 // Created by wery_a on 09/01/17.
3 //
4 
5 #include <algorithm>
7 
8 namespace HTTP {
10 
11  }
12 
14 
15  }
16 
18  m_events.pop_front();
19  }
20 
21  EventFunctionList::iterator ProcessingList::begin() {
22  return m_events.begin();
23  }
24 
25  EventFunctionList::iterator ProcessingList::end() {
26  return m_events.end();
27  }
28 
29  bool ProcessingList::push(EventFunction eventFunction) {
30  m_events.push_back(eventFunction);
31  return true;
32  }
33 
34  bool ProcessingList::pushBefore(EventFunction eventFunction, EventFunctionList::const_iterator ref) {
35  m_events.insert(ref, eventFunction);
36  return true;
37  }
38 
39 
40  bool ProcessingList::pushAfter(EventFunction eventFunction, EventFunctionList::const_iterator ref) {
41  m_events.insert(++ref, eventFunction);
42  return true;
43  }
44 
46  pop();
47  (*begin())(req, res, this);
48  }
49 }
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
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