DetectorGraph
2.0
include
graphinputdispatcher.hpp
Go to the documentation of this file.
1
// Copyright 2017 Nest Labs, Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef DETECTORGRAPH_INCLUDE_GRAPHINPUTDISPATCHER_HPP_
16
#define DETECTORGRAPH_INCLUDE_GRAPHINPUTDISPATCHER_HPP_
17
18
#include "
topic.hpp
"
19
#include "
vertex.hpp
"
20
21
namespace
DetectorGraph
22
{
23
/**
24
* @brief _Internal_ - Provide interface for a GraphInputDispatcher
25
*/
26
class
GraphInputDispatcherInterface
27
{
28
public
:
29
virtual
~GraphInputDispatcherInterface
() {}
30
virtual
void
Dispatch
() = 0;
31
};
32
/**
33
* @brief _Internal_ - Push data to the graph
34
*
35
* It pushes data to a specific topic through a graphInputDispatcher.
36
* The pending data will be evaluated in the next round.
37
*/
38
template
<
class
T>
39
class
GraphInputDispatcher
:
public
GraphInputDispatcherInterface
40
{
41
public
:
42
GraphInputDispatcher
(
Topic<T>
& aTopic,
const
T& aData)
43
: mTopic(aTopic)
44
, mData(aData)
45
{
46
}
47
48
void
Dispatch
()
49
{
50
mTopic.Publish(mData);
51
}
52
private
:
53
Topic<T>
& mTopic;
54
const
T mData;
55
};
56
57
}
// namespace DetectorGraph
58
59
#endif // DETECTORGRAPH_INCLUDE_GRAPHINPUTDISPATCHER_HPP_
DetectorGraph::GraphInputDispatcherInterface
Internal - Provide interface for a GraphInputDispatcher
Definition:
graphinputdispatcher.hpp:26
topic.hpp
DetectorGraph::GraphInputDispatcher::GraphInputDispatcher
GraphInputDispatcher(Topic< T > &aTopic, const T &aData)
Definition:
graphinputdispatcher.hpp:42
vertex.hpp
DetectorGraph::Topic
Manage data and its handler.
Definition:
topic.hpp:84
DetectorGraph::GraphInputDispatcherInterface::Dispatch
virtual void Dispatch()=0
DetectorGraph::GraphInputDispatcher::Dispatch
void Dispatch()
Definition:
graphinputdispatcher.hpp:48
DetectorGraph::GraphInputDispatcherInterface::~GraphInputDispatcherInterface
virtual ~GraphInputDispatcherInterface()
Definition:
graphinputdispatcher.hpp:29
DetectorGraph::GraphInputDispatcher
Internal - Push data to the graph
Definition:
graphinputdispatcher.hpp:39
DetectorGraph
Definition:
detector.hpp:28
Generated by
1.8.13