AnCH Framework  0.1
Another C++ Hack Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
socketEvent.hpp
1 /*
2  ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 standard
3  Copyright (C) 2012 Vincent Lachenal
4 
5  This file is part of ANCH Framework.
6 
7  ANCH Framework is free software: you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  ANCH Framework is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with ANCH Framework. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #ifndef _ANCH_NETWORK_SOCKET_EVENT_H_
21 #define _ANCH_NETWORK_SOCKET_EVENT_H_
22 
23 #include <iostream>
24 
25 #ifdef ANCH_POSIX
26 #include <netdb.h>
27 #endif
28 
29 namespace anch {
30  namespace network {
31 
37  class SocketEvent {
38 
39  private:
40  // Attributes +
42  std::string _message;
43 
45  sockaddr_storage _address;
46  // Attributes -
47 
48  public:
49  // Constructors +
55  SocketEvent(const std::string& message);
56 
63  SocketEvent(const std::string& message, const sockaddr_storage& address);
64  // Constructors -
65 
66  // Destructor +
70  virtual ~SocketEvent();
71  // Destructor -
72 
73  public:
74  // Accessors +
80  inline const std::string& getMessage() const {
81  return _message;
82  };
83 
89  inline const sockaddr_storage& getAddress() const {
90  return _address;
91  };
92  // Accessors -
93 
94  };
95 
96  }
97 }
98 
99 #endif // _ANCH_NETWORK_SOCKET_EVENT_H_
SocketEvent(const std::string &message)
Definition: socketEvent.cpp:33
AnCH framework base namespace.
Definition: base64.hpp:28
virtual ~SocketEvent()
Definition: socketEvent.cpp:55
Definition: socketEvent.hpp:37
const sockaddr_storage & getAddress() const
Definition: socketEvent.hpp:89
const std::string & getMessage() const
Definition: socketEvent.hpp:80