CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Configuration.cc
Go to the documentation of this file.
4 //
5 #include <cstdlib>
6 #include <string.h>
7 
8 static const char* CORAL_MSG_LEVEL = "CORAL_MSG_LEVEL";
9 coral::MsgLevel coralMessageLevel( const char* envVar ){
10  coral::MsgLevel ret = coral::Nil;
11  if( ::strcmp(envVar,"VERBOSE")==0 || ::strcmp(envVar,"Verbose")==0 ) ret = coral::Verbose;
12  if( ::strcmp(envVar,"DEBUG")==0 || ::strcmp(envVar,"Debug")==0 ) ret = coral::Debug;
13  if( ::strcmp(envVar,"INFO")==0 || ::strcmp(envVar,"Info")==0 ) ret = coral::Info;
14  if( ::strcmp(envVar,"WARNING")==0 || ::strcmp(envVar,"Warning")==0 ) ret = coral::Warning;
15  if( ::strcmp(envVar,"ERROR")==0 || ::strcmp(envVar,"Error")==0 ) ret = coral::Error;
16  if( ::strcmp(envVar,"FATAL")==0 || ::strcmp(envVar,"Fatal")==0 ) ret = coral::Fatal;
17  if( ::strcmp(envVar,"ALWAYS")==0 || ::strcmp(envVar,"Always")==0 ) ret = coral::Always;
18  if( ::strcmp(envVar,"NUMLEVELS")==0 || ::strcmp(envVar,"NumLevels")==0 ) ret = coral::NumLevels;
19  return ret;
20 }
21 
23  static const std::string s_automaticDatabaseCreation("ORA_AUTOMATIC_DATABASE_CREATION");
24  return s_automaticDatabaseCreation;
25 }
26 
28  static const std::string s_automaticContainerCreation("ORA_AUTOMATIC_CONTAINER_CREATION");
29  return s_automaticContainerCreation;
30 }
31 
33  static const std::string s_automaticSchemaEvolution("ORA_AUTOMATIC_SCHEMA_EVOLUTION");
34  return s_automaticSchemaEvolution;
35 }
36 
38  m_blobStreamingService(),
39  m_referenceHandler(),
40  m_properties(){
41 
42  const char* envVar = ::getenv( CORAL_MSG_LEVEL );
43  if( envVar ){
44  coral::MsgLevel level = coralMessageLevel( envVar );
45  if( level != coral::Nil ) coral::MessageStream::setMsgVerbosity( coralMessageLevel( envVar ) );
46  }
47 }
48 
50 }
51 
53  m_blobStreamingService.reset( service );
54 }
55 
57  return m_blobStreamingService.get();
58 }
59 
61  m_referenceHandler.reset( handler );
62 }
63 
65  return m_referenceHandler.get();
66 }
67 
69  return m_properties;
70 }
71 
73  coral::MessageStream::setMsgVerbosity( level );
74 }
75 
76 
static const char * CORAL_MSG_LEVEL
Definition: Configuration.cc:8
Properties & properties()
virtual ~Configuration()
void setMessageVerbosity(coral::MsgLevel level)
static std::string automaticContainerCreation()
void setReferenceHandler(IReferenceHandler *handler)
void setBlobStreamingService(IBlobStreamingService *service)
static std::string automaticDatabaseCreation()
coral::MsgLevel coralMessageLevel(const char *envVar)
Definition: Configuration.cc:9
IBlobStreamingService * blobStreamingService()
IReferenceHandler * referenceHandler()
Interface for a Streaming Service.
tuple level
Definition: testEve_cfg.py:34
static std::string automaticSchemaEvolution()
const bool Debug