ATLAS Offline Software
Loading...
Searching...
No Matches
ToolStore.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ASGTOOLS_TOOLSTORE_H
6#define ASGTOOLS_TOOLSTORE_H
7
8// System include(s):
9#include <string>
10
11// Local include(s):
12#include "AsgTools/IAsgTool.h"
14
15namespace asg {
16
32 class ToolStore {
33
34 public:
37 static StatusCode put( IAsgTool* ptool );
38
40 static IAsgTool* get( const std::string& name, bool silent = false );
41
43 template< typename T >
44 static T* get( const std::string& name ) {
45
46 return dynamic_cast< T* >( get( name ) );
47 }
48
50 template< typename T >
51 static bool contains( const std::string& name ) {
52
53 return ( dynamic_cast< T* >( get( name, true ) ) != 0 );
54 }
55
57 static StatusCode remove( const IAsgTool* tool );
59 static StatusCode remove( const std::string& name );
60
61#ifdef XAOD_STANDALONE
63 static void dumpToolConfig ();
64#endif
65
66 }; // class ToolStore
67
68} // namespace asg
69
70#endif // ASGTOOLS_TOOLSTORE_H
Base class for the dual-use tool interface classes.
Definition IAsgTool.h:41
A light-weight replacement for ToolSvc for ROOT analysis.
Definition ToolStore.h:32
static IAsgTool * get(const std::string &name, bool silent=false)
Retrieve a tool by name.
Definition ToolStore.cxx:57
static bool contains(const std::string &name)
Check whether a tool with a given type and name is known in the store.
Definition ToolStore.h:51
static StatusCode remove(const IAsgTool *tool)
Remove the specified tool from the store.
Definition ToolStore.cxx:77
static T * get(const std::string &name)
Retrieve a tool by name and interface.
Definition ToolStore.h:44
static StatusCode put(IAsgTool *ptool)
Store a named tool by its name.
Definition ToolStore.cxx:28