svd2cpp/Src/ClassBuilder.cpp

25 lines
721 B
C++
Raw Normal View History

2019-11-22 11:57:17 +00:00
#include <ClassBuilder.hpp>
#include <Builders.hpp>
ClassBuilder::ClassBuilder(const cxxopts::ParseResult& results_,
const DeviceInfo& deviceInfo_,
const std::vector<Peripheral>& peripherals_) :
results(results_),
deviceInfo(deviceInfo_),
peripherals(peripherals_){}
2019-11-22 11:57:17 +00:00
void ClassBuilder::setupBuilders(){
builders.push_back(std::make_unique<ZeroPointerBuilder>());
for(auto& peripheral : peripherals){
builders.push_back(std::make_unique<PeripheralBuilder>(peripheral));
}
}
void ClassBuilder::build(){
for(auto& builder : builders){
builder->build(outputStream);
}
std::cout << outputStream.str();
}