renamed buffer accessors; added accessors for socketstream members
This commit is contained in:
parent
8d327cb1d2
commit
027f9cb59e
16
libscio.hpp
16
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};
|
||||
|
Loading…
x
Reference in New Issue
Block a user