1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
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 //
9 #include <anna/core/mt/Guard.hpp>
11 #include <anna/xml/Node.hpp>
12 #include <anna/xml/Attribute.hpp>
14 #include <anna/comm/ReceiverFactory.hpp>
15 #include <anna/comm/Receiver.hpp>
20 comm::ReceiverFactory::ReceiverFactory(const char* name) :
27 //---------------------------------------------------------------------------------------------
28 // En entornos ST solo habra una unica instancia compartida por todos los comm::ClientSocket
29 //---------------------------------------------------------------------------------------------
30 comm::Receiver* comm::ReceiverFactory::create()
31 throw(RuntimeException) {
32 comm::Receiver* result(NULL);
35 if((result = a_receiver) == NULL) {
36 result = a_receiver = do_create();
41 Guard guard(*this, "comm::ReceiverFactory::create");
48 void comm::ReceiverFactory::release(comm::Receiver* receiver)
53 Guard guard(*this, "comm::ReceiverFactory::release");
55 } catch(RuntimeException& ex) {
61 xml::Node* comm::ReceiverFactory::asXML(xml::Node* parent) const
63 xml::Node* result = parent->createChild("Receiver");
64 result->createAttribute("Name", a_name);