From: Christian P. <cp...@us...> - 2004-12-23 04:32:28
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14702/include/pclasses/Net Modified Files: InetAddress.h InetSocket.h NetworkAddress.h Socket.h Log Message: Moved IODevice, IOError into P::IO namespace. Moved Char, String, TextStream into P::Unicode namespace. Index: NetworkAddress.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Net/NetworkAddress.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- NetworkAddress.h 22 Dec 2004 17:54:41 -0000 1.1.1.1 +++ NetworkAddress.h 23 Dec 2004 04:32:16 -0000 1.2 @@ -18,11 +18,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _P_NetworkAddress_h_ -#define _P_NetworkAddress_h_ +#ifndef P_Net_NetworkAddress_h +#define P_Net_NetworkAddress_h #include <pclasses/BasicTypes.h> -#include <pclasses/String.h> +#include <pclasses/Unicode/String.h> namespace P { @@ -41,7 +41,7 @@ size_t addrLen() const throw(); - virtual String str() const = 0; + virtual Unicode::String str() const = 0; virtual NetworkAddress* clone() const = 0; Index: InetAddress.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Net/InetAddress.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- InetAddress.h 22 Dec 2004 17:54:40 -0000 1.1.1.1 +++ InetAddress.h 23 Dec 2004 04:32:16 -0000 1.2 @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _P_InetAddress_h_ -#define _P_InetAddress_h_ +#ifndef P_Net_InetAddress_h +#define P_Net_InetAddress_h #include <pclasses/Net/NetworkAddress.h> @@ -47,7 +47,7 @@ bool isBroadcast() const throw(); bool isLoopback() const throw(); - String str() const; + Unicode::String str() const; InetAddress* clone() const; InetAddress& operator=(uint32_t addr); Index: Socket.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Net/Socket.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Socket.h 22 Dec 2004 17:54:40 -0000 1.1.1.1 +++ Socket.h 23 Dec 2004 04:32:16 -0000 1.2 @@ -18,8 +18,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#ifndef P_Net_Socket_h +#define P_Net_Socket_h + #include <pclasses/BasicTypes.h> -#include <pclasses/IODevice.h> +#include <pclasses/IO/IODevice.h> #include <pclasses/Net/NetworkAddress.h> namespace P { @@ -29,7 +32,7 @@ typedef uint16_t port_t; //! Socket -class Socket: public IODevice { +class Socket: public IO::IODevice { public: enum Domain { Inet, @@ -50,7 +53,7 @@ }; Socket() throw(); - Socket(Domain domain, Type type, int proto) throw(IOError); + Socket(Domain domain, Type type, int proto) throw(IO::IOError); ~Socket() throw(); Domain domain() const throw(); @@ -59,44 +62,44 @@ int protocol() const throw(); - void close() throw(LogicError, IOError); + void close() throw(LogicError, IO::IOError); - size_t read(char* buffer, size_t count) throw(IOError); + size_t read(char* buffer, size_t count) throw(IO::IOError); - size_t peek(char* buffer, size_t count) throw(IOError); + size_t peek(char* buffer, size_t count) throw(IO::IOError); - size_t write(const char* buffer, size_t count) throw(IOError); + size_t write(const char* buffer, size_t count) throw(IO::IOError); - int wait(int wait, unsigned int timeout) throw(IOError); + int wait(int wait, unsigned int timeout) throw(IO::IOError); //! Bind socket to given address and port - void bind(const NetworkAddress& addr, port_t port) throw(IOError); + void bind(const NetworkAddress& addr, port_t port) throw(IO::IOError); - void setSendTimeout(unsigned int timeout) throw(IOError); - unsigned int sendTimeout() const throw(IOError); + void setSendTimeout(unsigned int timeout) throw(IO::IOError); + unsigned int sendTimeout() const throw(IO::IOError); - void setReceiveTimeout(unsigned int timeout) throw(IOError); - unsigned int receiveTimeout() const throw(IOError); + void setReceiveTimeout(unsigned int timeout) throw(IO::IOError); + unsigned int receiveTimeout() const throw(IO::IOError); - void setSendBufferSize(size_t sz) throw(IOError); - size_t sendBufferSize() const throw(IOError); + void setSendBufferSize(size_t sz) throw(IO::IOError); + size_t sendBufferSize() const throw(IO::IOError); - void setReceiveBufferSize(size_t sz) throw(IOError); - size_t receiveBufferSize() const throw(IOError); + void setReceiveBufferSize(size_t sz) throw(IO::IOError); + size_t receiveBufferSize() const throw(IO::IOError); - void setLinger(bool enable, unsigned int timeout = 10) throw(IOError); + void setLinger(bool enable, unsigned int timeout = 10) throw(IO::IOError); - void setRouting(bool enable) throw(IOError); + void setRouting(bool enable) throw(IO::IOError); protected: void open(Domain domain, Type type, int proto) - throw(LogicError, IOError); + throw(LogicError, IO::IOError); int handle() const throw(); - void addListener(IOListener& l); - void updateListener(IOListener& l); - void removeListener(IOListener& l); + void addListener(IO::IOListener& l); + void updateListener(IO::IOListener& l); + void removeListener(IO::IOListener& l); private: Domain _domain; @@ -111,8 +114,8 @@ DatagramSocket() throw(); ~DatagramSocket() throw(); - void setBroadcast(bool enable) throw(IOError); - bool broadcast() const throw(IOError); + void setBroadcast(bool enable) throw(IO::IOError); + bool broadcast() const throw(IO::IOError); }; @@ -127,3 +130,5 @@ } // !namespace Net } // !namespace P + +#endif Index: InetSocket.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Net/InetSocket.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- InetSocket.h 22 Dec 2004 17:54:40 -0000 1.1.1.1 +++ InetSocket.h 23 Dec 2004 04:32:16 -0000 1.2 @@ -18,8 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _P_InetSocket_h_ -#define _P_InetSocket_h_ +#ifndef P_Net_InetSocket_h +#define P_Net_InetSocket_h #include <pclasses/Net/Socket.h> #include <pclasses/Net/InetAddress.h> @@ -32,45 +32,45 @@ class InetSocket: public virtual Socket { public: InetSocket() throw(); - InetSocket(Type t, int proto) throw(IOError); + InetSocket(Type t, int proto) throw(IO::IOError); ~InetSocket() throw(); - void setTypeOfSerice(uint8_t type) throw(IOError); - uint8_t typeOfService() const throw(IOError); + void setTypeOfSerice(uint8_t type) throw(IO::IOError); + uint8_t typeOfService() const throw(IO::IOError); - void setTimeToLive(int ttl) throw(IOError); - int timeToLive() const throw(IOError); + void setTimeToLive(int ttl) throw(IO::IOError); + int timeToLive() const throw(IO::IOError); protected: - void open(Type type, int proto) throw(LogicError, IOError); + void open(Type type, int proto) throw(LogicError, IO::IOError); }; //! UDP Datagram Socket class UDPSocket: public InetSocket, public DatagramSocket { public: - UDPSocket() throw(IOError); + UDPSocket() throw(IO::IOError); ~UDPSocket() throw(); - void open() throw(LogicError, IOError); + void open() throw(LogicError, IO::IOError); - void setMulticastTTL(int ttl) throw(IOError); - int multicastTTL() const throw(IOError); + void setMulticastTTL(int ttl) throw(IO::IOError); + int multicastTTL() const throw(IO::IOError); - void setMulticastLoop(bool enable) throw(IOError); - bool multicastLoop() const throw(IOError); + void setMulticastLoop(bool enable) throw(IO::IOError); + bool multicastLoop() const throw(IO::IOError); - void addMembership(const InetAddress& addr) throw(IOError); - void dropMembership(const InetAddress& addr) throw(IOError); + void addMembership(const InetAddress& addr) throw(IO::IOError); + void dropMembership(const InetAddress& addr) throw(IO::IOError); }; //! TCP Streaming Socket class TCPSocket: public InetSocket, public StreamSocket { public: - TCPSocket() throw(IOError); + TCPSocket() throw(IO::IOError); ~TCPSocket() throw(); - void open() throw(LogicError, IOError); + void open() throw(LogicError, IO::IOError); }; |