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
c82647ff
Commit
c82647ff
authored
Aug 01, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix node_id object size on MSVC
parent
4ebdeba7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
12 deletions
+51
-12
libcaf_core/caf/node_id.hpp
libcaf_core/caf/node_id.hpp
+51
-7
libcaf_core/src/node_id.cpp
libcaf_core/src/node_id.cpp
+0
-5
No files found.
libcaf_core/caf/node_id.hpp
View file @
c82647ff
...
@@ -34,8 +34,7 @@
...
@@ -34,8 +34,7 @@
namespace
caf
{
namespace
caf
{
/// A node ID is an opaque value for representing CAF instances in the network.
/// A node ID is an opaque value for representing CAF instances in the network.
class
node_id
:
detail
::
comparable
<
node_id
>
,
class
node_id
{
detail
::
comparable
<
node_id
,
none_t
>
{
public:
public:
// -- member types -----------------------------------------------------------
// -- member types -----------------------------------------------------------
...
@@ -195,11 +194,6 @@ public:
...
@@ -195,11 +194,6 @@ public:
/// @returns -1 if `*this < other`, 0 if `*this == other`, and 1 otherwise.
/// @returns -1 if `*this < other`, 0 if `*this == other`, and 1 otherwise.
int
compare
(
const
node_id
&
other
)
const
noexcept
;
int
compare
(
const
node_id
&
other
)
const
noexcept
;
/// Compares this instance as if comparing to a default-constructed
/// `node_id`.
/// @returns `compare(node_id{})`.
int
compare
(
const
none_t
&
)
const
;
/// Exchanges the value of this object with `other`.
/// Exchanges the value of this object with `other`.
void
swap
(
node_id
&
other
);
void
swap
(
node_id
&
other
);
...
@@ -231,6 +225,56 @@ private:
...
@@ -231,6 +225,56 @@ private:
intrusive_ptr
<
data
>
data_
;
intrusive_ptr
<
data
>
data_
;
};
};
/// @relates node_id
inline
bool
operator
==
(
const
node_id
&
x
,
const
node_id
&
y
)
noexcept
{
return
x
.
compare
(
y
)
==
0
;
}
/// @relates node_id
inline
bool
operator
!=
(
const
node_id
&
x
,
const
node_id
&
y
)
noexcept
{
return
x
.
compare
(
y
)
!=
0
;
}
/// @relates node_id
inline
bool
operator
<
(
const
node_id
&
x
,
const
node_id
&
y
)
noexcept
{
return
x
.
compare
(
y
)
<
0
;
}
/// @relates node_id
inline
bool
operator
<=
(
const
node_id
&
x
,
const
node_id
&
y
)
noexcept
{
return
x
.
compare
(
y
)
<=
0
;
}
/// @relates node_id
inline
bool
operator
>
(
const
node_id
&
x
,
const
node_id
&
y
)
noexcept
{
return
x
.
compare
(
y
)
>
0
;
}
/// @relates node_id
inline
bool
operator
>=
(
const
node_id
&
x
,
const
node_id
&
y
)
noexcept
{
return
x
.
compare
(
y
)
>=
0
;
}
/// @relates node_id
inline
bool
operator
==
(
const
node_id
&
x
,
const
none_t
&
)
noexcept
{
return
!
x
;
}
/// @relates node_id
inline
bool
operator
==
(
const
none_t
&
,
const
node_id
&
x
)
noexcept
{
return
!
x
;
}
/// @relates node_id
inline
bool
operator
!=
(
const
node_id
&
x
,
const
none_t
&
)
noexcept
{
return
static_cast
<
bool
>
(
x
);
}
/// @relates node_id
inline
bool
operator
!=
(
const
none_t
&
,
const
node_id
&
x
)
noexcept
{
return
static_cast
<
bool
>
(
x
);
}
/// @relates node_id
/// @relates node_id
error
inspect
(
serializer
&
sink
,
const
node_id
&
x
);
error
inspect
(
serializer
&
sink
,
const
node_id
&
x
);
...
...
libcaf_core/src/node_id.cpp
View file @
c82647ff
...
@@ -182,11 +182,6 @@ node_id::operator bool() const {
...
@@ -182,11 +182,6 @@ node_id::operator bool() const {
return
static_cast
<
bool
>
(
data_
);
return
static_cast
<
bool
>
(
data_
);
}
}
int
node_id
::
compare
(
const
none_t
&
)
const
{
// Invalid instances are always smaller.
return
data_
?
1
:
0
;
}
int
node_id
::
compare
(
const
node_id
&
other
)
const
noexcept
{
int
node_id
::
compare
(
const
node_id
&
other
)
const
noexcept
{
if
(
this
==
&
other
||
data_
==
other
.
data_
)
if
(
this
==
&
other
||
data_
==
other
.
data_
)
return
0
;
return
0
;
...
...
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