Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
41
generator/translator_collection.cpp
Normal file
41
generator/translator_collection.cpp
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include "generator/translator_collection.hpp"
|
||||
|
||||
#include "generator/osm_element.hpp"
|
||||
|
||||
#include "base/stl_helpers.hpp"
|
||||
|
||||
namespace generator
|
||||
{
|
||||
std::shared_ptr<TranslatorInterface> TranslatorCollection::Clone() const
|
||||
{
|
||||
auto p = std::make_shared<TranslatorCollection>();
|
||||
for (auto const & c : m_collection)
|
||||
p->Append(c->Clone());
|
||||
return p;
|
||||
}
|
||||
|
||||
void TranslatorCollection::Emit(OsmElement const & element)
|
||||
{
|
||||
for (auto & t : m_collection)
|
||||
t->Emit(element);
|
||||
}
|
||||
|
||||
void TranslatorCollection::Finish()
|
||||
{
|
||||
for (auto & t : m_collection)
|
||||
t->Finish();
|
||||
}
|
||||
|
||||
bool TranslatorCollection::Save()
|
||||
{
|
||||
return base::AllOf(m_collection, [](auto & t) { return t->Save(); });
|
||||
}
|
||||
|
||||
void TranslatorCollection::MergeInto(TranslatorCollection & other) const
|
||||
{
|
||||
auto & otherCollection = other.m_collection;
|
||||
CHECK_EQUAL(m_collection.size(), otherCollection.size(), ());
|
||||
for (size_t i = 0; i < m_collection.size(); ++i)
|
||||
otherCollection[i]->Merge(*m_collection[i]);
|
||||
}
|
||||
} // namespace generator
|
||||
Loading…
Add table
Add a link
Reference in a new issue