20 lines
779 B
C++
20 lines
779 B
C++
#include "instance.h"
|
|
|
|
namespace domain {
|
|
|
|
BusInstance::BusInstance(std::string name, std::pair<int, int> position, Bus bus, int size)
|
|
: name(name), position(position), bus(bus), size(size) {
|
|
if (size < 0 && bus.getDisplayBus().has_value()) {
|
|
this->size = bus.getDisplayBus()->getDefaultSize();
|
|
}
|
|
}
|
|
|
|
BusInstance::BusInstance(std::string name, Bus bus) : name(name), bus(bus), position(0, 0), size(0) {}
|
|
|
|
ComponentInstance::ComponentInstance(std::string name, std::vector<InstanceAttribute> attributes,
|
|
std::pair<int, int> position, Component component)
|
|
: name(name), attributes(std::move(attributes)), position(position), component(component) {}
|
|
|
|
|
|
} // namespace domain
|