MIDAS
Loading...
Searching...
No Matches
bm_lock_buffer_guard Class Reference
Collaboration diagram for bm_lock_buffer_guard:

Public Member Functions

 bm_lock_buffer_guard (BUFFER *pbuf, bool do_not_lock=false)
 
 ~bm_lock_buffer_guard ()
 
 bm_lock_buffer_guard (const bm_lock_buffer_guard &)=delete
 
bm_lock_buffer_guardoperator= (const bm_lock_buffer_guard &)=delete
 
void unlock ()
 
bool relock ()
 
void invalidate ()
 
bool is_locked () const
 
bool is_error () const
 
int get_status () const
 
BUFFERget_pbuf () const
 

Public Attributes

bool fDebug = false
 

Private Attributes

BUFFERfBuf = NULL
 
bool fLocked = false
 
bool fError = false
 
bool fInvalid = false
 
int fStatus = 0
 

Detailed Description

Definition at line 3094 of file midas.cxx.

Constructor & Destructor Documentation

◆ bm_lock_buffer_guard() [1/2]

bm_lock_buffer_guard::bm_lock_buffer_guard ( BUFFER pbuf,
bool  do_not_lock = false 
)
inline

Definition at line 3100 of file midas.cxx.

3101 {
3102 assert(pbuf != NULL);
3103 fBuf = pbuf;
3104 if (do_not_lock) {
3105 if (fDebug)
3106 printf("lock_buffer_guard(%s) ctor without lock\n", fBuf->buffer_name);
3107 return;
3108 }
3109 if (fDebug)
3110 printf("lock_buffer_guard(%s) ctor\n", fBuf->buffer_name);
3112 if (status != BM_SUCCESS) {
3113 fLocked = false;
3114 fError = true;
3115 fStatus = status;
3116 } else {
3117 fLocked = true;
3118 }
3119 }
static int xbm_lock_buffer(BUFFER *pbuf)
Definition midas.cxx:7985
#define BM_SUCCESS
Definition midas.h:605
DWORD status
Definition odbhist.cxx:39
char buffer_name[NAME_LENGTH]
Definition midas.h:992
Here is the call graph for this function:

◆ ~bm_lock_buffer_guard()

bm_lock_buffer_guard::~bm_lock_buffer_guard ( )
inline

Definition at line 3121 of file midas.cxx.

3122 {
3123 if (fInvalid) {
3124 if (fDebug)
3125 printf("lock_buffer_guard(invalid) dtor\n");
3126 } else {
3127 assert(fBuf != NULL);
3128 if (fDebug)
3129 printf("lock_buffer_guard(%s) dtor, locked %d, error %d\n", fBuf->buffer_name, fLocked, fError);
3130 if (fLocked) {
3132 fLocked = false;
3133 fError = false;
3134 }
3135 fBuf = NULL;
3136 }
3137 }
static void xbm_unlock_buffer(BUFFER *pbuf)
Definition midas.cxx:8047
Here is the call graph for this function:

◆ bm_lock_buffer_guard() [2/2]

bm_lock_buffer_guard::bm_lock_buffer_guard ( const bm_lock_buffer_guard )
delete

Member Function Documentation

◆ get_pbuf()

BUFFER * bm_lock_buffer_guard::get_pbuf ( ) const
inline

Definition at line 3196 of file midas.cxx.

3197 {
3198 assert(!fInvalid); // pbuf was deleted
3199 assert(fBuf); // we do not return NULL
3200 return fBuf;
3201 }
Here is the caller graph for this function:

◆ get_status()

int bm_lock_buffer_guard::get_status ( ) const
inline

Definition at line 3191 of file midas.cxx.

3192 {
3193 return fStatus;
3194 }
Here is the caller graph for this function:

◆ invalidate()

void bm_lock_buffer_guard::invalidate ( )
inline

Definition at line 3171 of file midas.cxx.

3172 {
3173 assert(fBuf != NULL);
3174 if (fDebug)
3175 printf("lock_buffer_guard(%s) invalidate, locked %d, error %d\n", fBuf->buffer_name, fLocked, fError);
3176 assert(!fLocked);
3177 fInvalid = true;
3178 fBuf = NULL;
3179 }
Here is the caller graph for this function:

◆ is_error()

bool bm_lock_buffer_guard::is_error ( ) const
inline

Definition at line 3186 of file midas.cxx.

3187 {
3188 return fError;
3189 }

◆ is_locked()

bool bm_lock_buffer_guard::is_locked ( ) const
inline

Definition at line 3181 of file midas.cxx.

3182 {
3183 return fLocked;
3184 }
Here is the caller graph for this function:

◆ operator=()

bm_lock_buffer_guard & bm_lock_buffer_guard::operator= ( const bm_lock_buffer_guard )
delete

◆ relock()

bool bm_lock_buffer_guard::relock ( )
inline

Definition at line 3154 of file midas.cxx.

3155 {
3156 assert(fBuf != NULL);
3157 if (fDebug)
3158 printf("lock_buffer_guard(%s) relock, locked %d, error %d\n", fBuf->buffer_name, fLocked, fError);
3159 assert(!fLocked);
3161 if (status != BM_SUCCESS) {
3162 fLocked = false;
3163 fError = true;
3164 fStatus = status;
3165 } else {
3166 fLocked = true;
3167 }
3168 return fLocked;
3169 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unlock()

void bm_lock_buffer_guard::unlock ( )
inline

Definition at line 3143 of file midas.cxx.

3144 {
3145 assert(fBuf != NULL);
3146 if (fDebug)
3147 printf("lock_buffer_guard(%s) unlock, locked %d, error %d\n", fBuf->buffer_name, fLocked, fError);
3148 assert(fLocked);
3150 fLocked = false;
3151 fError = false;
3152 }
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fBuf

BUFFER* bm_lock_buffer_guard::fBuf = NULL
private

Definition at line 3204 of file midas.cxx.

◆ fDebug

bool bm_lock_buffer_guard::fDebug = false

Definition at line 3097 of file midas.cxx.

◆ fError

bool bm_lock_buffer_guard::fError = false
private

Definition at line 3206 of file midas.cxx.

◆ fInvalid

bool bm_lock_buffer_guard::fInvalid = false
private

Definition at line 3207 of file midas.cxx.

◆ fLocked

bool bm_lock_buffer_guard::fLocked = false
private

Definition at line 3205 of file midas.cxx.

◆ fStatus

int bm_lock_buffer_guard::fStatus = 0
private

Definition at line 3208 of file midas.cxx.


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