CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
evf::FastMonEncoding Struct Reference

#include <FastMonitoringThread.h>

Public Member Functions

void completeReservedWithDummies ()
 
const void * decode (unsigned int index)
 
int encode (const void *add) const
 
int encodeString (const std::string *add)
 
 FastMonEncoding (unsigned int res)
 
void fillReserved (const void *add, unsigned int i)
 
void update (const void *add)
 
void updatePreinit (std::string const &add)
 
void updateReserved (const void *add)
 
unsigned int vecsize ()
 
 ~FastMonEncoding ()
 

Public Attributes

int current_
 
int currentReserved_
 
std::vector< const void * > decoder_
 
edm::ModuleDescriptiondummiesForReserved_
 
std::unordered_map< const void
*, int > 
quickReference_
 
std::unordered_map
< std::string, int > 
quickReferencePreinit_
 
unsigned int reserved_
 

Detailed Description

Definition at line 40 of file FastMonitoringThread.h.

Constructor & Destructor Documentation

evf::FastMonEncoding::FastMonEncoding ( unsigned int  res)
inline

Definition at line 41 of file FastMonitoringThread.h.

References dummiesForReserved_, and reserved_.

42  if (reserved_)
44  // completeReservedWithDummies();
45  }
edm::ModuleDescription * dummiesForReserved_
evf::FastMonEncoding::~FastMonEncoding ( )
inline

Definition at line 46 of file FastMonitoringThread.h.

References dummiesForReserved_, and reserved_.

46  {
47  if (reserved_)
48  delete[] dummiesForReserved_;
49  }
edm::ModuleDescription * dummiesForReserved_

Member Function Documentation

void evf::FastMonEncoding::completeReservedWithDummies ( )
inline

Definition at line 91 of file FastMonitoringThread.h.

References currentReserved_, dummiesForReserved_, fillReserved(), mps_fire::i, and reserved_.

91  {
92  for (unsigned int i = currentReserved_; i < reserved_; i++)
94  }
edm::ModuleDescription * dummiesForReserved_
void fillReserved(const void *add, unsigned int i)
const void* evf::FastMonEncoding::decode ( unsigned int  index)
inline

Definition at line 78 of file FastMonitoringThread.h.

References decoder_.

78 { return decoder_[index]; }
std::vector< const void * > decoder_
int evf::FastMonEncoding::encode ( const void *  add) const
inline

Definition at line 51 of file FastMonitoringThread.h.

References quickReference_.

Referenced by encodeString().

51  {
52  std::unordered_map<const void*, int>::const_iterator it = quickReference_.find(add);
53  return (it != quickReference_.end()) ? (*it).second : 0;
54  }
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::unordered_map< const void *, int > quickReference_
int evf::FastMonEncoding::encodeString ( const std::string *  add)
inline

Definition at line 60 of file FastMonitoringThread.h.

References decoder_, encode(), quickReference_, and quickReferencePreinit_.

60  {
61  std::unordered_map<const void*, int>::const_iterator it = quickReference_.find((void*)add);
62  if (it == quickReference_.end()) {
63  //try to match by string content (encode only used
64  auto it = quickReferencePreinit_.find(*add);
65  if (it == quickReferencePreinit_.end())
66  return 0;
67  else {
68  //overwrite pointer in decoder and add to reference
69  decoder_[(*it).second] = (void*)add;
70  quickReference_[(void*)add] = (*it).second;
71  quickReferencePreinit_.erase(it);
72  return encode((void*)add);
73  }
74  }
75  return (*it).second;
76  }
std::vector< const void * > decoder_
int encode(const void *add) const
std::unordered_map< std::string, int > quickReferencePreinit_
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::unordered_map< const void *, int > quickReference_
void evf::FastMonEncoding::fillReserved ( const void *  add,
unsigned int  i 
)
inline

Definition at line 79 of file FastMonitoringThread.h.

References PVValHelper::add(), currentReserved_, decoder_, mps_fire::i, and quickReference_.

Referenced by completeReservedWithDummies(), and updateReserved().

79  {
80  // translation_[*name]=current_;
82  if (decoder_.size() <= i)
83  decoder_.push_back(add);
84  else
86  }
std::vector< const void * > decoder_
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::unordered_map< const void *, int > quickReference_
void evf::FastMonEncoding::update ( const void *  add)
inline

Definition at line 95 of file FastMonitoringThread.h.

References PVValHelper::add(), current_, decoder_, and quickReference_.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

95  {
96  // translation_[*name]=current_;
98  decoder_.push_back(add);
99  current_++;
100  }
std::vector< const void * > decoder_
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::unordered_map< const void *, int > quickReference_
void evf::FastMonEncoding::updatePreinit ( std::string const &  add)
inline

Definition at line 102 of file FastMonitoringThread.h.

References PVValHelper::add(), current_, decoder_, and quickReferencePreinit_.

102  {
103  // translation_[*name]=current_;
105  decoder_.push_back((void*)&add);
106  current_++;
107  }
std::vector< const void * > decoder_
std::unordered_map< std::string, int > quickReferencePreinit_
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
void evf::FastMonEncoding::updateReserved ( const void *  add)
inline

Definition at line 87 of file FastMonitoringThread.h.

References currentReserved_, and fillReserved().

87  {
90  }
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
void fillReserved(const void *add, unsigned int i)
unsigned int evf::FastMonEncoding::vecsize ( )
inline

Definition at line 109 of file FastMonitoringThread.h.

References decoder_.

109 { return decoder_.size(); }
std::vector< const void * > decoder_

Member Data Documentation

int evf::FastMonEncoding::current_

Definition at line 114 of file FastMonitoringThread.h.

Referenced by update(), and updatePreinit().

int evf::FastMonEncoding::currentReserved_
std::vector<const void*> evf::FastMonEncoding::decoder_
edm::ModuleDescription* evf::FastMonEncoding::dummiesForReserved_
std::unordered_map<const void*, int> evf::FastMonEncoding::quickReference_

Definition at line 110 of file FastMonitoringThread.h.

Referenced by encode(), encodeString(), fillReserved(), and update().

std::unordered_map<std::string, int> evf::FastMonEncoding::quickReferencePreinit_

Definition at line 111 of file FastMonitoringThread.h.

Referenced by encodeString(), and updatePreinit().

unsigned int evf::FastMonEncoding::reserved_