| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

# DODBasicMapper.cpp

Go to the documentation of this file.

    00001 // Include files
    00002
    00003 #include "GaudiKernel/HashMap.h"
    00004 #include "GaudiKernel/Parsers.h"
    00005 // Local implementation of parsers from HashMap
    00006 namespace Gaudi {
    00007   namespace Parsers {
    00010     template <typename K, typename V>
    00011     StatusCode parse(GaudiUtils::HashMap<K, V> &result, const std::string &input) {
    00012       std::map<std::string, std::string> tmp;
    00013       StatusCode sc = parse(tmp, input);
    00014       if (sc.isSuccess()) {
    00015         result.clear();
    00016         result.insert(tmp.begin(), tmp.end());
    00017       }
    00018       return sc;
    00019     }
    00020   }
    00021 }
    00022
    00023 // From Gaudi
    00024 #include "GaudiKernel/ToolFactory.h"
    00025 // local
    00026 #include "DODBasicMapper.h"
    00027
    00028 // ----------------------------------------------------------------------------
    00029 // Implementation file for class: DODBasicMapper
    00030 //
    00031 // 16/01/2012: Marco Clemencic
    00032 // ----------------------------------------------------------------------------
    00033 DECLARE_TOOL_FACTORY(DODBasicMapper)
    00034
    00035 // ============================================================================
    00036 // Standard constructor, initializes variables
    00037 // ============================================================================
    00038 DODBasicMapper::DODBasicMapper(const std::string& type, const std::string& name, const IInterface* parent)
    00039   : base_class(type, name, parent)
    00040 {
    00041   declareProperty("Nodes", m_nodeMap,
    00042                   "Map of the type of nodes to be associated to paths (path -> data_type).");
    00043   declareProperty("Algorithms", m_algMap,
    00044                   "Map of algorithms to be used to produce entries (path -> alg_name).");
    00045 }
    00046
    00047 // ============================================================================
    00048 // Destructor
    00049 // ============================================================================
    00050 DODBasicMapper::~DODBasicMapper() {}
    00051
    00052
    00053 Gaudi::Utils::TypeNameString DODBasicMapper::algorithmForPath(const std::string & path)
    00054 {
    00055   AlgMap::iterator alg = m_algMap.find(path);
    00056   return (alg != m_algMap.end()) ? alg->second : "";
    00057 }
    00058
    00059
    00060 std::string DODBasicMapper::nodeTypeForPath(const std::string & path)
    00061 {
    00062   NodeMap::iterator node = m_nodeMap.find(path);
    00063   return (node != m_nodeMap.end()) ? node->second : "";
    00064 }
    00065
    00066
    00067
    00068 // ============================================================================

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines