Public Member Functions | Private Attributes | List of all members
om::HistoSHM Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/OnlineMonitoring/viewer/HistoSource.h"

Inheritance diagram for om::HistoSHM:
om::HistoSourceBase

Public Member Functions

 HistoSHM (const char *n)
 
 ~HistoSHM ()
 
void SetName (const char *nm)
 Set the source name. More...
 
TH1F * GetTH1FCopy (const char *n)
 
TH2F * GetTH2FCopy (const char *n)
 
void GetHistogramList (std::list< std::string > &h)
 Get a list of all histograms held by this source. More...
 
void GetStatus (std::string &nm, unsigned int *run, unsigned int *subrun, unsigned int *event, pid_t *pid, long *stime, long *utime, long *cpu, long *rsize, time_t *t)
 Get the histogram server status. More...
 
void FindAllMatches (const char *include_pattern, const char *exclude_pattern, std::list< std::string > &objs)
 

Private Attributes

IPCfIPC
 Shared memory handler. More...
 

Detailed Description

Histograms from a shared memory segment

Definition at line 80 of file HistoSource.h.

Constructor & Destructor Documentation

HistoSHM::HistoSHM ( const char *  n)

Definition at line 86 of file HistoSource.cxx.

References SetName().

86  : fIPC(0)
87 {
88  this->SetName(n);
89 }
IPC * fIPC
Shared memory handler.
Definition: HistoSource.h:101
void SetName(const char *nm)
Set the source name.
HistoSHM::~HistoSHM ( )

Definition at line 93 of file HistoSource.cxx.

References fIPC.

94 {
95  if (fIPC) { delete fIPC; fIPC = 0; }
96 }
IPC * fIPC
Shared memory handler.
Definition: HistoSource.h:101

Member Function Documentation

void HistoSourceBase::FindAllMatches ( const char *  include_pattern,
const char *  exclude_pattern,
std::list< std::string > &  objs 
)
inherited

Return the names of all objects in the file who's names match a particular set of patterns

Parameters
include_pattern- Names must match this expression
exclude_pattern- Names must not match this expression
objs- List of object names that satisfy the above

Definition at line 10 of file HistoSource.cxx.

References om::HistoSourceBase::GetHistogramList(), make_syst_table_plots::h, MECModelEnuComparisons::i, in, om::regex_match(), and string.

Referenced by om::HistoSourceBase::GetStatus().

13 {
14  std::string include_p(include_pattern);
15  std::string exclude_p(exclude_pattern);
16  bool in, ex;
17 
18  std::list<std::string> h;
19  this->GetHistogramList(h);
20 
21  std::list<std::string>::iterator i(h.begin());
22  std::list<std::string>::iterator iend(h.end());
23  for (; i!=iend; ++i) {
24  in = (regex_match(*i, include_p)==0);
25  ex = (regex_match(*i, exclude_p)==0);
26  if (in && !ex) objs.push_back(*i);
27  }
28 }
virtual void GetHistogramList(std::list< std::string > &h)=0
Get a list of all histograms held by this source.
ifstream in
Definition: comparison.C:7
int regex_match(const std::string &s, const std::string &p)
Definition: RegexMatch.cxx:7
enum BeamMode string
void HistoSHM::GetHistogramList ( std::list< std::string > &  h)
virtual

Get a list of all histograms held by this source.

Implements om::HistoSourceBase.

Definition at line 147 of file HistoSource.cxx.

References fIPC, and om::IPC::RequestHistoList().

148 {
150 }
int RequestHistoList(std::list< std::string > &hlist)
Definition: IPC.cxx:225
IPC * fIPC
Shared memory handler.
Definition: HistoSource.h:101
void HistoSHM::GetStatus ( std::string nm,
unsigned int run,
unsigned int subrun,
unsigned int event,
pid_t *  pid,
long *  stime,
long *  utime,
long *  cpu,
long *  rsize,
time_t *  t 
)
virtual

Get the histogram server status.

Reimplemented from om::HistoSourceBase.

Definition at line 100 of file HistoSource.cxx.

