Remove dynamic exceptions
[anna.git] / example / timex / ArithmeticHTTPServer / Context.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef timex_ArithmeticHTTPServer_Context_hpp
10 #define timex_ArithmeticHTTPServer_Context_hpp
11
12 #include <anna/timex/Context.hpp>
13
14 namespace anna {
15    namespace comm {
16       class ClientSocket;
17    }
18 }
19
20 namespace test {
21
22 namespace http4comm {
23
24 class Transaction;
25
26 using namespace anna;
27
28 class Context : public anna::timex::Context <S64> {
29 public:
30    Context (anna::timex::Engine&, const Millisecond& timeout);
31    
32    void create (const S64 id, comm::ClientSocket&) noexcept(false);
33    void destroy (Transaction*) ;
34
35 private:
36    Recycler <Transaction> a_transactions;
37
38    anna::timex::Transaction* createTransaction (const int /*classType*/) ;
39    void releaseTransaction (anna::timex::Transaction* tt) ;
40
41    std::string identifierAsString (const S64&) const ;
42    const S64& contextAsIdentifier (const void*) const ;
43    
44    Context (const Context&);
45 };
46
47 }
48 }
49
50 #endif