CMS 3D CMS Logo

Public Member Functions | Private Attributes

cond::KeyGenerator Class Reference

#include <DecodingKey.h>

List of all members.

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.

                              :m_iteration(0){
}

Member Function Documentation

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

Definition at line 74 of file DecodingKey.cc.

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

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

                                                {
  ::srand( m_iteration+2 );
  int rseed = ::rand();
  int seed = ::time( NULL)%10 + rseed;
  ::srand( seed );
  std::string ret("");
  for( size_t i=0;i<keySize; i++ ){
    ret += randomChar();
  }
  m_iteration++;
  return ret;
}
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, and cond::rpcobgas::time.

                                                              {
  ::srand( m_iteration+2 );
  int rseed = ::rand();
  int seed = ::time( NULL)%10 + rseed;
  ::srand( seed );
  size_t sz = rand()%maxSize;
  return make( sz );
}

Member Data Documentation

Definition at line 28 of file DecodingKey.h.

Referenced by make().