Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RefCountFile Class Reference

Class that represents a reference count file. More...

#include <RefCountFile.h>

Public Member Functions

 RefCountFile (std::string file)
 
bool IsOpen () const
 
const std::string & GetFilePath () const
 
void Lock ()
 
void Unlock ()
 
void Reset ()
 Reset the reference count in the file if it is not 0.
 
int Increment ()
 Increment the reference count in the file.
 
int Decrement ()
 Decrement the reference count in the file.
 

Private Member Functions

int Read ()
 Read the reference count file. More...
 
void Close ()
 Close the file descriptor if it's not already closed.
 
int Write (int ref)
 Write the reference count to file. More...
 

Private Attributes

std::string mFilePath
 
int mFd
 
bool mOpen
 

Detailed Description

Class that represents a reference count file.

This class is only intended to be used internally by Storage plugin do not use from external code.

See also
Storage

Member Function Documentation

◆ Read()

int RefCountFile::Read ( )
private

Read the reference count file.

Returns
reference count

◆ Write()

int RefCountFile::Write ( int  ref)
private

Write the reference count to file.

Returns
reference count

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