schema_editor/comdel/domain/schema.h

41 lines
779 B
C++

#ifndef DOMAIN_SCHEMA_H
#define DOMAIN_SCHEMA_H
#include "connectioninstance.h"
#include "instance.h"
#include "wireinstance.h"
#include <vector>
namespace domain {
class Schema
{
public:
Schema();
std::vector<BusInstance> busInstances;
std::vector<ComponentInstance> componentInstances;
std::vector<ConnectionInstance> connections;
Instance *getInstance(std::string& name) {
for(auto& instance: busInstances) {
if (instance.name == name) {
return &instance;
}
}
for(auto& instance: componentInstances) {
if (instance.name == name) {
return &instance;
}
}
return nullptr;
}
};
} // namespace domain
#endif // DOMAIN_SCHEMA_H