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
0a1da9b7
Commit
0a1da9b7
authored
Mar 07, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add convenience constant invalid_stream
parent
208596dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
2 deletions
+42
-2
libcaf_core/caf/invalid_stream.hpp
libcaf_core/caf/invalid_stream.hpp
+32
-0
libcaf_core/caf/output_stream.hpp
libcaf_core/caf/output_stream.hpp
+5
-0
libcaf_core/caf/stream.hpp
libcaf_core/caf/stream.hpp
+5
-2
No files found.
libcaf_core/caf/invalid_stream.hpp
0 → 100644
View file @
0a1da9b7
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* 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_INVALID_STREAM_HPP
#define CAF_INVALID_STREAM_HPP
#include "caf/detail/type_traits.hpp"
namespace
caf
{
struct
invalid_stream_t
{};
constexpr
invalid_stream_t
invalid_stream
=
invalid_stream_t
{};
}
// namespace caf
#endif // CAF_INVALID_STREAM_HPP
libcaf_core/caf/output_stream.hpp
View file @
0a1da9b7
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "caf/make_source_result.hpp"
#include "caf/make_source_result.hpp"
#include "caf/make_stage_result.hpp"
#include "caf/make_stage_result.hpp"
#include "caf/stream_slot.hpp"
#include "caf/stream_slot.hpp"
#include "caf/invalid_stream.hpp"
#include "caf/meta/type_name.hpp"
#include "caf/meta/type_name.hpp"
...
@@ -44,6 +45,10 @@ public:
...
@@ -44,6 +45,10 @@ public:
output_stream
(
const
output_stream
&
)
=
default
;
output_stream
(
const
output_stream
&
)
=
default
;
output_stream
(
invalid_stream_t
)
:
in_
(
0
),
out_
(
0
)
{
// nop
}
template
<
class
S
>
template
<
class
S
>
output_stream
(
make_source_result
<
T
,
S
,
Ts
...
>
x
)
output_stream
(
make_source_result
<
T
,
S
,
Ts
...
>
x
)
:
in_
(
0
),
:
in_
(
0
),
...
...
libcaf_core/caf/stream.hpp
View file @
0a1da9b7
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#define CAF_STREAM_HPP
#define CAF_STREAM_HPP
#include "caf/fwd.hpp"
#include "caf/fwd.hpp"
#include "caf/invalid_stream.hpp"
#include "caf/stream_manager.hpp"
#include "caf/stream_manager.hpp"
#include "caf/stream_slot.hpp"
#include "caf/stream_slot.hpp"
...
@@ -43,12 +44,14 @@ public:
...
@@ -43,12 +44,14 @@ public:
stream
&
operator
=
(
stream
&&
)
=
default
;
stream
&
operator
=
(
stream
&&
)
=
default
;
stream
&
operator
=
(
const
stream
&
)
=
default
;
stream
&
operator
=
(
const
stream
&
)
=
default
;
/// Convenience constructor for returning the result of `self->new_stream`
/// and similar functions.
explicit
stream
(
stream_slot
id
=
0
)
:
slot_
(
id
)
{
explicit
stream
(
stream_slot
id
=
0
)
:
slot_
(
id
)
{
// nop
// nop
}
}
explicit
stream
(
invalid_stream_t
)
:
slot_
(
0
)
{
// nop
}
// -- properties -------------------------------------------------------------
// -- properties -------------------------------------------------------------
/// Returns the actor-specific stream slot ID.
/// Returns the actor-specific stream slot ID.
...
...
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