CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
memory Class Reference

#include <vlib.h>

Public Member Functions

 memory ()
 
Signaloperator[] (Signal)
 
void reg (int, int, int, int, const char *)
 
void reg (int nup, int ndown, const char *rname)
 
 ~memory ()
 

Protected Attributes

int down
 
Signalr
 
int up
 

Detailed Description

Definition at line 186 of file vlib.h.

Constructor & Destructor Documentation

memory::memory ( )
inline

Definition at line 189 of file vlib.h.

References NULL, and r.

189 {r = NULL;};
#define NULL
Definition: scimark2.h:8
Signal * r
Definition: vlib.h:203
memory::~memory ( )

Definition at line 953 of file vlib.cc.

References NULL, and r.

954 {
955  if (r != NULL) delete [] r;
956  r = NULL;
957 }
#define NULL
Definition: scimark2.h:8
Signal * r
Definition: vlib.h:203

Member Function Documentation

Signal & memory::operator[] ( Signal  i)

Definition at line 962 of file vlib.cc.

References dbgmsg, Signal::getval(), mergeVDriftHistosByStation::name, and alignCSCRings::r.

964 {
965 #ifdef VGEN
966  string ln;
967  ln = name + "[" + i.getname() + "]";
968  r[0].setname(ln);
969  r[0].setorname(ln);
970  return r[0];
971 #else
972  rval ind = i.getval();
973 #ifdef _VDEBUG
974  if (ind < down || ind > up)
975  {
976  dbgmsg("Memory index out of range: index: " << ind << ", range: [" << up << ":" << down << "]. ");
977  return r[down];
978  }
979  else
980 #endif
981  return r[ind - down];
982 #endif
983 }
int down
Definition: vlib.h:204
rval getval()
Definition: vlib.cc:481
#define dbgmsg(a)
Definition: vlib.cc:21
int up
Definition: vlib.h:204
unsigned long long int rval
Definition: vlib.h:22
Signal * r
Definition: vlib.h:203
void memory::reg ( int  high,
int  low,
int  nup,
int  ndown,
const char *  rname 
)

Definition at line 917 of file vlib.cc.

References gather_cfg::cout, down, i, Signal::initreg(), mergeVDriftHistosByStation::name, NULL, r, Signal::setr(), and up.

918 {
919  int i;
920  if (nup > ndown)
921  {
922  up = nup;
923  down = ndown;
924  }
925  else
926  {
927  up = ndown;
928  down = nup;
929  }
930  if (r == NULL)
931  {
932  r = new Signal [up - down + 1];
933  for (i = 0; i <= up - down; ++i)
934  {
935  r[i].initreg(high, low, "");
936  r[i].setr(0);
937  }
938  }
939  else
940  {
941  for (i = 0; i <= up - down; ++i)
942  {
943  r[i].initreg(high, low, "");
944  }
945  }
946 #ifdef VGEN
947  name = rname;
948  if (high == low) std::cout << glc.getmargin() << "reg " << name << " [" << dec << up << ":" << down << "]" << ";\n" << flush;
949  else std::cout << glc.getmargin() << "reg " << "[" << dec << high << ":" << low << "] "<< name << " [" << dec << up << ":" << down << "]" << ";\n" << flush;
950 #endif
951 }
int i
Definition: DBlmapReader.cc:9
void setr(rval rv)
Definition: vlib.h:66
int down
Definition: vlib.h:204
#define NULL
Definition: scimark2.h:8
int up
Definition: vlib.h:204
void initreg(int, int, const char *)
Definition: vlib.cc:837
globcontrol glc
Definition: vlib.cc:6
Signal * r
Definition: vlib.h:203
tuple cout
Definition: gather_cfg.py:121
Definition: vlib.h:39
void memory::reg ( int  nup,
int  ndown,
const char *  rname 
)
inline

Definition at line 192 of file vlib.h.

References reg().

Referenced by reg().

192 {reg (0, 0, nup, ndown, rname);};
void reg(int, int, int, int, const char *)
Definition: vlib.cc:917

Member Data Documentation

int memory::down
protected

Definition at line 204 of file vlib.h.

Referenced by reg().

Signal* memory::r
protected

Definition at line 203 of file vlib.h.

Referenced by memory(), reg(), and ~memory().

int memory::up
protected

Definition at line 204 of file vlib.h.

Referenced by reg().