ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Context.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 Samsung Electronics Co., Ltd. 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
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef __HERMES_CONTEXT_H__
18
#define __HERMES_CONTEXT_H__
19
20
#include "
hermes/core/Config.h
"
21
#include "
hermes/core/Source.h
"
22
#include "
hermes/core/Sink.h
"
23
#include "
hermes/core/MessageBus.h
"
24
25
#include <memory>
26
#include <set>
27
28
namespace
hermes
29
{
30
39
class
Context
final :
private
MessageBus
,
private
Source::Registry
,
private
Sink::Registry
40
{
41
public
:
43
const
Config
*
config
(
void
)
const
;
45
void
config
(std::unique_ptr<Config> &&);
46
47
public
:
48
MessageBus
*
bus
(
void
) {
return
this
; }
49
50
private
:
52
void
post(std::unique_ptr<Message> &&msg)
override
;
53
54
public
:
55
Source::Registry
*
sources
(
void
) {
return
this
; }
56
57
private
:
59
void
attach(
Source
*source)
override
;
61
void
detach(
Source
*source)
override
;
62
63
public
:
64
Sink::Registry
*
sinks
(
void
) {
return
this
; }
65
66
private
:
68
void
append(std::unique_ptr<Sink> &&sink)
override
;
69
70
private
:
71
std::unique_ptr<Config> _config;
72
std::set<Source *> _sources;
73
std::set<std::unique_ptr<Sink>> _sinks;
74
};
75
76
}
// namespace hermes
77
78
#endif
// __HERMES_CONTEXT_H__
MessageBus.h
Sink.h
Source.h
hermes::Context
Logging controller.
Definition
Context.h:40
hermes::Context::sources
Source::Registry * sources(void)
Definition
Context.h:55
hermes::Context::sinks
Sink::Registry * sinks(void)
Definition
Context.h:64
hermes::Context::bus
MessageBus * bus(void)
Definition
Context.h:48
hermes::Context::config
const Config * config(void) const
Get the global configuration.
Definition
Context.cpp:24
hermes::Source
Message Source.
Definition
Source.h:35
Config.h
hermes
Definition
ConsoleReporter.h:23
hermes::Config
Top-level configuration interface.
Definition
Config.h:35
hermes::MessageBus
A bridge between Source and Sink.
Definition
MessageBus.h:31
hermes::Sink::Registry
Definition
Sink.h:35
hermes::Source::Registry
Definition
Source.h:38
compiler
hermes
include
hermes
core
Context.h
Generated by
1.9.8