|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "GaudiKernel/DataHandle.h"
15 #include "GaudiKernel/ToStream.h"
23 #include <boost/tokenizer.hpp>
49 const std::string&
sgkey,
51 const std::string& storeName ,
53 : Gaudi::DataHandle (DataObjID (clid,
sgkey), isCond,
a),
54 m_storeHandle (storeName,
"VarHandleKey")
56 parseKey (
sgkey, storeName);
97 std::cerr <<
"VarHandleKey::assign failure: " <<
e.what() << std::endl;
98 return StatusCode::FAILURE;
100 return StatusCode::FAILURE;
102 return StatusCode::SUCCESS;
117 Gaudi::DataHandle::updateKey (
"" );
120 return StatusCode::SUCCESS;
126 <<
"Cannot initialize a Read/Write/Update handle with a null key.";
127 return StatusCode::FAILURE;
135 return StatusCode::FAILURE;
146 if (base_clid != this_clid) {
152 return StatusCode::SUCCESS;
168 return StatusCode::SUCCESS;
179 return Gaudi::DataHandle::fullKey().clid();
218 const std::string& storeName)
224 std::string::size_type sp = storeName.find(
'/');
225 if (sp == std::string::npos) {
228 sn = storeName.substr(sp+1,storeName.length()-sp+1);
233 Gaudi::DataHandle::updateKey(
"");
240 if(sp == std::string::npos) {
243 sn =
key.substr(0,sp);
259 if (
m_sgKey.find(
'/') != std::string::npos) {
261 +
"\": keys with \"/\" only allowed for "
268 if (sp != std::string::npos) {
273 }
else if ( sp ==
m_sgKey.length()-1) {
275 +
"\": must not end with a \"/\"");
281 Gaudi::DataHandle::updateKey(
"");
311 const std::string&
className = fullKey().className().empty() ?
312 Gaudi::DataHandle::default_type : fullKey().className();
314 std::ostringstream
ost;
315 ost <<
"DataHandle(";
336 s <<
"'" <<
m.objKey() <<
"'";
#define REPORT_ERROR(SC)
Report an error.
A property holding a SG store/key/clid from which a VarHandle is made.
singleton-like access to IMessageSvc via open function and helper
bool m_isEventStore
Cache test for whether we're referencing the event store.
std::ostream & toStream(const SG::VarHandleKeyArray &v, std::ostream &o)
Gaudi function used to convert a property to a string.
ServiceHandle< IProxyDict > m_storeHandle
Handle to the referenced store.
void updateHandle(const std::string &name)
Update the name of the store to which we're referring.
SG::sgkey_t m_hashedKey
The hashed StoreGate key. May be 0 if not yet initialized.
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
constexpr char const storeSeparator
VarHandleKey(CLID clid, const std::string &sgkey, Gaudi::DataHandle::Mode a, const std::string &storeName=StoreID::storeName(StoreID::EVENT_STORE), bool isCond=false)
Constructor.
virtual std::string pythonRepr() const override
Python representation of Handle.
virtual void setKey(DataObjID key) override final
Don't allow calling these.
Exceptions that can be thrown from StoreGate.
virtual StatusCode assign(const std::string &sgkey)
Change the key of the object to which we're referring.
::StatusCode StatusCode
StatusCode definition for legacy code.
Exception — Bad key format for VarHandleKey.
Exception — Forbidden method called.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
uint32_t CLID
The Class ID type.
std::string m_sgKey
StoreGate key, that doesn't include the storename.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
VarHandleKey & operator=(const std::string &sgkey)
Change the key of the object to which we're referring.
Helpers for checking error return status codes and reporting errors.
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
CLID clid() const
Return the class ID for the referenced object.
A property holding a SG store/key/clid from which a VarHandle is made.
void parseKey(const std::string &sgkey, const std::string &storeName)
Handle assignment/construction from a string key.
static StoreID::type findStoreID(const std::string &storeName)
The non-template portion of the BaseInfo implementation.
virtual void updateKey(std::string key) override final
Prevent this method from being called.
static const std::string & storeName(const StoreID::type &s)