µ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::file_lockable< T, L > Class Template Reference

#include <file.h>

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

Public Types

using lockable_type = L
 
using value_type = T
 
Types & Constants
enum class  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
 file_lockable (file_system &fs, lockable_type &locker)
 
virtual ~file_lockable () override
 
Public Member Functions
virtual int close (void) override
 
virtual ssize_t read (void *buf, std::size_t nbyte) override
 
virtual ssize_t write (const void *buf, std::size_t nbyte) override
 
virtual ssize_t writev (const iovec *iov, int iovcnt) override
 
virtual int vfcntl (int cmd, std::va_list args) override
 
virtual int fstat (struct stat *buf) override
 
virtual off_t lseek (off_t offset, int whence) override
 
virtual int ftruncate (off_t length) override
 
virtual int fsync (void) override
 
value_typeimpl (void) const
 
Public Member Functions
virtual int fstatvfs (struct statvfs *buf)
 
class file_systemget_file_system (void)
 
Public Member Functions
int fcntl (int cmd,...)
 
int isatty (void)
 
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::file_lockable< T, L >

Definition at line 360 of file file.h.

Member Typedef Documentation

◆ lockable_type

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

Definition at line 367 of file file.h.

◆ type_t

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

Definition at line 127 of file io.h.

◆ value_type

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

Definition at line 366 of file file.h.

Member Enumeration Documentation

◆ type

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

Definition at line 128 of file io.h.

Constructor & Destructor Documentation

◆ file_lockable()

template<typename T , typename L >
os::posix::file_lockable< T, L >::file_lockable ( file_system fs,
lockable_type locker 
)

Definition at line 544 of file file.h.

◆ ~file_lockable()

template<typename T , typename L >
os::posix::file_lockable< T, L >::~file_lockable
overridevirtual

Definition at line 563 of file file.h.

Member Function Documentation

◆ alloc_file_descriptor()

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

Definition at line 190 of file io.cpp.

◆ clear_file_descriptor()

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

Definition at line 450 of file io.h.

◆ close()

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

Reimplemented from os::posix::file.

Definition at line 575 of file file.h.

◆ fcntl()

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

Definition at line 364 of file io.cpp.

◆ file_descriptor() [1/2]

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

Definition at line 444 of file io.h.

◆ file_descriptor() [2/2]

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

Definition at line 456 of file io.h.

◆ fstat()

template<typename T , typename L >
int os::posix::file_lockable< T, L >::fstat ( struct stat buf)
overridevirtual

Reimplemented from os::posix::io.

Definition at line 630 of file file.h.

◆ fstatvfs()

int os::posix::file::fstatvfs ( struct statvfs buf)
virtualinherited

Definition at line 107 of file file.cpp.

◆ fsync()

template<typename T , typename L >
int os::posix::file_lockable< T, L >::fsync ( void  )
overridevirtual

Reimplemented from os::posix::file.

Definition at line 661 of file file.h.

◆ ftruncate()

template<typename T , typename L >
int os::posix::file_lockable< T, L >::ftruncate ( off_t  length)
overridevirtual

Reimplemented from os::posix::file.

Definition at line 651 of file file.h.

◆ get_file_system()

file_system & os::posix::file::get_file_system ( void  )
inlineinherited

Definition at line 487 of file file.h.

◆ get_type()

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

Definition at line 438 of file io.h.

◆ impl()

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

Definition at line 671 of file file.h.

◆ is_opened()

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

Definition at line 462 of file io.h.

◆ isatty()

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

Definition at line 407 of file io.cpp.

◆ lseek()

template<typename T , typename L >
off_t os::posix::file_lockable< T, L >::lseek ( off_t  offset,
int  whence 
)
overridevirtual

Reimplemented from os::posix::io.

Definition at line 641 of file file.h.

◆ read()

template<typename T , typename L >
ssize_t os::posix::file_lockable< T, L >::read ( void *  buf,
std::size_t  nbyte 
)
overridevirtual

Reimplemented from os::posix::io.

Definition at line 585 of file file.h.

◆ vfcntl()

template<typename T , typename L >
int os::posix::file_lockable< T, L >::vfcntl ( int  cmd,
std::va_list  args 
)
overridevirtual

Reimplemented from os::posix::io.

Definition at line 615 of file file.h.

◆ write()

template<typename T , typename L >
ssize_t os::posix::file_lockable< T, L >::write ( const void *  buf,
std::size_t  nbyte 
)
overridevirtual

Reimplemented from os::posix::io.

Definition at line 595 of file file.h.

◆ writev()

template<typename T , typename L >
ssize_t os::posix::file_lockable< T, L >::writev ( const iovec iov,
int  iovcnt 
)
overridevirtual

Reimplemented from os::posix::io.

Definition at line 605 of file file.h.


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