diff --git a/DetectorDescription/IdDictDetDescr/CMakeLists.txt b/DetectorDescription/IdDictDetDescr/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..754a8fe9bf954e090a5511be01ae96ec67bffd28 --- /dev/null +++ b/DetectorDescription/IdDictDetDescr/CMakeLists.txt @@ -0,0 +1,22 @@ +################################################################################ +# Package: IdDictDetDescr +################################################################################ + +# Declare the package name: +atlas_subdir( IdDictDetDescr ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Control/CLIDSvc + Control/SGTools + DetectorDescription/IdDict + PRIVATE + DetectorDescription/Identifier ) + +# Component(s) in the package: +atlas_add_library( IdDictDetDescr + src/IdDictManager.cxx + PUBLIC_HEADERS IdDictDetDescr + LINK_LIBRARIES SGTools IdDict + PRIVATE_LINK_LIBRARIES Identifier ) + diff --git a/DetectorDescription/IdDictDetDescr/IdDictDetDescr/IdDictManager.h b/DetectorDescription/IdDictDetDescr/IdDictDetDescr/IdDictManager.h new file mode 100755 index 0000000000000000000000000000000000000000..8e21832283fc507a99c2bb87482fa183abc73332 --- /dev/null +++ b/DetectorDescription/IdDictDetDescr/IdDictDetDescr/IdDictManager.h @@ -0,0 +1,61 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/*************************************************************************** + IdDictDetDescr package + ----------------------------------------- + Copyright (C) 2002 by ATLAS Collaboration + ***************************************************************************/ + +//<doc><file> $Id: IdDictManager.h,v 1.4 2003-09-22 07:01:22 schaffer Exp $ +//<version> $Name: not supported by cvs2svn $ + +#ifndef IDDICTDETDESCR_IDDICTMANAGER_H +# define IDDICTDETDESCR_IDDICTMANAGER_H + +//<<<<<< INCLUDES >>>>>> + +#include "IdDict/IdDictDefs.h" +#include "CLIDSvc/CLASS_DEF.h" + +//<<<<<< PUBLIC TYPES >>>>>> + +class IdHelper; +class IdDictDictionary; +class IdDictMgr; + +//<<<<<< CLASS DECLARATIONS >>>>>> + +/** + * IdDictManager is the interface to identifier dictionaries. This + * class inherits most of its functionality from IdDictMgr and adds + * the capabilities to be an object in the detector store. + */ + +class IdDictManager +{ +public: + IdDictManager(); + IdDictManager(const IdDictMgr& mgr); + ~IdDictManager(); + + //IdDictDictionary* find_dictionary (const std::string& name) const; + + const IdDictMgr* manager (void) const; + + /// Return value: 0 OK, >0 error + int initializeHelper (IdHelper& helper) const; + +private: + const IdDictMgr* m_mgr; +}; + +//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> +//<<<<<< INLINE MEMBER FUNCTIONS >>>>>> + +//using the macros below we can assign an identifier (and a version) +//This is required and checked at compile time when you try to record/retrieve +CLASS_DEF(IdDictManager, 2411, 1) + +#endif // IDDICTDETDESCR_IDDICTMANAGER_H diff --git a/DetectorDescription/IdDictDetDescr/cmt/requirements b/DetectorDescription/IdDictDetDescr/cmt/requirements new file mode 100755 index 0000000000000000000000000000000000000000..30e26fd72bbd095297e56bdae058dddf5dd54147 --- /dev/null +++ b/DetectorDescription/IdDictDetDescr/cmt/requirements @@ -0,0 +1,15 @@ +package IdDictDetDescr + +author RD Schaffer <R.D.Schaffer@cern.ch> + +use AtlasPolicy AtlasPolicy-* +use IdDict IdDict-* DetectorDescription +use CLIDSvc CLIDSvc-* Control + + +library IdDictDetDescr IdDictManager.cxx +apply_pattern installed_library + +private +use Identifier Identifier-* DetectorDescription + diff --git a/DetectorDescription/IdDictDetDescr/src/IdDictManager.cxx b/DetectorDescription/IdDictDetDescr/src/IdDictManager.cxx new file mode 100755 index 0000000000000000000000000000000000000000..cea1460696226045b602bb3aca8c4b1d30a458d8 --- /dev/null +++ b/DetectorDescription/IdDictDetDescr/src/IdDictManager.cxx @@ -0,0 +1,51 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/*************************************************************************** + IdDictDetDescr package + ----------------------------------------- + Copyright (C) 2002 by ATLAS Collaboration + ***************************************************************************/ + +//<doc><file> $Id: IdDictManager.cxx,v 1.3 2003-09-22 07:01:22 schaffer Exp $ +//<version> $Name: not supported by cvs2svn $ + +//<<<<<< INCLUDES >>>>>> + +#include "IdDictDetDescr/IdDictManager.h" +#include "Identifier/IdHelper.h" +#include "IdDict/IdDictDefs.h" + + +//<<<<<< MEMBER FUNCTION DEFINITIONS >>>>>> + +IdDictManager::IdDictManager() + : + m_mgr(0) +{} + +IdDictManager::IdDictManager(const IdDictMgr& mgr) + : + m_mgr(&mgr) +{} + + +IdDictManager::~IdDictManager() +{} + +const IdDictMgr* +IdDictManager::manager (void) const +{ + return (m_mgr); +} + + +int +IdDictManager::initializeHelper (IdHelper& helper) const +{ + if (m_mgr) return (helper.initialize_from_dictionary(*m_mgr)); + return (1); // otherwise error +} + +