From 027f9cb59e926f9da402649580f00abef31d99fc Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Fri, 24 Apr 2020 16:13:28 +0200 Subject: [PATCH] renamed buffer accessors; added accessors for socketstream members --- libscio.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libscio.hpp b/libscio.hpp index 1fb14f3..fb71311 100644 --- a/libscio.hpp +++ b/libscio.hpp @@ -41,8 +41,8 @@ namespace sc { fdostream(int fd) : std::ostream(&_outbuf), _outbuf(fd) {} fdostream() : std::ostream(&_outbuf), _outbuf(-1) {} - int fd() const { return _outbuf.fd(); } - void fd(int fd) { _outbuf.fd(fd); } + int ofd() const { return _outbuf.fd(); } + void ofd(int fd) { _outbuf.fd(fd); } protected: fdoutbuf _outbuf; @@ -69,8 +69,8 @@ namespace sc { fdistream(int fd) : std::istream(&_inbuf), _inbuf(fd) {} fdistream() : std::istream(&_inbuf), _inbuf(-1) {} - int fd() const { return _inbuf.fd(); } - void fd(int fd) { _inbuf.fd(fd); } + int ifd() const { return _inbuf.fd(); } + void ifd(int fd) { _inbuf.fd(fd); } protected: fdinbuf _inbuf; @@ -117,6 +117,14 @@ namespace sc { void endpoint_from_address(const socket_address& address, struct sockaddr_storage* endpoint) const; socket_address address_from_endpoint(const struct sockaddr* endpoint) const; + + // getters & setters + int socket() const { return _socket; } + void socket(int sock); + int domain() const { return _domain; } + void domain(int dom) { _domain = dom; } + int type() const { return _type; } + void type(int typ) { _type = typ; } protected: int _socket {-1};