schema_editor/comdel/domain/schema.h

41 lines
779 B
C
Raw Normal View History

2022-04-05 21:48:07 +00:00
#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();
2022-05-07 11:20:09 +00:00
std::vector<BusInstance> busInstances;
std::vector<ComponentInstance> componentInstances;
2022-04-05 21:48:07 +00:00
2022-05-07 11:20:09 +00:00
std::vector<ConnectionInstance> connections;
2022-04-05 21:48:07 +00:00
2022-05-07 11:20:09 +00:00
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;
2022-04-05 21:48:07 +00:00
}
}
return nullptr;
}
};
} // namespace domain
#endif // DOMAIN_SCHEMA_H