add copy and assignment ctor for mode definition
This commit is contained in:
parent
2745b2080d
commit
4c48668125
@ -13,7 +13,7 @@ enum SpecialSubmodeFlags : uint8_t { INHERIT = 1 << 0, ALLOWED_MASK = 1 << 1 };
|
||||
class ModeListEntry : public SerialLinkedListAdapter<SerializeIF>,
|
||||
public LinkedElement<ModeListEntry> {
|
||||
public:
|
||||
ModeListEntry() : LinkedElement<ModeListEntry>(this) { setLinks(); }
|
||||
ModeListEntry() : SerialLinkedListAdapter(), LinkedElement<ModeListEntry>(this) { setLinks(); }
|
||||
|
||||
SerializeElement<uint32_t> value1 = 0;
|
||||
SerializeElement<uint32_t> value2 = 0;
|
||||
@ -21,6 +21,25 @@ class ModeListEntry : public SerialLinkedListAdapter<SerializeIF>,
|
||||
SerializeElement<uint8_t> value4 = 0;
|
||||
SerializeElement<uint8_t> value5 = 0;
|
||||
|
||||
ModeListEntry(const ModeListEntry& other)
|
||||
: SerialLinkedListAdapter(), LinkedElement<ModeListEntry>(this) {
|
||||
value1.entry = other.value1.entry;
|
||||
value2.entry = other.value2.entry;
|
||||
value3.entry = other.value3.entry;
|
||||
value4.entry = other.value4.entry;
|
||||
value5.entry = other.value5.entry;
|
||||
setLinks();
|
||||
}
|
||||
|
||||
ModeListEntry& operator=(const ModeListEntry& other) {
|
||||
this->value1.entry = other.value1.entry;
|
||||
this->value2.entry = other.value2.entry;
|
||||
this->value3.entry = other.value3.entry;
|
||||
this->value4.entry = other.value4.entry;
|
||||
this->value5.entry = other.value5.entry;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void setLinks() {
|
||||
setStart(&value1);
|
||||
value1.setNext(&value2);
|
||||
|
Loading…
Reference in New Issue
Block a user