30 lines
1.3 KiB
C++
30 lines
1.3 KiB
C++
|
#include "connection_instance.h"
|
||
|
|
||
|
namespace domain {
|
||
|
|
||
|
|
||
|
ConnectionInstance::ConnectionInstance(ComponentInstance *instance, std::vector<InstanceAttribute> attributes,
|
||
|
Connection connection)
|
||
|
: instance(instance), attributes(attributes), connection(connection) {}
|
||
|
|
||
|
InstanceAttribute ConnectionInstance::getAttribute(string attribute) {
|
||
|
for (auto &attr: attributes) {
|
||
|
if (attr.name == attribute) {
|
||
|
return attr;
|
||
|
}
|
||
|
}
|
||
|
throw std::exception();
|
||
|
}
|
||
|
|
||
|
|
||
|
BusConnectionInstance::BusConnectionInstance(ComponentInstance *instance, std::vector<InstanceAttribute> attributes,
|
||
|
BusInstance *bus, Connection connection)
|
||
|
: ConnectionInstance(instance, attributes, connection), bus(bus) {}
|
||
|
|
||
|
DirectConnectionInstance::DirectConnectionInstance(ComponentInstance *instance, ComponentInstance *secondInstance,
|
||
|
std::vector<InstanceAttribute> attributes, BusInstance *bus,
|
||
|
Connection connection)
|
||
|
: ConnectionInstance(instance, attributes, connection), secondInstance(secondInstance), bus(bus) {}
|
||
|
|
||
|
} // namespace domain
|