ConfiguredApplicationTypes.cpp
Go to the documentation of this file.
1 #include <DatabaseUtils/DAQAppMgr/ConfiguredApplicationTypes.h>
2 #include <NovaDatabase/Table.h>
3 #include <NovaDatabase/Util.h>
4 #include <boost/shared_ptr.hpp>
5 
6 namespace NOVADB = nova::database;
7 
8 namespace dbutils {
9 namespace daqappmgr {
10 
11 /**
12  * Creates a new instance based on the specified detector name
13  * (NDOS, NearDet, FarDet).
14  */
17  int partitionNumber,
18  const bool& useDBData)
19 {
20  _hasValidData = false;
22 }
23 
24 /**
25  * Fetches the application type instance with the specified name.
26  */
27 boost::shared_ptr<ApplicationType> ConfiguredApplicationTypes::
28 getTypeByName(const std::string& typeName) const
29 {
30  boost::shared_ptr<ApplicationType> typePtr;
31  if (! _hasValidData) {return typePtr;}
32 
33  for (int idx = 0; idx < (int) _typeList.size(); ++idx) {
34  if (_typeList[idx]->getTypeName() == typeName) {
35  typePtr = _typeList[idx];
36  break;
37  }
38  }
39 
40  return typePtr;
41 }
42 
43 /**
44  * Adds the specified type to the list
45  */
47 _addApplicationType(boost::shared_ptr<ApplicationType> appType)
48 {
49  if (appType.get() == 0) {return;}
50 
51  _hasValidData = true;
52 
53  _typeList.push_back(appType);
54 }
55 
56 } // end of namespace daqappmgr
57 } // end of namespace dbutils
boost::shared_ptr< ApplicationType > getTypeByName(const std::string &typeName) const
std::vector< boost::shared_ptr< ApplicationType > > _typeList
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void _addApplicationType(boost::shared_ptr< ApplicationType > appType)
ConfiguredApplicationTypes(const std::string &detectorName, int partitionNumber=0, const bool &useDBData=false)