Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Public Member Functions | List of all members
joedb::Abstract_File Class Reference

#include <joedb/journal/Abstract_File.h>

Inheritance diagram for joedb::Abstract_File:
Inheritance graph
[legend]

Public Member Functions

virtual int64_t get_size () const
 Get the size of the file, or -1 if it is unknown.
 
virtual size_t pread (char *data, size_t size, int64_t offset) const
 Read a range of bytes.
 
virtual void pwrite (const char *data, size_t size, int64_t offset)
 Write a range of bytes. Extend file size if necessary.
 
virtual void sync ()
 Write data and meta-data (such as file size) durably to permanent storage.
 
virtual void datasync ()
 Write data durably to permanent storage.
 
virtual void shared_lock (int64_t start, int64_t size)
 Lock a range of bytes for reading (prevents writes, not reads)
 
virtual void exclusive_lock (int64_t start, int64_t size)
 Lock a range of bytes for writing (prevents both writes and reads)
 
virtual void unlock (int64_t start, int64_t size) noexcept
 Remove a lock. The range should match the range of a corresponding lock.
 
virtual ~Abstract_File ()=default
 

Detailed Description

Definition at line 10 of file Abstract_File.h.

Constructor & Destructor Documentation

◆ ~Abstract_File()

virtual joedb::Abstract_File::~Abstract_File ( )
virtualdefault

Member Function Documentation

◆ datasync()

virtual void joedb::Abstract_File::datasync ( )
inlinevirtual

Definition at line 29 of file Abstract_File.h.

◆ exclusive_lock()

virtual void joedb::Abstract_File::exclusive_lock ( int64_t  start,
int64_t  size 
)
inlinevirtual

Reimplemented in joedb::Posix_FD, and joedb::Windows_Handle.

Definition at line 35 of file Abstract_File.h.

◆ get_size()

virtual int64_t joedb::Abstract_File::get_size ( ) const
inlinevirtual

◆ pread()

virtual size_t joedb::Abstract_File::pread ( char *  data,
size_t  size,
int64_t  offset 
) const
inlinevirtual

The returned value may be less than size, even if the end of the file is not reached. 0 is returned if the end of the file is reached.

Reimplemented in joedb::Encoded_File, joedb::Memory_File, joedb::Posix_FD, joedb::Readonly_Encoded_File, joedb::Readonly_Memory_File, joedb::Server_File, joedb::File_View, joedb::SFTP_File, joedb::Stream_File, and joedb::Windows_Handle.

Definition at line 20 of file Abstract_File.h.

◆ pwrite()

virtual void joedb::Abstract_File::pwrite ( const char *  data,
size_t  size,
int64_t  offset 
)
inlinevirtual

◆ shared_lock()

virtual void joedb::Abstract_File::shared_lock ( int64_t  start,
int64_t  size 
)
inlinevirtual

Reimplemented in joedb::Posix_FD, and joedb::Windows_Handle.

Definition at line 32 of file Abstract_File.h.

◆ sync()

virtual void joedb::Abstract_File::sync ( )
inlinevirtual

Reimplemented in joedb::Encoded_File, joedb::Posix_FD, and joedb::Windows_Handle.

Definition at line 26 of file Abstract_File.h.

◆ unlock()

virtual void joedb::Abstract_File::unlock ( int64_t  start,
int64_t  size 
)
inlinevirtualnoexcept

Reimplemented in joedb::Posix_FD, and joedb::Windows_Handle.

Definition at line 38 of file Abstract_File.h.


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