Belle II Software development
Belle2::_StoreArrayImpl Namespace Reference

hide some implementation details. More...

Functions

void clearRelations (const StoreAccessorBase &array)
 clear all relations touching the given array.
 

Detailed Description

hide some implementation details.

Function Documentation

◆ clearRelations()

void clearRelations ( const StoreAccessorBase array)

clear all relations touching the given array.

Definition at line 16 of file StoreArray.cc.

17{
18 auto related_arrays = DataStore::Instance().getListOfRelatedArrays(array);
19
20 for (const std::string& other_name : related_arrays) {
21 RelationArray a(DataStore::relationName(other_name, array.getName()), array.getDurability());
22 RelationArray b(DataStore::relationName(array.getName(), other_name), array.getDurability());
23 if (a.isValid())
24 a.clear();
25 if (b.isValid())
26 b.clear();
27 }
28}
std::vector< std::string > getListOfRelatedArrays(const StoreAccessorBase &array) const
Returns a list of names of arrays which have registered relations that point to or from 'array'.
Definition: DataStore.cc:640
static DataStore & Instance()
Instance of singleton Store.
Definition: DataStore.cc:54
static std::string relationName(const std::string &fromName, const std::string &toName, std::string const &namedRelation="")
Return storage name for a relation between two arrays of the given names.
Definition: DataStore.h:180
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:62
DataStore::EDurability getDurability() const
Return durability with which the object is saved in the DataStore.
const std::string & getName() const
Return name under which the object is saved in the DataStore.