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_LiteTransport_hpp
10 #define anna_comm_LiteTransport_hpp
12 #include <anna/comm/Transport.hpp>
13 #include <anna/comm/TransportFactory.hpp>
14 #include <anna/comm/TransportFactoryImpl.hpp>
21 Protocol oriented to internal network messages interchange, supposing no errors in transmision and short-sized
22 messages which allows length representation in only two bytes. No synchronization mechanisms are provided, then
23 a single error could cause problems in our process.
25 @warning Encode mode does not provide enough information to allow re-synchronization in case of error
29 class LiteTransport : public comm::Transport {
31 static const int headerSize = sizeof(short int); /**< Tamao de la cabezera del mensaje */
39 Returns the class name literal.
40 @return class name literal.
42 static const char* className() throw() { return "anna::comm::LiteTransport"; }
45 Returns the transport factory associated to this class
46 @return transport factory associated to this class
48 static TransportFactory& getFactory() throw() { return st_transportFactory; }
51 static TransportFactoryImpl <LiteTransport> st_transportFactory;
55 int calculeSize(const DataBlock&) throw(RuntimeException);
56 const Message* decode(const DataBlock&) throw(RuntimeException);
57 const DataBlock& code(Message&) throw(RuntimeException);
59 friend class anna::Allocator <LiteTransport>;