Belle II Software  release-08-01-10
StoreArray.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <framework/datastore/StoreArray.h>
10 
11 #include <framework/datastore/RelationArray.h>
12 
13 using namespace std;
14 using namespace Belle2;
15 
16 void _StoreArrayImpl::clearRelations(const StoreAccessorBase& array)
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 }
Low-level class to create/modify relations between StoreArrays.
Definition: RelationArray.h:62
Base class for StoreObjPtr and StoreArray for easier common treatment.
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.
Abstract base class for different kinds of events.