46 lines
1.0 KiB
C++
46 lines
1.0 KiB
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<shared_ptr<BusInstance>> busInstances;
|
|
std::vector<shared_ptr<ComponentInstance>> componentInstances;
|
|
|
|
std::vector<shared_ptr<ConnectionInstance>> connections;
|
|
|
|
BusInstance *getBusInstance(std::string& name) {
|
|
for(auto& instance: busInstances) {
|
|
if (instance->name == name) {
|
|
return instance.get();
|
|
}
|
|
}
|
|
return nullptr;
|
|
}
|
|
ComponentInstance *getComponentInstance(std::string& name) {
|
|
for(auto& instance: componentInstances) {
|
|
if (instance->name == name) {
|
|
return instance.get();
|
|
}
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
bool hasConnection(string& component, string& pin);
|
|
ConnectionInstance* getConnection(string& component, string& pin);
|
|
};
|
|
|
|
} // namespace domain
|
|
|
|
#endif // DOMAIN_SCHEMA_H
|