dataflow.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #pragma once
17 
18 
26 
27 namespace Aws {
28 namespace DataFlow {
29 
30 template<
31  typename T,
32  class O>
33 typename std::enable_if<std::is_base_of<Sink<T>, O>::value, std::shared_ptr<O>>::type
34 inline operator >> (
35  OutputStage<T> &output_stage,
36  std::shared_ptr<O> sink)
37 {
38  output_stage.setSink(sink);
39  return sink;
40 }
41 
42 template<
43  typename T,
44  class O>
45 typename std::enable_if<std::is_base_of<QueueDemux<T>, O>::value, std::shared_ptr<O>>::type
46 inline operator >> (
47  std::tuple<std::shared_ptr<ObservedQueue<T>>,
48  PriorityOptions> observed_queue,
49  std::shared_ptr<O> sink)
50 {
51  sink->addSource(std::get<0>(observed_queue), std::get<1>(observed_queue));
52  return sink;
53 }
54 
55 template<typename T>
56 std::tuple<std::shared_ptr<ObservedQueue<T>>, PriorityOptions>
57 inline operator >> (
58  std::shared_ptr<ObservedQueue<T>> observed_queue,
59  PriorityLevel level)
60 {
61  return std::make_tuple(observed_queue, PriorityOptions(level));
62 }
63 
64 template<
65  typename O,
66  class T,
67  class = typename std::enable_if<std::is_base_of<Source<T>, O>::value, std::shared_ptr<O>>::type>
69  std::shared_ptr<O> source,
70  InputStage<T> &inputStage)
71 {
72  inputStage.setSource(source);
73  return inputStage;
74 }
75 
76 } // namespace DataFlow
77 } // namespace Aws
void setSource(std::shared_ptr< Source< I >> source)
Definition: pipeline.h:53
std::enable_if< std::is_base_of< Sink< O >, T >::value, std::shared_ptr< T > >::type setSink(std::shared_ptr< T > sink)
Definition: pipeline.h:39
std::enable_if< std::is_base_of< Sink< T >, O >::value, std::shared_ptr< O > >::type operator>>(OutputStage< T > &output_stage, std::shared_ptr< O > sink)
Definition: dataflow.h:34


dataflow_lite
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:22