-
Notifications
You must be signed in to change notification settings - Fork 769
[XPTI] Follow rule of three in XPTI headers #16123
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
Changes from 4 commits
5218d27
8f21bd0
ad6e35d
2c77d17
df0172d
9aa2d7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -353,6 +353,8 @@ class SpinLock { | |
struct finally { | ||
std::function<void()> MFunc; | ||
|
||
finally(const finally &) = default; | ||
finally &operator=(const finally &) = default; | ||
~finally() { | ||
if (xptiTraceEnabled()) | ||
MFunc(); | ||
|
@@ -663,6 +665,11 @@ class stash_tuple { | |
(xptiStashTuple(key, value) == xpti::result_t::XPTI_RESULT_SUCCESS); | ||
} | ||
|
||
// Copy and copy assignment are deleted since we dont want to stash the same | ||
// key-value pair multiple times | ||
stash_tuple(const stash_tuple &) = delete; | ||
stash_tuple &operator=(const stash_tuple &) = delete; | ||
|
||
/// @brief Destroys the stash_tuple object and unstashes the key-value pair if | ||
/// it was stashed successfully earlier. | ||
/// | ||
|
@@ -734,6 +741,8 @@ class uid_object_t { | |
MUId.instance = 0; | ||
}; | ||
|
||
~uid_object_t() = default; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only has one data member to deal with ( |
||
|
||
/// @brief Copy constructor for creating a uid_object_t object as a copy of | ||
/// another. | ||
/// | ||
|
@@ -1613,6 +1622,10 @@ class tracepoint_t { | |
} | ||
} | ||
} | ||
|
||
tracepoint_t(const tracepoint_t &) = delete; | ||
tracepoint_t &operator=(const tracepoint_t &) = delete; | ||
Comment on lines
+1626
to
+1627
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if a |
||
|
||
~tracepoint_t() { | ||
// If tracing is not enabled, don't do anything | ||
if (!xptiTraceEnabled()) | ||
|
@@ -1779,4 +1792,4 @@ class tracepoint_t { | |
/// | ||
/// @param self A pointer to the current function. | ||
/// | ||
#define XPTI_USE_TRACE_SCOPE() xpti::framework::tracepoint_scope_t TP(true); | ||
#define XPTI_USE_TRACE_SCOPE() xpti::framework::tracepoint_scope_t TP(true); |
Uh oh!
There was an error while loading. Please reload this page.