Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
55bc8869
Commit
55bc8869
authored
Feb 26, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use `util::comparable` for message_id_t
parent
2c7f5b80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
cppa/message_id.hpp
cppa/message_id.hpp
+10
-14
No files found.
cppa/message_id.hpp
View file @
55bc8869
...
...
@@ -32,23 +32,22 @@
#define CPPA_MESSAGE_ID_HPP
#include "cppa/config.hpp"
#include "cppa/util/comparable.hpp"
namespace
cppa
{
struct
invalid_message_id
_flag
{
constexpr
invalid_message_id_flag
()
{
}
};
struct
invalid_message_id
{
constexpr
invalid_message_id
()
{
}
};
/**
* @brief
* @note Asynchronous messages always have an invalid message id.
*/
class
message_id_t
{
class
message_id_t
:
util
::
comparable
<
message_id_t
>
{
static
constexpr
std
::
uint64_t
response_flag_mask
=
0x8000000000000000
;
static
constexpr
std
::
uint64_t
answered_flag_mask
=
0x4000000000000000
;
static
constexpr
std
::
uint64_t
request_id_mask
=
0x3FFFFFFFFFFFFFFF
;
friend
bool
operator
==
(
const
message_id_t
&
lhs
,
const
message_id_t
&
rhs
);
public:
constexpr
message_id_t
()
:
m_value
(
0
)
{
}
...
...
@@ -101,9 +100,14 @@ class message_id_t {
return
result
;
}
static
constexpr
invalid_message_id_flag
invalid
=
invalid_message_id_flag
();
static
constexpr
invalid_message_id
invalid
=
invalid_message_id
{};
constexpr
message_id_t
(
invalid_message_id
)
:
m_value
(
0
)
{
}
inline
message_id_t
(
invalid_message_id_flag
)
:
m_value
(
0
)
{
}
long
compare
(
const
message_id_t
&
other
)
const
{
return
(
m_value
==
other
.
m_value
)
?
0
:
((
m_value
<
other
.
m_value
)
?
-
1
:
1
);
}
private:
...
...
@@ -113,14 +117,6 @@ class message_id_t {
};
inline
bool
operator
==
(
const
message_id_t
&
lhs
,
const
message_id_t
&
rhs
)
{
return
lhs
.
m_value
==
rhs
.
m_value
;
}
inline
bool
operator
!=
(
const
message_id_t
&
lhs
,
const
message_id_t
&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
}
// namespace cppa
#endif // CPPA_MESSAGE_ID_HPP
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment