CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
DistBoss Namespace Reference

Functions

template<typename T >
StatusCode GetPropertyValue (const std::string &client, const std::string &name, T &value)
 

Function Documentation

◆ GetPropertyValue()

template<typename T >
StatusCode DistBoss::GetPropertyValue ( const std::string & client,
const std::string & name,
T & value )

Definition at line 12 of file GetPropertyValue.h.

13{
14 static IJobOptionsSvc* jobSvc = 0;
15
16 StatusCode sc;
17
18 if ( jobSvc == 0 ) {
19 sc = Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
20 if ( sc.isFailure() ) {
21 std::cout << "Can't get the JobOptionsSvc @ DistBoss::GetPropertyValue()" << std::endl;
22 return sc;
23 }
24 }
25
26 const std::vector<const Property*>* properties = jobSvc->getProperties(client);
27 if ( properties == NULL ) {
28 std::cout << "In DistBoss::GetPropertyValue(), can't get client: " << client << std::endl;
29 return StatusCode::FAILURE;
30 }
31
32 for ( unsigned int i = 0; i < properties->size(); ++i ) {
33 if ( properties->at(i)->name() == name ) {
34 return Gaudi::Parsers::parse(value, properties->at(i)->toString());
35 }
36 }
37
38 return StatusCode::FAILURE;
39}

Referenced by EventWriter::initialize(), and RawDataInputSvc::initialize().