QMonitorConfigHandler Class Reference

List of all members.


Detailed Description

encapsulates operations for online monitor histograms configuration

Author:
Sergio Di Domizio

Public Member Functions

 QMonitorConfigHandler ()
 ctor
virtual ~QMonitorConfigHandler ()
 dtor
void SetLockFile (const std::string &fileName)
 set lockfile name
void SetCfg (const std::string &fileName)
 set name of cfg file
bool SetDataPath (const std::string &path)
void SetLgChannel (UInt_t lgChannel)
 set logical channel to be written to cfg
bool WriteCfg (bool force)
 updates config file with new informations
bool CheckLockFile ()
bool DumpLockFile ()
 create lock file and set permission to 666
bool UnlinkLockFile ()
 remove lock file
bool Inhibit ()
 inhibit communication mechanism by removing lock file and cfgfile
const QErrorGetError () const
bool CfgUpdated (bool &updated, Int_t &channel)
 check whether cfg was updated since it was read

Private Member Functions

void ResetError ()

Private Attributes

QError fError
UInt_t fLgCh
std::string fLockFileName
std::string fCfgFileName
std::string fPath
time_t fLastUpdate

Member Function Documentation

bool QMonitorConfigHandler::SetDataPath ( const std::string &  path  ) 

set directory containing monitor files

References fPath, ResetError(), and QError::Set().

bool QMonitorConfigHandler::WriteCfg ( bool  force  ) 

updates config file with new informations

Parameters:
force whether or not to force root file update even if no new events occurred on current channel
Returns:
true on success

References DumpLockFile(), fCfgFileName, fLgCh, ResetError(), QError::Set(), and UnlinkLockFile().

Referenced by QGUIHistogramHandler::ForceUpdate(), and QGUIHistogramHandler::SetChannel().

bool QMonitorConfigHandler::CheckLockFile (  ) 

Returns:
true if lockFile exists, false otherwise

References fLockFileName.

Referenced by CfgUpdated(), and QGUIHistogramHandler::CheckUpdate().

bool QMonitorConfigHandler::DumpLockFile (  ) 

create lock file and set permission to 666

Returns:
true on success

References fLockFileName, ResetError(), and QError::Set().

Referenced by QGUIHistogramHandler::CheckUpdate(), and WriteCfg().

bool QMonitorConfigHandler::UnlinkLockFile (  ) 

remove lock file

Returns:
true on success of if file does not exist, false in case of any other error

References fLockFileName, and QError::Set().

Referenced by MApolloHistoMaker::UpdateFile(), and WriteCfg().

bool QMonitorConfigHandler::Inhibit (  ) 

inhibit communication mechanism by removing lock file and cfgfile

Returns:
true on success

References fCfgFileName, and fLockFileName.

Referenced by QGUIHistogramHandler::Inhibit().

bool QMonitorConfigHandler::CfgUpdated ( bool &  updated,
Int_t &  channel 
)

check whether cfg was updated since it was read

Parameters:
updated is filled with cfg status
channel is filled with new channel read from cfg
Returns:
true on success

References CheckLockFile(), fCfgFileName, and QError::Set().

Referenced by MApolloHistoMaker::Do().

void QMonitorConfigHandler::ResetError (  )  [inline, private]


Member Data Documentation

UInt_t QMonitorConfigHandler::fLgCh [private]

logical channel

Referenced by SetLgChannel(), and WriteCfg().

std::string QMonitorConfigHandler::fLockFileName [private]

lockfile name (including path)

Referenced by CheckLockFile(), DumpLockFile(), Inhibit(), SetLockFile(), UnlinkLockFile(), and ~QMonitorConfigHandler().

std::string QMonitorConfigHandler::fCfgFileName [private]

cfg file name (including path)

Referenced by CfgUpdated(), Inhibit(), SetCfg(), and WriteCfg().

std::string QMonitorConfigHandler::fPath [private]

name of directory containing monitor files

Referenced by SetDataPath().


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

Generated on Tue Nov 16 10:50:07 2010 for CUORE Software by  doxygen 1.5.6