Smart FileDescriptor. More...
#include <swcdb/fs/SmartFd.h>
Public Types | |
typedef std::shared_ptr< SmartFd > | Ptr |
Public Member Functions | |
SWC_CAN_INLINE | SmartFd (const std::string &filepath, uint32_t flags, int32_t fd=-1, uint64_t pos=0) |
SWC_CAN_INLINE | SmartFd (std::string &&filepath, uint32_t flags, int32_t fd=-1, uint64_t pos=0) noexcept |
virtual | ~SmartFd () noexcept |
constexpr SWC_CAN_INLINE const std::string & | filepath () const noexcept |
constexpr SWC_CAN_INLINE void | flags (uint32_t flags) noexcept |
constexpr SWC_CAN_INLINE uint32_t | flags () const noexcept |
constexpr SWC_CAN_INLINE void | fd (int32_t fd) noexcept |
constexpr SWC_CAN_INLINE int32_t | fd () const noexcept |
constexpr SWC_CAN_INLINE bool | valid () const noexcept |
constexpr SWC_CAN_INLINE int32_t | invalidate () noexcept |
constexpr SWC_CAN_INLINE void | pos (uint64_t pos) noexcept |
constexpr SWC_CAN_INLINE uint64_t | pos () const noexcept |
constexpr SWC_CAN_INLINE void | forward (uint64_t nbytes) noexcept |
std::string | to_string () const |
void | print (std::ostream &out) const |
Static Public Member Functions | |
static SWC_CAN_INLINE Ptr | make_ptr (const std::string &filepath, uint32_t flags, int32_t fd=-1, uint64_t pos=0) |
static SWC_CAN_INLINE Ptr | make_ptr (std::string &&filepath, uint32_t flags, int32_t fd=-1, uint64_t pos=0) |
Protected Attributes | |
const std::string | m_filepath |
Private Attributes | |
Core::Atomic< uint32_t > | m_flags |
Core::Atomic< int32_t > | m_fd |
Core::Atomic< uint64_t > | m_pos |
typedef std::shared_ptr<SmartFd> SWC::FS::SmartFd::Ptr |
|
inline |
Definition at line 52 of file SmartFd.h.
Referenced by make_ptr().
|
inlinenoexcept |
|
virtualnoexcept |
Definition at line 13 of file SmartFd.cc.
|
inlineconstexprnoexcept |
Definition at line 87 of file SmartFd.h.
References m_fd.
Referenced by fd(), and make_ptr().
|
inlineconstexprnoexcept |
Definition at line 82 of file SmartFd.h.
References fd(), m_fd, and SWC::Core::AtomicBase< T, OrderT >::store().
|
inlineconstexprnoexcept |
Definition at line 67 of file SmartFd.h.
References m_filepath.
Referenced by SWC::FS::FileSystemHadoop::SmartFdHadoop::make_ptr(), SWC::FS::FileSystemHadoopJVM::SmartFdHadoopJVM::make_ptr(), and make_ptr().
|
inlineconstexprnoexcept |
Definition at line 77 of file SmartFd.h.
References m_flags.
Referenced by flags(), SWC::FS::FileSystemHadoop::SmartFdHadoop::make_ptr(), SWC::FS::FileSystemHadoopJVM::SmartFdHadoopJVM::make_ptr(), and make_ptr().
|
inlineconstexprnoexcept |
Definition at line 72 of file SmartFd.h.
References flags(), m_flags, and SWC::Core::AtomicBase< T, OrderT >::store().
|
inlineconstexprnoexcept |
Definition at line 113 of file SmartFd.h.
References SWC::Core::Atomic< T, OrderT >::fetch_add(), and m_pos.
|
inlineconstexprnoexcept |
Definition at line 97 of file SmartFd.h.
References SWC::Core::AtomicBase< T, OrderT >::exchange(), m_fd, m_pos, and SWC::Core::AtomicBase< T, OrderT >::store().
|
inlinestatic |
Definition at line 40 of file SmartFd.h.
References fd(), filepath(), flags(), pos(), and SmartFd().
Referenced by SWC::Ranger::CellStore::Read::close(), SWC::Comm::Protocol::FsBroker::Handler::create(), SWC::FS::FileSystem::default_read(), SWC::Comm::Protocol::FsBroker::Params::CombiPreadReq::internal_decode(), SWC::Ranger::CellStore::Read::make(), SWC::Ranger::CommitLog::Fragment::make_read(), SWC::Ranger::CommitLog::Fragment::make_write(), SWC::Comm::Protocol::FsBroker::Handler::open(), SWC::Ranger::RangeData::save(), SWC::Common::Files::Schema::save(), SWC::Common::Files::RgrData::set_rgr(), SWC::Manager::Schemas::store_create(), SWC::Manager::Schemas::store_load(), SWC::Ranger::CommitLog::Fragments::take_ownership(), and SWC::Comm::Protocol::FsBroker::Handler::write().
|
inlinestatic |
|
inlineconstexprnoexcept |
Definition at line 108 of file SmartFd.h.
References m_pos.
Referenced by make_ptr(), and pos().
|
inlineconstexprnoexcept |
Definition at line 103 of file SmartFd.h.
References m_pos, pos(), and SWC::Core::AtomicBase< T, OrderT >::store().
void SWC::FS::SmartFd::print | ( | std::ostream & | out | ) | const |
Definition at line 20 of file SmartFd.cc.
References SWC::Core::AtomicBase< T, OrderT >::load(), m_fd, m_filepath, m_flags, and m_pos.
std::string SWC::FS::SmartFd::to_string | ( | ) | const |
Definition at line 15 of file SmartFd.cc.
References SWC::format(), SWC::Core::AtomicBase< T, OrderT >::load(), m_fd, m_filepath, m_flags, m_pos, and SWC_FMT_LU.
|
inlineconstexprnoexcept |
|
private |
Definition at line 128 of file SmartFd.h.
Referenced by fd(), invalidate(), print(), to_string(), and valid().
|
protected |
Definition at line 123 of file SmartFd.h.
Referenced by filepath(), print(), and to_string().
|
private |
Definition at line 127 of file SmartFd.h.
Referenced by flags(), print(), and to_string().
|
private |
Definition at line 129 of file SmartFd.h.
Referenced by forward(), invalidate(), pos(), print(), and to_string().