CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UnlinkGuard Class Reference

#include <file_guard.h>

Inheritance diagram for UnlinkGuard:
Collaboration diagram for UnlinkGuard:

Public Types

enum  InitialState { kEnabled, kDisabled }
 

Public Member Functions

 UnlinkGuard ()
 
 UnlinkGuard (const std::string &path, const InitialState state=kEnabled)
 
 ~UnlinkGuard ()
 
void Set (const std::string &path)
 
bool IsEnabled () const
 
void Enable ()
 
void Disable ()
 
const std::string & path () const
 

Private Attributes

std::string path_
 
bool enabled_
 

Additional Inherited Members

- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Detailed Description

This file is part of the CernVM File System. RAII object to call unlink() on a containing file when it gets out of scope

Definition at line 23 of file file_guard.h.

Member Enumeration Documentation

Enumerator
kEnabled 
kDisabled 

Definition at line 25 of file file_guard.h.

Constructor & Destructor Documentation

UnlinkGuard::UnlinkGuard ( )
inline

Definition at line 27 of file file_guard.h.

UnlinkGuard::UnlinkGuard ( const std::string &  path,
const InitialState  state = kEnabled 
)
inlineexplicit

Definition at line 28 of file file_guard.h.

UnlinkGuard::~UnlinkGuard ( )
inline

Definition at line 32 of file file_guard.h.

Member Function Documentation

void UnlinkGuard::Disable ( )
inline

Definition at line 38 of file file_guard.h.

Referenced by swissknife::CommandTag::CloseAndPublishHistory(), and sqlite::Database< DerivedT >::DatabaseRaiiWrapper::DropFileOwnership().

Here is the caller graph for this function:

void UnlinkGuard::Enable ( )
inline

Definition at line 37 of file file_guard.h.

Referenced by sqlite::Database< DerivedT >::DatabaseRaiiWrapper::TakeFileOwnership().

Here is the caller graph for this function:

bool UnlinkGuard::IsEnabled ( ) const
inline

Definition at line 36 of file file_guard.h.

Referenced by sqlite::Database< DerivedT >::DatabaseRaiiWrapper::OwnsFile().

Here is the caller graph for this function:

const std::string& UnlinkGuard::path ( ) const
inline
void UnlinkGuard::Set ( const std::string &  path)
inline

Definition at line 34 of file file_guard.h.

Member Data Documentation

bool UnlinkGuard::enabled_
private

Definition at line 44 of file file_guard.h.

std::string UnlinkGuard::path_
private

Definition at line 43 of file file_guard.h.


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