Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Euclid::FilePool::FileAccessor< TFD > Class Template Reference

#include <FileAccessor.h>

Inheritance diagram for Euclid::FilePool::FileAccessor< TFD >:
Inheritance graph
[legend]
Collaboration diagram for Euclid::FilePool::FileAccessor< TFD >:
Collaboration graph
[legend]

Public Types

using ReleaseDescriptorCallback = std::function< void(TFD &&)>
 
- Public Types inherited from Euclid::FilePool::FileAccessorBase
using SharedMutex = boost::shared_mutex
 
using SharedLock = boost::shared_lock< SharedMutex >
 
using UniqueLock = boost::unique_lock< SharedMutex >
 
using UpgradeLock = boost::upgrade_lock< SharedMutex >
 
using UpgradeToUniqueLock = boost::upgrade_to_unique_lock< SharedMutex >
 

Public Member Functions

virtual ~FileAccessor ()=default
 Destructor.
 
- Public Member Functions inherited from Euclid::FilePool::FileAccessorBase
virtual ~FileAccessorBase ()=default
 
virtual bool isReadOnly () const =0
 

Public Attributes

TFD m_fd
 The wrapped file descriptor.
 

Protected Member Functions

 FileAccessor (TFD &&fd, ReleaseDescriptorCallback release_callback)
 

Protected Attributes

ReleaseDescriptorCallback m_release_callback
 

Detailed Description

template<typename TFD>
class Euclid::FilePool::FileAccessor< TFD >

Wraps a file descriptor, so when the instance is destroyed, the callback is called with the wrapped descriptor moved-in

Template Parameters
TFDFile descriptor type

This is a base class that hides away if the accessor is read-only or write-only, as the locking mechanisms in each case should not bother the calling code

Definition at line 54 of file FileAccessor.h.

Member Typedef Documentation

◆ ReleaseDescriptorCallback

template<typename TFD >
using Euclid::FilePool::FileAccessor< TFD >::ReleaseDescriptorCallback = std::function<void(TFD&&)>

Definition at line 56 of file FileAccessor.h.

Constructor & Destructor Documentation

◆ ~FileAccessor()

template<typename TFD >
virtual Euclid::FilePool::FileAccessor< TFD >::~FileAccessor ( )
virtualdefault

Destructor.

◆ FileAccessor()

template<typename TFD >
Euclid::FilePool::FileAccessor< TFD >::FileAccessor ( TFD &&  fd,
ReleaseDescriptorCallback  release_callback 
)
protected

Member Data Documentation

◆ m_fd

template<typename TFD >
TFD Euclid::FilePool::FileAccessor< TFD >::m_fd

The wrapped file descriptor.

Definition at line 59 of file FileAccessor.h.

◆ m_release_callback

template<typename TFD >
ReleaseDescriptorCallback Euclid::FilePool::FileAccessor< TFD >::m_release_callback
protected

Definition at line 67 of file FileAccessor.h.


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