µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::posix::socket_lockable< T, L > Class Template Reference

#include <socket.h>

+ Inheritance diagram for os::posix::socket_lockable< T, L >:

Public Types

using lockable_type = L
 
using value_type = T
 
Types & Constants
enum  type : type_t {
  unknown = 0 ,
  not_set = 1 << 0 ,
  char_device = 1 << 1 ,
  block_device = 1 << 2 ,
  tty = 1 << 3 ,
  file = 1 << 4 ,
  socket = 1 << 5
}
 
using type_t = unsigned int
 

Public Member Functions

Constructors & Destructor
 socket_lockable (class net_stack &ns, lockable_type &locker)
 
virtual ~socket_lockable ()
 
Public Member Functions
virtual int close (void) override
 
virtual class socketaccept (struct sockaddr *address, socklen_t *address_len) override
 
virtual int bind (const struct sockaddr *address, socklen_t address_len) override
 
virtual int connect (const struct sockaddr *address, socklen_t address_len) override
 
virtual int getpeername (struct sockaddr *address, socklen_t *address_len) override
 
virtual int getsockname (struct sockaddr *address, socklen_t *address_len) override
 
virtual int getsockopt (int level, int option_name, void *option_value, socklen_t *option_len) override
 
virtual int listen (int backlog) override
 
virtual ssize_t recv (void *buffer, size_t length, int flags) override
 
virtual ssize_t recvfrom (void *buffer, size_t length, int flags, struct sockaddr *address, socklen_t *address_len) override
 
virtual ssize_t recvmsg (struct msghdr *message, int flags) override
 
virtual ssize_t send (const void *buffer, size_t length, int flags) override
 
virtual ssize_t sendmsg (const struct msghdr *message, int flags) override
 
virtual ssize_t sendto (const void *message, size_t length, int flags, const struct sockaddr *dest_addr, socklen_t dest_len) override
 
virtual int setsockopt (int level, int option_name, const void *option_value, socklen_t option_len) override
 
virtual int shutdown (int how) override
 
virtual int sockatmark (void) override
 
value_typeimpl (void) const
 
Public Member Functions
class net_stacknet_stack (void)
 
Public Member Functions
virtual ssize_t read (void *buf, std::size_t nbyte)
 
virtual ssize_t write (const void *buf, std::size_t nbyte)
 
virtual ssize_t writev (const struct iovec *iov, int iovcnt)
 
int fcntl (int cmd,...)
 
virtual int vfcntl (int cmd, std::va_list args)
 
int isatty (void)
 
virtual int fstat (struct stat *buf)
 
virtual off_t lseek (off_t offset, int whence)
 
type_t get_type (void) const
 
file_descriptor_t file_descriptor (void) const
 
bool is_opened (void)
 

Protected Member Functions

Private Member Functions
void file_descriptor (file_descriptor_t fildes)
 
void clear_file_descriptor (void)
 
ioalloc_file_descriptor (void)
 

Detailed Description

template<typename T, typename L>
class os::posix::socket_lockable< T, L >

Definition at line 404 of file posix-io/socket.h.

Member Typedef Documentation

◆ lockable_type

template<typename T , typename L >
using os::posix::socket_lockable< T, L >::lockable_type = L

Definition at line 411 of file posix-io/socket.h.

◆ type_t

using os::posix::io::type_t = unsigned int
inherited

Definition at line 132 of file io.h.

◆ value_type

template<typename T , typename L >
using os::posix::socket_lockable< T, L >::value_type = T

Definition at line 410 of file posix-io/socket.h.

Member Enumeration Documentation

◆ type

enum os::posix::io::type : type_t
inherited
Enumerator
unknown 
not_set 
char_device 
block_device 
tty 
file 
socket 

Definition at line 133 of file io.h.

Constructor & Destructor Documentation

◆ socket_lockable()

template<typename T , typename L >
os::posix::socket_lockable< T, L >::socket_lockable ( class net_stack ns,
lockable_type locker 
)

Definition at line 591 of file posix-io/socket.h.

◆ ~socket_lockable()

template<typename T , typename L >
os::posix::socket_lockable< T, L >::~socket_lockable
virtual

Definition at line 603 of file posix-io/socket.h.

Member Function Documentation

◆ accept()

