28 std::string::size_type ipos = key.find (
'.');
29 if (ipos == std::string::npos)
31 return key.substr (0, ipos);
44 std::string::size_type ipos = key.find (
'.');
45 if (ipos == std::string::npos)
47 return key.substr (ipos+1, std::string::npos);
61 if (cont.empty())
return decor;
62 if (decor.empty())
return cont;
63 return cont +
'.' + decor;
79 if (key.empty() || key.ends_with (
'+')) {
82 if (key.find(
'.') != std::string::npos) {
83 throw SG::ExcBadHandleKey(key +
" (DecorHandleKey has been declared with a parent container. "
84 "Its value should not contain any container name.)");
102 const std::string toerase = contKey.fullKey().
key() +
".";
103 const size_t pos = key.find(toerase);
104 if (pos != std::string::npos) {
105 key.erase(pos, toerase.size());
Exceptions that can be thrown from StoreGate.
Some common helper functions used by decoration handles.
A property holding a SG store/key/clid from which a VarHandle is made.
Exception — Bad key format for VarHandleKey.
A property holding a SG store/key/clid from which a VarHandle is made.
const std::string & key() const
Return the StoreGate ID for the referenced object.
void removeContFromDecorKey(const VarHandleKey &contKey, std::string &key)
Remove container name from decoration key.
std::string makeContDecorKey(const std::string &cont, const std::string &decor)
Make a StoreGate key from container and decoration name.
std::string contKeyFromKey(const std::string &key)
Extract the container part of key.
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.