HOPS
HOPS class reference
Public Member Functions | Static Public Member Functions | List of all members
hops::MHO_LockFileHandler Class Reference

Class MHO_LockFileHandler uses the singleton pattern. More...

#include <MHO_LockFileHandler.hh>

Public Member Functions

 MHO_LockFileHandler (MHO_LockFileHandler &&)=delete
 
 MHO_LockFileHandler (MHO_LockFileHandler const &)=delete
 
void DisableLegacyMode ()
 Disables legacy mode by setting fEnableLegacyMode to false. More...
 
void EnableLegacyMode ()
 configure the lock handler to write legacy type_2xx file (e.g. GE.X.1.ABCDEF) naming convention. or to use the new file naming convention (.frng extension) legacy mode is enabled by default More...
 
MHO_LockFileHandleroperator= (MHO_LockFileHandler &&)=delete
 
MHO_LockFileHandleroperator= (MHO_LockFileHandler const &)=delete
 
void RemoveWriteLock ()
 Removes a write lock from the file. More...
 
int WaitForWriteLock (std::string directory, int &next_seq_no)
 Waits for and acquires a write lock on the specified directory, setting it as the current directory. More...
 

Static Public Member Functions

static MHO_LockFileHandlerGetInstance ()
 provide public access to the only static instance More...
 

Detailed Description

Class MHO_LockFileHandler uses the singleton pattern.

ported version of fourfit write lock mechanism the only three functions user needs to call via the instance: (1) enable/disable legacy mode (2) wait for lock

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Tue Jan 30 23:48:59 2024 -0500
  • write out the data file (3) remove lock

Constructor & Destructor Documentation

◆ MHO_LockFileHandler() [1/2]

hops::MHO_LockFileHandler::MHO_LockFileHandler ( MHO_LockFileHandler const &  )
delete

◆ MHO_LockFileHandler() [2/2]

hops::MHO_LockFileHandler::MHO_LockFileHandler ( MHO_LockFileHandler &&  )
delete

Member Function Documentation

◆ DisableLegacyMode()

void hops::MHO_LockFileHandler::DisableLegacyMode ( )
inline

Disables legacy mode by setting fEnableLegacyMode to false.

◆ EnableLegacyMode()

void hops::MHO_LockFileHandler::EnableLegacyMode ( )
inline

configure the lock handler to write legacy type_2xx file (e.g. GE.X.1.ABCDEF) naming convention. or to use the new file naming convention (.frng extension) legacy mode is enabled by default

◆ GetInstance()

static MHO_LockFileHandler& hops::MHO_LockFileHandler::GetInstance ( )
inlinestatic

provide public access to the only static instance

Returns
Reference to the singleton instance of MHO_LockFileHandler
Note
This is a static function.

◆ operator=() [1/2]

MHO_LockFileHandler& hops::MHO_LockFileHandler::operator= ( MHO_LockFileHandler &&  )
delete

◆ operator=() [2/2]

MHO_LockFileHandler& hops::MHO_LockFileHandler::operator= ( MHO_LockFileHandler const &  )
delete

◆ RemoveWriteLock()

void hops::MHO_LockFileHandler::RemoveWriteLock ( )

Removes a write lock from the file.

◆ WaitForWriteLock()

int hops::MHO_LockFileHandler::WaitForWriteLock ( std::string  directory,
int &  next_seq_no 
)

Waits for and acquires a write lock on the specified directory, setting it as the current directory.

Parameters
directoryThe directory to acquire the write lock on.
next_seq_no(int&)
Returns
An integer representing the result of the operation.

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