mirror of
https://github.com/supleed2/svd2cpp.git
synced 2024-11-10 02:25:48 +00:00
30 lines
896 B
C++
30 lines
896 B
C++
#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_){}
|
|
|
|
void ClassBuilder::setupBuilders(){
|
|
builders.push_back(std::make_unique<ZeroPointerBuilder>());
|
|
builders.push_back(std::make_unique<FieldDefineBuilder>());
|
|
for(auto& peripheral : peripherals){
|
|
builders.push_back(std::make_unique<PeripheralBuilder>(peripheral));
|
|
}
|
|
builders.push_back(std::make_unique<FunctionsBuilder>());
|
|
}
|
|
|
|
void ClassBuilder::build(){
|
|
for(auto& builder : builders){
|
|
builder->build(outputStream);
|
|
}
|
|
}
|
|
|
|
const std::stringstream& ClassBuilder::getStream() const{
|
|
return outputStream;
|
|
}
|