Line data Source code
1 : /*
2 : * dbaccessor.cpp
3 : *
4 : * Created on: Mar 10, 2016
5 : * Author: Leonidas Georgopoulos
6 : */
7 :
8 : #include "dbe/dbaccessor.hpp"
9 :
10 : using namespace dunedaq::conffwk;
11 :
12 : //------------------------------------------------------------------------------------------
13 : dbe::dbholder::t_mutex dbe::dbholder::database_lock;
14 : Configuration * dbe::dbholder::database = nullptr;
15 : cptr<Configuration> dbe::dbholder::database_concurrent_ptr = cptr<Configuration> (
16 : dbe::dbholder::database );
17 : //------------------------------------------------------------------------------------------
18 38 : cptr<Configuration> dbe::dbaccessor::dbptr()
19 : {
20 38 : t_lock l ( dbholder::database_lock );
21 38 : return dbholder::database_concurrent_ptr;
22 38 : }
23 : //------------------------------------------------------------------------------------------
24 :
25 : //------------------------------------------------------------------------------------------
26 7 : bool dbe::dbaccessor::is_loaded()
27 : {
28 7 : return dbaccessor::dbptr().get() != nullptr;
29 : }
30 : //------------------------------------------------------------------------------------------
|