2021-08-29 14:18:45 +02:00
|
|
|
#include <hex/data_processor/attribute.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
namespace hex::dp {
|
|
|
|
|
2023-07-26 13:50:51 +02:00
|
|
|
namespace {
|
2022-02-01 18:09:40 +01:00
|
|
|
|
2023-07-26 13:50:51 +02:00
|
|
|
int s_idCounter = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Attribute::Attribute(IOType ioType, Type type, std::string unlocalizedName) : m_id(s_idCounter++), m_ioType(ioType), m_type(type), m_unlocalizedName(std::move(unlocalizedName)) {
|
2021-08-29 14:18:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Attribute::~Attribute() {
|
|
|
|
for (auto &[linkId, attr] : this->getConnectedAttributes())
|
|
|
|
attr->removeConnectedAttribute(linkId);
|
|
|
|
}
|
|
|
|
|
2023-07-26 13:50:51 +02:00
|
|
|
void Attribute::setIdCounter(int id) {
|
|
|
|
if (id > s_idCounter)
|
|
|
|
s_idCounter = id;
|
|
|
|
}
|
|
|
|
|
2021-08-29 14:18:45 +02:00
|
|
|
}
|