schema_editor/comdel/domain/instance.cpp

20 lines
779 B
C++
Raw Permalink Normal View History

2022-04-05 21:48:07 +00:00
#include "instance.h"
namespace domain {
2022-05-27 06:18:17 +00:00
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();
}
2022-05-26 17:21:53 +00:00
}
2022-05-25 05:39:45 +00:00
2022-05-27 06:18:17 +00:00
BusInstance::BusInstance(std::string name, Bus bus) : name(name), bus(bus), position(0, 0), size(0) {}
2022-05-25 05:39:45 +00:00
2022-05-27 06:18:17 +00:00
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) {}
2022-04-05 21:48:07 +00:00
} // namespace domain