Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
ClientSocket.h
1 /*
2  * ClientsSocket class interface
3  *
4  * This file is part of OTAWA
5  * Copyright (c) 2012, IRIT UPS.
6  *
7  * ELM is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * ELM 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 General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with ELM; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 #ifndef ELM_NET_CLIENTSOCKET_H_
22 #define ELM_NET_CLIENTSOCKET_H_
23 
24 #include <elm/net/Exception.h>
25 #include <elm/io/InStream.h>
26 #include <elm/io/OutStream.h>
27 
28 namespace elm { namespace net {
29 
30 class ClientSocket {
31 public:
32  static ClientSocket *make(const string& host, int port);
33  static ClientSocket *make(const string& host, const string& service);
34  static ClientSocket *make(int port);
35 
36  virtual ~ClientSocket(void) { }
37  virtual int port(void) const = 0;
38  virtual const string& host(void) const = 0;
39  virtual const string& service(void) const = 0;
40  virtual void connect(void) = 0;
41  virtual void disconnect(void) = 0;
42  virtual io::InStream& in(void) = 0;
43  virtual io::OutStream& out(void) = 0;
44 };
45 
46 } } // elm::net
47 
48 #endif /* ELM_NET_CLIENTSOCKET_H_ */
elm::net::ClientSocket::out
virtual io::OutStream & out(void)=0
elm::net::ClientSocket::connect
virtual void connect(void)=0
elm::net::ClientSocket
Definition: ClientSocket.h:30
elm::net::ClientSocket::port
virtual int port(void) const =0
elm::net::ClientSocket::host
virtual const string & host(void) const =0
elm::net::ClientSocket::~ClientSocket
virtual ~ClientSocket(void)
Definition: ClientSocket.h:36
elm
Definition: adapter.h:26
elm::net::ClientSocket::make
static ClientSocket * make(const string &host, int port)
Definition: net_ClientSocket.cpp:248
elm::net::ClientSocket::disconnect
virtual void disconnect(void)=0
elm::net::ClientSocket::service
virtual const string & service(void) const =0
elm::io::OutStream
Definition: OutStream.h:30
elm::net::ClientSocket::in
virtual io::InStream & in(void)=0
elm::io::InStream
Definition: InStream.h:29