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
1754baa5
Commit
1754baa5
authored
Mar 05, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove inbound path management from local actor
parent
89f9b6f3
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
56 additions
and
88 deletions
+56
-88
libcaf_core/caf/broadcast_scatterer.hpp
libcaf_core/caf/broadcast_scatterer.hpp
+1
-1
libcaf_core/caf/buffered_scatterer.hpp
libcaf_core/caf/buffered_scatterer.hpp
+1
-1
libcaf_core/caf/detail/stream_sink_impl.hpp
libcaf_core/caf/detail/stream_sink_impl.hpp
+2
-2
libcaf_core/caf/detail/stream_source_impl.hpp
libcaf_core/caf/detail/stream_source_impl.hpp
+2
-2
libcaf_core/caf/detail/stream_stage_impl.hpp
libcaf_core/caf/detail/stream_stage_impl.hpp
+2
-2
libcaf_core/caf/fused_scatterer.hpp
libcaf_core/caf/fused_scatterer.hpp
+1
-1
libcaf_core/caf/invalid_stream_scatterer.hpp
libcaf_core/caf/invalid_stream_scatterer.hpp
+1
-1
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+0
-21
libcaf_core/caf/scheduled_actor.hpp
libcaf_core/caf/scheduled_actor.hpp
+20
-11
libcaf_core/caf/stream_manager.hpp
libcaf_core/caf/stream_manager.hpp
+3
-3
libcaf_core/caf/stream_scatterer.hpp
libcaf_core/caf/stream_scatterer.hpp
+3
-3
libcaf_core/caf/stream_scatterer_impl.hpp
libcaf_core/caf/stream_scatterer_impl.hpp
+1
-1
libcaf_core/caf/stream_sink.hpp
libcaf_core/caf/stream_sink.hpp
+1
-1
libcaf_core/caf/stream_source.hpp
libcaf_core/caf/stream_source.hpp
+1
-1
libcaf_core/caf/stream_stage.hpp
libcaf_core/caf/stream_stage.hpp
+1
-1
libcaf_core/caf/terminal_stream_scatterer.hpp
libcaf_core/caf/terminal_stream_scatterer.hpp
+1
-1
libcaf_core/src/inbound_path.cpp
libcaf_core/src/inbound_path.cpp
+1
-1
libcaf_core/src/invalid_stream_scatterer.cpp
libcaf_core/src/invalid_stream_scatterer.cpp
+1
-1
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+0
-21
libcaf_core/src/stream_manager.cpp
libcaf_core/src/stream_manager.cpp
+2
-2
libcaf_core/src/stream_scatterer.cpp
libcaf_core/src/stream_scatterer.cpp
+2
-2
libcaf_core/src/stream_scatterer_impl.cpp
libcaf_core/src/stream_scatterer_impl.cpp
+2
-1
libcaf_core/src/terminal_stream_scatterer.cpp
libcaf_core/src/terminal_stream_scatterer.cpp
+1
-1
libcaf_core/test/broadcast_scatterer.cpp
libcaf_core/test/broadcast_scatterer.cpp
+3
-3
libcaf_core/test/fused_streaming.cpp
libcaf_core/test/fused_streaming.cpp
+1
-1
libcaf_core/test/native_streaming_classes.cpp
libcaf_core/test/native_streaming_classes.cpp
+2
-2
No files found.
libcaf_core/caf/broadcast_scatterer.hpp
View file @
1754baa5
...
...
@@ -53,7 +53,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
broadcast_scatterer
(
local
_actor
*
selfptr
)
:
super
(
selfptr
)
{
broadcast_scatterer
(
scheduled
_actor
*
selfptr
)
:
super
(
selfptr
)
{
// nop
}
...
...
libcaf_core/caf/buffered_scatterer.hpp
View file @
1754baa5
...
...
@@ -46,7 +46,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
buffered_scatterer
(
local
_actor
*
self
)
:
super
(
self
)
{
buffered_scatterer
(
scheduled
_actor
*
self
)
:
super
(
self
)
{
// nop
}
...
...
libcaf_core/caf/detail/stream_sink_impl.hpp
View file @
1754baa5
...
...
@@ -43,7 +43,7 @@ public:
using
input_type
=
typename
driver_type
::
input_type
;
template
<
class
...
Ts
>
stream_sink_impl
(
local
_actor
*
self
,
Ts
&&
...
xs
)
stream_sink_impl
(
scheduled
_actor
*
self
,
Ts
&&
...
xs
)
:
stream_manager
(
self
),
driver_
(
std
::
forward
<
Ts
>
(
xs
)...),
out_
(
self
)
{
...
...
@@ -84,7 +84,7 @@ private:
};
template
<
class
Driver
,
class
...
Ts
>
stream_manager_ptr
make_stream_sink
(
local
_actor
*
self
,
Ts
&&
...
xs
)
{
stream_manager_ptr
make_stream_sink
(
scheduled
_actor
*
self
,
Ts
&&
...
xs
)
{
using
impl
=
stream_sink_impl
<
Driver
>
;
return
make_counted
<
impl
>
(
self
,
std
::
forward
<
Ts
>
(
xs
)...);
}
...
...
libcaf_core/caf/detail/stream_source_impl.hpp
View file @
1754baa5
...
...
@@ -43,7 +43,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
template
<
class
...
Ts
>
stream_source_impl
(
local
_actor
*
self
,
Ts
&&
...
xs
)
stream_source_impl
(
scheduled
_actor
*
self
,
Ts
&&
...
xs
)
:
stream_manager
(
self
),
super
(
self
),
at_end_
(
false
),
...
...
@@ -87,7 +87,7 @@ private:
};
template
<
class
Driver
,
class
...
Ts
>
typename
Driver
::
source_ptr_type
make_stream_source
(
local
_actor
*
self
,
typename
Driver
::
source_ptr_type
make_stream_source
(
scheduled
_actor
*
self
,
Ts
&&
...
xs
)
{
using
impl
=
stream_source_impl
<
Driver
>
;
return
make_counted
<
impl
>
(
self
,
std
::
forward
<
Ts
>
(
xs
)...);
...
...
libcaf_core/caf/detail/stream_stage_impl.hpp
View file @
1754baa5
...
...
@@ -49,7 +49,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
template
<
class
...
Ts
>
stream_stage_impl
(
local
_actor
*
self
,
Ts
&&
...
xs
)
stream_stage_impl
(
scheduled
_actor
*
self
,
Ts
&&
...
xs
)
:
stream_manager
(
self
),
super
(
self
),
driver_
(
std
::
forward
<
Ts
>
(
xs
)...)
{
...
...
@@ -93,7 +93,7 @@ private:
};
template
<
class
Driver
,
class
...
Ts
>
typename
Driver
::
stage_ptr_type
make_stream_stage
(
local
_actor
*
self
,
typename
Driver
::
stage_ptr_type
make_stream_stage
(
scheduled
_actor
*
self
,
Ts
&&
...
xs
)
{
using
impl
=
stream_stage_impl
<
Driver
>
;
return
make_counted
<
impl
>
(
self
,
std
::
forward
<
Ts
>
(
xs
)...);
...
...
libcaf_core/caf/fused_scatterer.hpp
View file @
1754baa5
...
...
@@ -116,7 +116,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
fused_scatterer
(
local
_actor
*
self
)
fused_scatterer
(
scheduled
_actor
*
self
)
:
super
(
self
),
nested_
(
self
,
detail
::
pack_repeat
<
Ts
...
>
(
self
))
{
detail
::
init_ptr_array
<
0
,
sizeof
...(
Ts
)
+
1
>::
apply
(
ptrs_
,
nested_
);
...
...
libcaf_core/caf/invalid_stream_scatterer.hpp
View file @
1754baa5
...
...
@@ -26,7 +26,7 @@ namespace caf {
/// Type-erased policy for dispatching data to sinks.
class
invalid_stream_scatterer
:
public
stream_scatterer
{
public:
invalid_stream_scatterer
(
local
_actor
*
self
);
invalid_stream_scatterer
(
scheduled
_actor
*
self
);
~
invalid_stream_scatterer
()
override
;
...
...
libcaf_core/caf/local_actor.hpp
View file @
1754baa5
...
...
@@ -400,27 +400,6 @@ public:
message_id
new_request_id
(
message_priority
mp
);
/// Creates a new path for incoming stream traffic from `sender`.
virtual
inbound_path
*
make_inbound_path
(
stream_manager_ptr
mgr
,
stream_slots
slots
,
strong_actor_ptr
sender
);
/// Silently closes incoming stream traffic on `slot`.
virtual
void
erase_inbound_path_later
(
stream_slot
slot
);
/// Closes incoming stream traffic on `slot`. Emits a drop message on the
/// path if `reason == none` and a `forced_drop` message otherwise.
virtual
void
erase_inbound_path_later
(
stream_slot
slot
,
error
reason
);
/// Silently closes all inbound paths for `mgr`.
virtual
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
);
/// Closes all incoming stream traffic for a manager. Emits a drop message on
/// each path if `reason == none` and a `forced_drop` message on each path
/// otherwise.
virtual
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
,
error
reason
);
protected:
// -- member variables -------------------------------------------------------
...
...
libcaf_core/caf/scheduled_actor.hpp
View file @
1754baa5
...
...
@@ -732,17 +732,26 @@ public:
// -- inbound_path management ------------------------------------------------
inbound_path
*
make_inbound_path
(
stream_manager_ptr
mgr
,
stream_slots
slots
,
strong_actor_ptr
sender
)
override
;
void
erase_inbound_path_later
(
stream_slot
slot
)
override
;
void
erase_inbound_path_later
(
stream_slot
slot
,
error
reason
)
override
;
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
)
override
;
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
,
error
reason
)
override
;
/// Creates a new path for incoming stream traffic from `sender`.
virtual
inbound_path
*
make_inbound_path
(
stream_manager_ptr
mgr
,
stream_slots
slots
,
strong_actor_ptr
sender
);
/// Silently closes incoming stream traffic on `slot`.
virtual
void
erase_inbound_path_later
(
stream_slot
slot
);
/// Closes incoming stream traffic on `slot`. Emits a drop message on the
/// path if `reason == none` and a `forced_drop` message otherwise.
virtual
void
erase_inbound_path_later
(
stream_slot
slot
,
error
reason
);
/// Silently closes all inbound paths for `mgr`.
virtual
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
);
/// Closes all incoming stream traffic for a manager. Emits a drop message on
/// each path if `reason == none` and a `forced_drop` message on each path
/// otherwise.
virtual
void
erase_inbound_paths_later
(
const
stream_manager
*
mgr
,
error
reason
);
// -- handling of stream message ---------------------------------------------
...
...
libcaf_core/caf/stream_manager.hpp
View file @
1754baa5
...
...
@@ -40,7 +40,7 @@ public:
using
inbound_paths_list
=
std
::
vector
<
inbound_path
*>
;
stream_manager
(
local
_actor
*
selfptr
,
stream_manager
(
scheduled
_actor
*
selfptr
,
stream_priority
prio
=
stream_priority
::
normal
);
~
stream_manager
()
override
;
...
...
@@ -171,7 +171,7 @@ public:
}
/// Returns the parent actor.
inline
local
_actor
*
self
()
{
inline
scheduled
_actor
*
self
()
{
return
self_
;
}
...
...
@@ -209,7 +209,7 @@ protected:
virtual
void
output_closed
(
error
reason
);
/// Points to the parent actor.
local
_actor
*
self_
;
scheduled
_actor
*
self_
;
/// Stores non-owning pointers to all input paths.
inbound_paths_list
inbound_paths_
;
...
...
libcaf_core/caf/stream_scatterer.hpp
View file @
1754baa5
...
...
@@ -60,13 +60,13 @@ public:
// -- constructors, destructors, and assignment operators --------------------
explicit
stream_scatterer
(
local
_actor
*
self
);
explicit
stream_scatterer
(
scheduled
_actor
*
self
);
virtual
~
stream_scatterer
();
// -- properties -------------------------------------------------------------
local
_actor
*
self
()
const
{
scheduled
_actor
*
self
()
const
{
return
self_
;
}
...
...
@@ -208,7 +208,7 @@ protected:
// -- member variables -------------------------------------------------------
local
_actor
*
self_
;
scheduled
_actor
*
self_
;
};
}
// namespace caf
...
...
libcaf_core/caf/stream_scatterer_impl.hpp
View file @
1754baa5
...
...
@@ -41,7 +41,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
explicit
stream_scatterer_impl
(
local
_actor
*
self
);
explicit
stream_scatterer_impl
(
scheduled
_actor
*
self
);
virtual
~
stream_scatterer_impl
();
...
...
libcaf_core/caf/stream_sink.hpp
View file @
1754baa5
...
...
@@ -37,7 +37,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
stream_sink
(
local
_actor
*
self
)
:
stream_manager
(
self
)
{
stream_sink
(
scheduled
_actor
*
self
)
:
stream_manager
(
self
)
{
// nop
}
};
...
...
libcaf_core/caf/stream_source.hpp
View file @
1754baa5
...
...
@@ -37,7 +37,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
stream_source
(
local
_actor
*
self
)
:
stream_manager
(
self
),
out_
(
self
)
{
stream_source
(
scheduled
_actor
*
self
)
:
stream_manager
(
self
),
out_
(
self
)
{
// nop
}
...
...
libcaf_core/caf/stream_stage.hpp
View file @
1754baa5
...
...
@@ -40,7 +40,7 @@ public:
// -- constructors, destructors, and assignment operators --------------------
stream_stage
(
local
_actor
*
self
)
stream_stage
(
scheduled
_actor
*
self
)
:
stream_manager
(
self
),
left_super
(
self
),
right_super
(
self
)
{
...
...
libcaf_core/caf/terminal_stream_scatterer.hpp
View file @
1754baa5
...
...
@@ -29,7 +29,7 @@ class terminal_stream_scatterer : public invalid_stream_scatterer {
public:
using
super
=
invalid_stream_scatterer
;
terminal_stream_scatterer
(
local
_actor
*
self
);
terminal_stream_scatterer
(
scheduled
_actor
*
self
);
~
terminal_stream_scatterer
()
override
;
...
...
libcaf_core/src/inbound_path.cpp
View file @
1754baa5
...
...
@@ -21,7 +21,7 @@
#include "caf/send.hpp"
#include "caf/logger.hpp"
#include "caf/no_stages.hpp"
#include "caf/
local
_actor.hpp"
#include "caf/
scheduled
_actor.hpp"
namespace
caf
{
...
...
libcaf_core/src/invalid_stream_scatterer.cpp
View file @
1754baa5
...
...
@@ -24,7 +24,7 @@
namespace
caf
{
invalid_stream_scatterer
::
invalid_stream_scatterer
(
local
_actor
*
self
)
invalid_stream_scatterer
::
invalid_stream_scatterer
(
scheduled
_actor
*
self
)
:
stream_scatterer
(
self
)
{
// nop
}
...
...
libcaf_core/src/local_actor.cpp
View file @
1754baa5
...
...
@@ -125,25 +125,4 @@ bool local_actor::cleanup(error&& fail_state, execution_unit* host) {
return
true
;
}
inbound_path
*
local_actor
::
make_inbound_path
(
stream_manager_ptr
,
stream_slots
,
strong_actor_ptr
)
{
return
nullptr
;
}
void
local_actor
::
erase_inbound_path_later
(
stream_slot
)
{
CAF_LOG_ERROR
(
"local_actor::erase_inbound_path_later called"
);
}
void
local_actor
::
erase_inbound_path_later
(
stream_slot
,
error
)
{
CAF_LOG_ERROR
(
"local_actor::erase_inbound_path_later called"
);
}
void
local_actor
::
erase_inbound_paths_later
(
const
stream_manager
*
)
{
CAF_LOG_ERROR
(
"local_actor::erase_inbound_paths_later called"
);
}
void
local_actor
::
erase_inbound_paths_later
(
const
stream_manager
*
,
error
)
{
CAF_LOG_ERROR
(
"local_actor::erase_inbound_paths_later called"
);
}
}
// namespace caf
libcaf_core/src/stream_manager.cpp
View file @
1754baa5
...
...
@@ -24,7 +24,7 @@
#include "caf/error.hpp"
#include "caf/expected.hpp"
#include "caf/inbound_path.hpp"
#include "caf/
local
_actor.hpp"
#include "caf/
scheduled
_actor.hpp"
#include "caf/logger.hpp"
#include "caf/message.hpp"
#include "caf/outbound_path.hpp"
...
...
@@ -34,7 +34,7 @@
namespace
caf
{
stream_manager
::
stream_manager
(
local
_actor
*
selfptr
,
stream_priority
prio
)
stream_manager
::
stream_manager
(
scheduled
_actor
*
selfptr
,
stream_priority
prio
)
:
self_
(
selfptr
),
pending_handshakes_
(
0
),
priority_
(
prio
),
...
...
libcaf_core/src/stream_scatterer.cpp
View file @
1754baa5
...
...
@@ -22,7 +22,7 @@
#include "caf/actor_addr.hpp"
#include "caf/actor_cast.hpp"
#include "caf/
local
_actor.hpp"
#include "caf/
scheduled
_actor.hpp"
#include "caf/logger.hpp"
#include "caf/outbound_path.hpp"
...
...
@@ -36,7 +36,7 @@ stream_scatterer::stream_scatterer::path_predicate::~path_predicate() {
// nop
}
stream_scatterer
::
stream_scatterer
(
local
_actor
*
self
)
:
self_
(
self
)
{
stream_scatterer
::
stream_scatterer
(
scheduled
_actor
*
self
)
:
self_
(
self
)
{
// nop
}
...
...
libcaf_core/src/stream_scatterer_impl.cpp
View file @
1754baa5
...
...
@@ -25,7 +25,8 @@
namespace
caf
{
stream_scatterer_impl
::
stream_scatterer_impl
(
local_actor
*
self
)
:
super
(
self
)
{
stream_scatterer_impl
::
stream_scatterer_impl
(
scheduled_actor
*
self
)
:
super
(
self
)
{
// nop
}
...
...
libcaf_core/src/terminal_stream_scatterer.cpp
View file @
1754baa5
...
...
@@ -22,7 +22,7 @@
namespace
caf
{
terminal_stream_scatterer
::
terminal_stream_scatterer
(
local
_actor
*
self
)
terminal_stream_scatterer
::
terminal_stream_scatterer
(
scheduled
_actor
*
self
)
:
super
(
self
)
{
// nop
}
...
...
libcaf_core/test/broadcast_scatterer.cpp
View file @
1754baa5
...
...
@@ -24,7 +24,7 @@
#include "caf/actor_system.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/broadcast_scatterer.hpp"
#include "caf/
local
_actor.hpp"
#include "caf/
scheduled
_actor.hpp"
#include "caf/mixin/sender.hpp"
...
...
@@ -35,11 +35,11 @@ using namespace caf;
namespace
{
// Mocks just enough of an actor to receive and send batches.
class
entity
:
public
extend
<
local_actor
,
entity
>::
with
<
mixin
::
sender
>
{
class
entity
:
public
scheduled_actor
{
public:
// -- member types -----------------------------------------------------------
using
super
=
extend
<
local_actor
,
entity
>::
with
<
mixin
::
sender
>
;
using
super
=
scheduled_actor
;
using
signatures
=
none_t
;
...
...
libcaf_core/test/fused_streaming.cpp
View file @
1754baa5
...
...
@@ -170,7 +170,7 @@ using scatterer = fused_scatterer<int_scatterer, string_scatterer>;
class
fused_stage
:
public
stream_manager
{
public:
fused_stage
(
local
_actor
*
self
)
:
stream_manager
(
self
),
out_
(
self
)
{
fused_stage
(
scheduled
_actor
*
self
)
:
stream_manager
(
self
),
out_
(
self
)
{
continuous
(
true
);
}
...
...
libcaf_core/test/native_streaming_classes.cpp
View file @
1754baa5
...
...
@@ -149,12 +149,12 @@ using mboxqueue =
// -- entity and mailbox visitor -----------------------------------------------
class
entity
:
public
extend
<
local_actor
,
entity
>::
with
<
mixin
::
sender
>
{
class
entity
:
public
scheduled_actor
{
public:
// -- member types -----------------------------------------------------------
/// Base type.
using
super
=
extend
<
local_actor
,
entity
>::
with
<
mixin
::
sender
>
;
using
super
=
scheduled_actor
;
/// Defines the messaging interface.
using
signatures
=
none_t
;
...
...
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