template<typename T , typename L >
class socket * os::posix::socket_lockable< T, L >::accept ( struct sockaddr address,
socklen_t address_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 624 of file posix-io/socket.h.

◆ alloc_file_descriptor()

io * os::posix::io::alloc_file_descriptor ( void  )
protectedinherited

Definition at line 201 of file io.cpp.

◆ bind()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::bind ( const struct sockaddr address,
socklen_t  address_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 635 of file posix-io/socket.h.

◆ clear_file_descriptor()

void os::posix::io::clear_file_descriptor ( void  )
inlineprotectedinherited

Definition at line 435 of file io.h.

◆ close()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::close ( void  )
overridevirtual

Reimplemented from os::posix::io.

Definition at line 614 of file posix-io/socket.h.

◆ connect()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::connect ( const struct sockaddr address,
socklen_t  address_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 646 of file posix-io/socket.h.

◆ fcntl()

int os::posix::io::fcntl ( int  cmd,
  ... 
)
inherited

Definition at line 375 of file io.cpp.

◆ file_descriptor() [1/2]

void os::posix::io::file_descriptor ( file_descriptor_t  fildes)
inlineprotectedinherited

Definition at line 429 of file io.h.

◆ file_descriptor() [2/2]

file_descriptor_t os::posix::io::file_descriptor ( void  ) const
inlineinherited

Definition at line 441 of file io.h.

◆ fstat()

int os::posix::io::fstat ( struct stat buf)
virtualinherited

Reimplemented in os::posix::file_lockable< T, L >.

Definition at line 422 of file io.cpp.

◆ get_type()

io::type_t os::posix::io::get_type ( void  ) const
inlineinherited

Definition at line 423 of file io.h.

◆ getpeername()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::getpeername ( struct sockaddr address,
socklen_t address_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 657 of file posix-io/socket.h.

◆ getsockname()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::getsockname ( struct sockaddr address,
socklen_t address_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 668 of file posix-io/socket.h.

◆ getsockopt()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::getsockopt ( int  level,
int  option_name,
void *  option_value,
socklen_t option_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 679 of file posix-io/socket.h.

◆ impl()

template<typename T , typename L >
socket_lockable< T, L >::value_type & os::posix::socket_lockable< T, L >::impl ( void  ) const

Definition at line 798 of file posix-io/socket.h.

◆ is_opened()

bool os::posix::io::is_opened ( void  )
inlineinherited

Definition at line 447 of file io.h.

◆ isatty()

int os::posix::io::isatty ( void  )
inherited

Definition at line 412 of file io.cpp.

◆ listen()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::listen ( int  backlog)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 691 of file posix-io/socket.h.

◆ lseek()

off_t os::posix::io::lseek ( off_t  offset,
int  whence 
)
virtualinherited

Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.

Definition at line 453 of file io.cpp.

◆ net_stack()

net_stack * os::posix::socket::net_stack ( void  )
inlineinherited

Definition at line 550 of file posix-io/socket.h.

◆ read()

ssize_t os::posix::io::read ( void *  buf,
std::size_t  nbyte 
)
virtualinherited

Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.

Definition at line 229 of file io.cpp.

◆ recv()

template<typename T , typename L >
ssize_t os::posix::socket_lockable< T, L >::recv ( void *  buffer,
size_t  length,
int  flags 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 701 of file posix-io/socket.h.

◆ recvfrom()

template<typename T , typename L >
ssize_t os::posix::socket_lockable< T, L >::recvfrom ( void *  buffer,
size_t  length,
int  flags,
struct sockaddr address,
socklen_t address_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 711 of file posix-io/socket.h.

◆ recvmsg()

template<typename T , typename L >
ssize_t os::posix::socket_lockable< T, L >::recvmsg ( struct msghdr *  message,
int  flags 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 723 of file posix-io/socket.h.

◆ send()

template<typename T , typename L >
ssize_t os::posix::socket_lockable< T, L >::send ( const void *  buffer,
size_t  length,
int  flags 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 733 of file posix-io/socket.h.

◆ sendmsg()

template<typename T , typename L >
ssize_t os::posix::socket_lockable< T, L >::sendmsg ( const struct msghdr *  message,
int  flags 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 743 of file posix-io/socket.h.

◆ sendto()

template<typename T , typename L >
ssize_t os::posix::socket_lockable< T, L >::sendto ( const void *  message,
size_t  length,
int  flags,
const struct sockaddr dest_addr,
socklen_t  dest_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 753 of file posix-io/socket.h.

◆ setsockopt()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::setsockopt ( int  level,
int  option_name,
const void *  option_value,
socklen_t  option_len 
)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 766 of file posix-io/socket.h.

◆ shutdown()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::shutdown ( int  how)
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 778 of file posix-io/socket.h.

◆ sockatmark()

template<typename T , typename L >
int os::posix::socket_lockable< T, L >::sockatmark ( void  )
overridevirtual

Reimplemented from os::posix::socket.

Definition at line 788 of file posix-io/socket.h.

◆ vfcntl()

int os::posix::io::vfcntl ( int  cmd,
std::va_list  args 
)
virtualinherited

Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.

Definition at line 387 of file io.cpp.

◆ write()

ssize_t os::posix::io::write ( const void *  buf,
std::size_t  nbyte 
)
virtualinherited

Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.

Definition at line 280 of file io.cpp.

◆ writev()

ssize_t os::posix::io::writev ( const struct iovec iov,
int  iovcnt 
)
virtualinherited

Reimplemented in os::posix::block_device_lockable< T, L >, and os::posix::file_lockable< T, L >.

Definition at line 333 of file io.cpp.


The documentation for this class was generated from the following file: