ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Pass.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 __ENCO_PASS_H__
18#define __ENCO_PASS_H__
19
20#include "Session.h"
21
22#include <string>
23
24namespace enco
25{
26
27class Pass
28{
29public:
30 class Name
31 {
32 public:
33 Name(const std::string &content) : _content{content}
34 {
35 // DO NOTHING
36 }
37
38 Name(const Name &) = default;
39 Name(Name &&) = default;
40
41 ~Name() = default;
42
43 public:
44 const std::string &content(void) const { return _content; }
45
46 private:
47 std::string _content;
48 };
49
50public:
51 Pass(const Name &name) : _name{name}
52 {
53 // DO NOTHING
54 }
55
56 Pass(const Pass &) = delete;
57 Pass(Pass &&) = delete;
58
59 virtual ~Pass() = default;
60
61public:
62 const Name &name(void) const { return _name; }
63
64public:
65 virtual void run(const SessionID &) const = 0;
66
67private:
68 Name _name;
69};
70
71static inline Pass::Name pass_name(const std::string &name) { return Pass::Name{name}; }
72
73} // namespace enco
74
75#define PASS_CTOR(NAME) \
76 NAME() : enco::Pass { enco::pass_name(#NAME) }
77
78#endif // __ENCO_PASS_H__
Name(Name &&)=default
const std::string & content(void) const
Definition Pass.h:44
Name(const std::string &content)
Definition Pass.h:33
Name(const Name &)=default
Pass(Pass &&)=delete
virtual void run(const SessionID &) const =0
Pass(const Pass &)=delete
Pass(const Name &name)
Definition Pass.h:51
virtual ~Pass()=default
const Name & name(void) const
Definition Pass.h:62
Definition Bundle.h:26
uint32_t SessionID
Definition Session.h:26