9 #include "Pandora/Pandora.h"
10 #include "Pandora/StatusCodes.h"
24 instanceList.push_back(pPrimaryPandora);
26 for (
const pandora::Pandora *
const pPandora : instanceList)
33 catch (
const pandora::StatusCodeException &)
38 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
48 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
60 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
72 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
82 throw pandora::StatusCodeException(pandora::STATUS_CODE_ALREADY_PRESENT);
85 throw pandora::StatusCodeException(pandora::STATUS_CODE_FAILURE);
101 for (
const auto &mapElement : pandoraInstanceMap)
110 throw pandora::StatusCodeException(pandora::STATUS_CODE_ALREADY_PRESENT);
120 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
122 iter->second.push_back(pDaughterPandora);
124 if (!
m_daughterToPrimaryMap.insert(PandoraRelationMap::value_type(pDaughterPandora, pPrimaryPandora)).second)
125 throw pandora::StatusCodeException(pandora::STATUS_CODE_FAILURE);
138 catch (
const pandora::StatusCodeException &)
140 std::cout <<
"MultiPandoraApiImpl::DeletePandoraInstances - unable to find daughter instances associated with primary "
141 << pPrimaryPandora << std::endl;
144 pandoraInstanceList.push_back(pPrimaryPandora);
147 for (
const pandora::Pandora *
const pPandora : pandoraInstanceList)
PandoraToVolumeIdMap m_pandoraToVolumeIdMap
The map from pandora instance to volume id.
~MultiPandoraApiImpl()
Destructor;.
void AddDaughterPandoraInstance(const pandora::Pandora *const pPrimaryPandora, const pandora::Pandora *const pDaughterPandora)
Add a pandora daughter instance, associated to a primary pandora instance.
void DeletePandoraInstances(const pandora::Pandora *const pPrimaryPandora)
Delete all pandora instances associated with (and including) a specified primary pandora instance...
void AddPrimaryPandoraInstance(const pandora::Pandora *const pPrimaryPandora)
Declare a new primary pandora instance.
const pandora::Pandora * GetPrimaryPandoraInstance(const pandora::Pandora *const pDaughterPandora) const
Get the address of the primary pandora instance associated with a given daughter pandora instance...
std::vector< const pandora::Pandora * > PandoraInstanceList
Header file for the MultiPandoraApiImpl class.
std::unordered_map< const pandora::Pandora *, PandoraInstanceList > PandoraInstanceMap
void SetVolumeId(const pandora::Pandora *const pPandora, const unsigned int volumeId)
Set the volume id associated with a given pandora instance.
PandoraRelationMap m_daughterToPrimaryMap
The map from daughter pandora instance to primary pandora instance.
const PandoraInstanceMap & GetPandoraInstanceMap() const
Get the pandora instance map.
MultiPandoraApiImpl()
Default constructor;.
const PandoraInstanceList & GetDaughterPandoraInstanceList(const pandora::Pandora *const pPrimaryPandora) const
Get the list of daughter pandora instances associated with a given primary pandora instance...
PandoraInstanceMap m_primaryToDaughtersMap
The map from primary pandora instance to list of daughter pandora instances.
unsigned int GetVolumeId(const pandora::Pandora *const pPandora) const
Get the volume id associated with a given pandora instance.
const pandora::Pandora * GetPandoraInstance(const pandora::Pandora *const pPrimaryPandora, const unsigned int volumeId) const
Get the address of the pandora instance associated with a given primary pandora instance and volume i...
BEGIN_PROLOG could also be cout