ANNA Suite  2020b
Multipurpose development suite for Telco applications
MessageFactory.hpp
Go to the documentation of this file.
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 anna_http_MessageFactory_hpp
10 #define anna_http_MessageFactory_hpp
11 
12 #include <anna/core/Singleton.hpp>
14 
15 #include <anna/http/Request.hpp>
16 #include <anna/http/Response.hpp>
17 
18 namespace anna {
19 
20 namespace http {
21 
25 class MessageFactory : public Singleton <MessageFactory> {
26 public:
33  Message* create(const Message::Type::_v type) noexcept(false);
34 
41  void release(Message* message) ;
42 
43 private:
44  Recycler <Request> a_requests;
45  Recycler <Response> a_responses;
46 
47  MessageFactory() {;}
48 
49  friend class Singleton<MessageFactory>;
50 };
51 
52 
53 }
54 }
55 
56 #endif
Definition: Message.hpp:30
Message * create(const Message::Type::_v type) noexcept(false)
Definition: Singleton.hpp:76
_v
Definition: Message.hpp:46
Definition: Recycler.hpp:30
Definition: MessageFactory.hpp:25
Definition: app.hpp:12
static void release()
Definition: Singleton.hpp:88