References om::ProducerResources::fCLOCK, om::ProducerResources::fCPU, om::ProducerResources::fEvent, fIPC, om::IPC::fIPC, om::ProducerResources::fPID, om::IPCBlock::fProcessResources, om::ProducerResources::fRSIZE, om::ProducerResources::fRun, om::IPC::fShmHdl, om::ProducerResources::fSTIME, om::ProducerResources::fSubrun, and om::ProducerResources::fUTIME.

110 {
111  nm = fIPC->fShmHdl;
114  if (event) *event = fIPC->fIPC->fProcessResources.fEvent;
117  if (utime) *utime = fIPC->fIPC->fProcessResources.fUTIME;
118  if (cpu) *cpu = fIPC->fIPC->fProcessResources.fCPU;
119  if (rsize) *rsize = fIPC->fIPC->fProcessResources.fRSIZE;
120  if (t) *t = fIPC->fIPC->fProcessResources.fCLOCK;
121 }
unsigned int fSubrun
Subrun number of last update.
Definition: IPCBlock.h:39
long fSTIME
System time.
Definition: IPCBlock.h:42
time_t fCLOCK
Time of update.
Definition: IPCBlock.h:46
long fCPU
Process CPU usage.
Definition: IPCBlock.h:44
long fRSIZE
Process size.
Definition: IPCBlock.h:45
static constexpr Double_t nm
Definition: Munits.h:133
struct IPCBlock * fIPC
Pointer to struct.
Definition: IPC.h:151
IPC * fIPC
Shared memory handler.
Definition: HistoSource.h:101
char fShmHdl[kHdlSz]
Shared memory handle.
Definition: IPC.h:149
pid_t fPID
Process ID.
Definition: IPCBlock.h:41
unsigned int fRun
Run number of last update.
Definition: IPCBlock.h:38
Definition: run.py:1
unsigned int fEvent
Event number of last update.
Definition: IPCBlock.h:40
long fUTIME
User time.
Definition: IPCBlock.h:43
ProducerResources fProcessResources
Definition: IPCBlock.h:131
TH1F * HistoSHM::GetTH1FCopy ( const char *  n)
virtual

Read a copy of a named histogram into memory. User accepts ownership and responsibility for deletetion

Implements om::HistoSourceBase.

Definition at line 133 of file HistoSource.cxx.

References fIPC, and om::IPC::RequestTH1F().

134 {
135  return fIPC->RequestTH1F(n);
136 }
IPC * fIPC
Shared memory handler.
Definition: HistoSource.h:101
TH1F * RequestTH1F(const char *n)
Definition: IPC.cxx:109
TH2F * HistoSHM::GetTH2FCopy ( const char *  n)
virtual

Read a copy of a named histogram into memory. User accepts ownership and responsibility for deletion.

Implements om::HistoSourceBase.

Definition at line 140 of file HistoSource.cxx.

References fIPC, and om::IPC::RequestTH2F().

141 {
142  return fIPC->RequestTH2F(n);
143 }
IPC * fIPC
Shared memory handler.
Definition: HistoSource.h:101
TH2F * RequestTH2F(const char *n)
Definition: IPC.cxx:165
void HistoSHM::SetName ( const char *  nm)
virtual

Set the source name.

Implements om::HistoSourceBase.

Definition at line 125 of file HistoSource.cxx.

References fIPC, and om::kIPC_CLIENT.

Referenced by HistoSHM().

126 {
127  if (fIPC) { delete fIPC; fIPC=0; }
128  fIPC = new IPC(kIPC_CLIENT, nm);
129 }
static constexpr Double_t nm
Definition: Munits.h:133
static const int kIPC_CLIENT
Definition: IPC.h:24
IPC * fIPC
Shared memory handler.
Definition: HistoSource.h:101
Definition: IPC.h:29

Member Data Documentation

IPC* om::HistoSHM::fIPC
private

Shared memory handler.

Definition at line 101 of file HistoSource.h.

Referenced by GetHistogramList(), GetStatus(), GetTH1FCopy(), GetTH2FCopy(), SetName(), and ~HistoSHM().


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