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 #ifndef anna_comm_SureTransport_hpp
10 #define anna_comm_SureTransport_hpp
12 #include <anna/core/RuntimeException.hpp>
13 #include <anna/core/DataBlock.hpp>
15 #include <anna/comm/Transport.hpp>
16 #include <anna/comm/TransportFactoryImpl.hpp>
25 Class to define main transport layer: message analysis received from any source. Protocol
26 knows about message semantics when this message is completed: the main problem is find
29 class SureTransport : public Transport {
38 \return Class name literal
40 static const char* className() throw() { return "anna::comm::SureTransport"; }
43 Returns the transport layer manager associated to this class.
44 \return transport layer manager associated to this class.
46 static TransportFactory& getFactory() throw() { return st_transportFactory; }
49 static const short int headerSize = (sizeof(short int) + sizeof(int));
50 static const short int initTag = 0xaaaa;
51 static TransportFactoryImpl <SureTransport> st_transportFactory;
61 int calculeSize(const DataBlock& dataBlock) throw(RuntimeException);
62 const Message* decode(const DataBlock& message) throw(RuntimeException);
63 virtual const DataBlock& code(Message&) throw(RuntimeException);
65 friend class anna::Allocator <SureTransport>;