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
5aa1818e
Commit
5aa1818e
authored
Mar 06, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add backwards compatibility functions
parent
01e5078d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
6 deletions
+66
-6
libcaf_core/caf/blocking_actor.hpp
libcaf_core/caf/blocking_actor.hpp
+10
-1
libcaf_core/caf/detail/enqueue_result.hpp
libcaf_core/caf/detail/enqueue_result.hpp
+34
-0
libcaf_core/caf/intrusive/fifo_inbox.hpp
libcaf_core/caf/intrusive/fifo_inbox.hpp
+22
-5
No files found.
libcaf_core/caf/blocking_actor.hpp
View file @
5aa1818e
...
@@ -367,7 +367,6 @@ public:
...
@@ -367,7 +367,6 @@ public:
virtual
bool
await_data
(
timeout_type
timeout
);
virtual
bool
await_data
(
timeout_type
timeout
);
/// Returns the next element from the mailbox or `nullptr`.
/// Returns the next element from the mailbox or `nullptr`.
/// The default implementation simply returns `next_message()`.
virtual
mailbox_element_ptr
dequeue
();
virtual
mailbox_element_ptr
dequeue
();
/// Returns the queue for storing incoming messages.
/// Returns the queue for storing incoming messages.
...
@@ -418,6 +417,16 @@ public:
...
@@ -418,6 +417,16 @@ public:
sec
build_pipeline
(
stream_slot
in
,
stream_slot
out
,
stream_manager_ptr
mgr
);
sec
build_pipeline
(
stream_slot
in
,
stream_slot
out
,
stream_manager_ptr
mgr
);
// -- backwards compatibility ------------------------------------------------
inline
mailbox_element_ptr
next_message
()
{
return
dequeue
();
}
inline
bool
has_next_message
()
{
return
!
mailbox_
.
empty
();
}
/// @endcond
/// @endcond
private:
private:
...
...
libcaf_core/caf/detail/enqueue_result.hpp
0 → 100644
View file @
5aa1818e
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright (C) 2011 - 2017 *
* Dominik Charousset <dominik.charousset (at) haw-hamburg.de> *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#ifndef CAF_DETAIL_ENQUEUE_RESULT_HPP
#define CAF_DETAIL_ENQUEUE_RESULT_HPP
#include "caf/intrusive/inbox_result.hpp"
namespace
caf
{
namespace
detail
{
/// Alias for backwards compatibility.
using
enqueue_result
=
intrusive
::
inbox_result
;
}
// namespace intrusive
}
// namespace caf
#endif // CAF_DETAIL_ENQUEUE_RESULT_HPP
libcaf_core/caf/intrusive/fifo_inbox.hpp
View file @
5aa1818e
...
@@ -36,6 +36,8 @@
...
@@ -36,6 +36,8 @@
#include "caf/intrusive/lifo_inbox.hpp"
#include "caf/intrusive/lifo_inbox.hpp"
#include "caf/intrusive/new_round_result.hpp"
#include "caf/intrusive/new_round_result.hpp"
#include "caf/detail/enqueue_result.hpp"
namespace
caf
{
namespace
caf
{
namespace
intrusive
{
namespace
intrusive
{
...
@@ -71,11 +73,6 @@ public:
...
@@ -71,11 +73,6 @@ public:
// -- queue and stack status functions ---------------------------------------
// -- queue and stack status functions ---------------------------------------
/// Returns an approximation of the current size.
size_t
count
(
size_t
)
noexcept
CAF_DEPRECATED
{
return
size
();
}
/// Returns an approximation of the current size.
/// Returns an approximation of the current size.
size_t
size
()
noexcept
{
size_t
size
()
noexcept
{
fetch_more
();
fetch_more
();
...
@@ -98,10 +95,12 @@ public:
...
@@ -98,10 +95,12 @@ public:
return
inbox_
.
blocked
();
return
inbox_
.
blocked
();
}
}
/// Appends `ptr` to the inbox.
inbox_result
push_back
(
pointer
ptr
)
noexcept
{
inbox_result
push_back
(
pointer
ptr
)
noexcept
{
return
inbox_
.
push_front
(
ptr
);
return
inbox_
.
push_front
(
ptr
);
}
}
/// Appends `ptr` to the inbox.
inbox_result
push_back
(
unique_pointer
ptr
)
noexcept
{
inbox_result
push_back
(
unique_pointer
ptr
)
noexcept
{
return
push_back
(
ptr
.
release
());
return
push_back
(
ptr
.
release
());
}
}
...
@@ -111,6 +110,24 @@ public:
...
@@ -111,6 +110,24 @@ public:
return
push_back
(
new
value_type
(
std
::
forward
<
Ts
>
(
xs
)...));
return
push_back
(
new
value_type
(
std
::
forward
<
Ts
>
(
xs
)...));
}
}
// -- backwards compatibility ------------------------------------------------
/// @cond PRIVATE
detail
::
enqueue_result
enqueue
(
pointer
ptr
)
noexcept
{
return
static_cast
<
detail
::
enqueue_result
>
(
inbox_
.
push_front
(
ptr
));
}
size_t
count
()
noexcept
{
return
size
();
}
size_t
count
(
size_t
)
noexcept
{
return
size
();
}
/// @endcond
// -- queue management -------------------------------------------------------
// -- queue management -------------------------------------------------------
void
flush_cache
()
noexcept
{
void
flush_cache
()
noexcept
{
...
...
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