-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: master
Are you sure you want to change the base?
Curve element wrapper #1723
Conversation
libopenage/curve/element_wrapper.h
Outdated
#pragma once | ||
#include "time/time.h" |
There was a problem hiding this comment.
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.
libopenage/curve/element_wrapper.h
Outdated
} | ||
}; | ||
|
||
} |
There was a problem hiding this comment.
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
libopenage/curve/element_wrapper.h
Outdated
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; | ||
} | ||
}; |
There was a problem hiding this comment.
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.
e890cf1
to
615441e
Compare
615441e
to
b306c76
Compare
No description provided.