CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cond::KeyGenerator Class Reference

#include <DecodingKey.h>

Public Member Functions

 KeyGenerator ()
 
std::string make (size_t keySize)
 
std::string makeWithRandomSize (size_t maxSize)
 

Private Attributes

int m_iteration
 

Detailed Description

Definition at line 18 of file DecodingKey.h.

Constructor & Destructor Documentation

cond::KeyGenerator::KeyGenerator ( )
inline

Definition at line 90 of file DecodingKey.h.

90  :m_iteration(0){
91 }

Member Function Documentation

std::string cond::KeyGenerator::make ( size_t  keySize)

Definition at line 74 of file DecodingKey.cc.

References i, m_iteration, NULL, rand(), cond::randomChar(), run_regression::ret, and cond::rpcobgas::time.

Referenced by cond::DecodingKey::createFromInputFile(), cond::CredentialStore::installAdmin(), cond::CredentialStore::updateConnection(), and cond::CredentialStore::updatePrincipal().

74  {
75  ::srand( m_iteration+2 );
76  int rseed = ::rand();
77  int seed = ::time( NULL)%10 + rseed;
78  ::srand( seed );
79  std::string ret("");
80  for( size_t i=0;i<keySize; i++ ){
81  ret += randomChar();
82  }
83  m_iteration++;
84  return ret;
85 }
int i
Definition: DBlmapReader.cc:9
#define NULL
Definition: scimark2.h:8
Signal rand(Signal arg)
Definition: vlib.cc:442
char randomChar()
Definition: DecodingKey.cc:36
std::string cond::KeyGenerator::makeWithRandomSize ( size_t  maxSize)

Definition at line 87 of file DecodingKey.cc.

References reco::modules::make(), reco_skim_cfg_mod::maxSize, NULL, rand(), and cond::rpcobgas::time.

87  {
88  ::srand( m_iteration+2 );
89  int rseed = ::rand();
90  int seed = ::time( NULL)%10 + rseed;
91  ::srand( seed );
92  size_t sz = rand()%maxSize;
93  return make( sz );
94 }
#define NULL
Definition: scimark2.h:8
tuple maxSize
&#39;/store/data/Commissioning08/BeamHalo/RECO/StuffAlmostToP5_v1/000/061/642/10A0FE34-A67D-DD11-AD05-000...
std::string make(size_t keySize)
Definition: DecodingKey.cc:74
Signal rand(Signal arg)
Definition: vlib.cc:442

Member Data Documentation

int cond::KeyGenerator::m_iteration
private

Definition at line 28 of file DecodingKey.h.

Referenced by make().