Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curve element wrapper #1723

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jere8184
Copy link
Contributor

@jere8184 jere8184 commented Dec 3, 2024

No description provided.

@heinezen heinezen added improvement Enhancement of an existing component lang: c++ Done in C++ code kevin-rebuild-pl0x instruct kevin to rebuild this pull request area: util Utilitis and data structures labels Dec 5, 2024
@SFTbot SFTbot removed kevin-rebuild-pl0x instruct kevin to rebuild this pull request labels Dec 5, 2024
libopenage/curve/element_wrapper.h Show resolved Hide resolved
Comment on lines 1 to 5
#pragma once
#include "time/time.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pragmas and includes should be separated by a space.

}
};

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files should end in a newline

Comment on lines 7 to 38
struct element_wrapper {
// Insertion time of the element
time::time_t _alive;
// Erase time of the element
// TODO: this has to be mutable because erase() will complain otherwise
mutable time::time_t _dead;
// Element value
T value;

element_wrapper(const time::time_t &time, const T &value) :
_alive{time},
_dead{time::TIME_MAX},
value{value} {}

element_wrapper(const T &value, const time::time_t &alive, const time::time_t &dead) :
_alive{alive},
_dead{dead},
value{value} {}

const time::time_t &alive() const {
return _alive;
}

const time::time_t &dead() const {
return _dead;
}

// TODO: this has to be const because erase() will complain otherwise
void set_dead(const time::time_t &time) const {
_dead = time;
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this struct moved to a separate file, we should document all its functions and constructors.

@heinezen heinezen added the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Dec 5, 2024
@SFTbot SFTbot removed the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Dec 5, 2024
@jere8184 jere8184 force-pushed the curve_element_wrapper branch 3 times, most recently from e890cf1 to 615441e Compare December 12, 2024 15:02
@jere8184 jere8184 force-pushed the curve_element_wrapper branch from 615441e to b306c76 Compare December 12, 2024 15:17
@jere8184 jere8184 requested a review from heinezen December 15, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: util Utilitis and data structures improvement Enhancement of an existing component lang: c++ Done in C++ code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants