|
Gaudi Framework, version v21r6 |
| Home | Generated: 11 Nov 2009 |
#include <string>
#include <set>
#include <map>
#include <math.h>
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/Tokenizer.h"
#include "GaudiKernel/DataObject.h"
#include "GaudiKernel/IAlgorithm.h"
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/IAlgManager.h"
#include "GaudiKernel/IIncidentSvc.h"
#include "GaudiKernel/DataIncident.h"
#include "GaudiKernel/IDataProviderSvc.h"
#include "GaudiKernel/TypeNameString.h"
#include "GaudiKernel/ToStream.h"
#include "DataOnDemandSvc.h"
#include "boost/format.hpp"
#include "boost/lexical_cast.hpp"

Go to the source code of this file.
Functions | |
| std::string | no_prefix (const std::string &value, const std::string &prefix) |
| remove the prefix from the string | |
| template<class MAP> | |
| size_t | add_prefix (MAP &_map, const std::string &prefix) |
| add a prefix (if needed) to all keys of the map the previus key is removed | |
| template<class SET> | |
| size_t | get_dir (const std::string &object, SET &_set) |
| get the list of directories for a certain TES location | |
| template<class MAP, class SET> | |
| size_t | get_dirs (const MAP &_map, SET &_set) |
| get the list of directories for a all keys of the input map | |
| size_t @605::add_prefix | ( | MAP & | _map, | |
| const std::string & | prefix | |||
| ) | [inline, static] |
add a prefix (if needed) to all keys of the map the previus key is removed
| _map | map to be modified | |
| prefix | prefix to be added |
loop over all entries to find the proper keys
Definition at line 142 of file DataOnDemandSvc.cpp.
00143 { 00144 // empty prefix 00145 if ( prefix.empty() ) { return 0 ; } // RETURN 00147 for ( typename MAP::iterator it = _map.begin() ; _map.end() != it ; ++it ) 00148 { 00149 if ( 0 != it->first.find(prefix) ) // valid prefix? 00150 { 00151 std::string key = prefix + it->first ; 00152 std::string value = it->second ; 00153 _map.erase ( it ) ; 00154 _map[ key ] = value ; 00155 return 1 + add_prefix ( _map , prefix ) ; // RETURN, recursion 00156 } 00157 } 00158 // 00159 return 0 ; 00160 }
| size_t @605::get_dir | ( | const std::string & | object, | |
| SET & | _set | |||
| ) | [inline, static] |
get the list of directories for a certain TES location
| object | to be inspected | |
| _set | (output) the set with directoiry list |
Definition at line 168 of file DataOnDemandSvc.cpp.
00169 { 00170 std::string::size_type ifind = object.rfind('/') ; 00171 // stop recursion 00172 if ( std::string::npos == ifind ) { return 0 ; } // RETURN 00173 if ( 0 == ifind ) { return 0 ; } 00174 // 00175 const std::string top = std::string( object , 0 , ifind) ; 00176 _set.insert( top ) ; 00177 return 1 + get_dir ( top , _set ) ; // RETURN, recursion 00178 }
| size_t @605::get_dirs | ( | const MAP & | _map, | |
| SET & | _set | |||
| ) | [inline, static] |
get the list of directories for a all keys of the input map
| _map | (input) map to be inspected | |
| _set | (output) the set with directoiry list |
Definition at line 186 of file DataOnDemandSvc.cpp.
00187 { 00188 size_t size = _set.size() ; 00189 for ( typename MAP::const_iterator item = _map.begin() ; 00190 _map.end() != item ; ++item ) { get_dir ( item->first , _set ) ; } 00191 return _set.size() - size ; 00192 }
| std::string @605::no_prefix | ( | const std::string & | value, | |
| const std::string & | prefix | |||
| ) | [inline, static] |
remove the prefix from the string
| value | input tring | |
| prefix | prefix to be removed |
Definition at line 127 of file DataOnDemandSvc.cpp.
00129 { 00130 return 00131 !prefix.empty() && 0 == value.find(prefix) ? 00132 std::string( value , prefix.size() ) : value ; 00133 }