Open Lighting Architecture  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
E131Sender.h
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  *
16  * E131Sender.h
17  * Interface for the E131Sender class, this abstracts the encapsulation and
18  * sending of DMP PDUs contained within E131PDUs.
19  * Copyright (C) 2007 Simon Newton
20  */
21 
22 #ifndef PLUGINS_E131_E131_E131SENDER_H_
23 #define PLUGINS_E131_E131_E131SENDER_H_
24 
25 #include "ola/network/Socket.h"
26 #include "plugins/e131/e131/DMPPDU.h"
27 #include "plugins/e131/e131/E131Header.h"
28 #include "plugins/e131/e131/PreamblePacker.h"
29 #include "plugins/e131/e131/Transport.h"
30 #include "plugins/e131/e131/UDPTransport.h"
31 
32 namespace ola {
33 namespace plugin {
34 namespace e131 {
35 
36 class DMPInflator;
37 
38 class E131Sender {
39  public:
41  class RootSender *root_sender);
42  ~E131Sender() {}
43 
44  bool SendDMP(const E131Header &header, const DMPPDU *pdu);
45  bool UniverseIP(unsigned int universe,
46  class ola::network::IPV4Address *addr);
47 
48  private:
49  ola::network::UDPSocket *m_socket;
50  PreamblePacker m_packer;
51  OutgoingUDPTransportImpl m_transport_impl;
52  class RootSender *m_root_sender;
53 
54  E131Sender(const E131Sender&);
55  E131Sender& operator=(const E131Sender&);
56 };
57 } // namespace e131
58 } // namespace plugin
59 } // namespace ola
60 #endif // PLUGINS_E131_E131_E131SENDER_H_