ie_layer_decorator.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @file
7  */
8 
9 #pragma once
10 
12 #include <string>
13 #include <vector>
14 
15 namespace InferenceEngine {
16 
17 /**
18  * @brief Neural network builder API
19  */
20 namespace Builder {
21 
22 /**
23  * @deprecated Use ngraph API instead.
24  * @brief This class defines the basic functional for layer builders
25  */
26 class INFERENCE_ENGINE_NN_BUILDER_API_CLASS(LayerDecorator) {
27 public:
28  /**
29  * @brief The constructor creates layer builders with layer type and layer name
30  * @param type Layer type
31  * @param name Layer name
32  */
33  LayerDecorator(const std::string& type, const std::string& name);
34  /**
35  * @brief The constructor creates layer builders from reference to generic layer builder
36  * @param layer pointer to generic layer builder
37  */
38 
39  IE_SUPPRESS_DEPRECATED_START
40 
41  explicit LayerDecorator(const Layer::Ptr& layer);
42  /**
43  * @brief The constructor creates layer builders from reference to generic layer builder
44  * @param layer constant pointer to generic layer builder
45  */
46  explicit LayerDecorator(const Layer::CPtr& layer);
47 
48  /**
49  * @brief The copy constructor
50  * @param rval Source builder
51  */
52  LayerDecorator(const LayerDecorator& rval);
53 
54  /**
55  * @brief Copy operator for LayerDecorator
56  * @param rval
57  * @return Layer builder
58  */
59  LayerDecorator& operator=(const LayerDecorator& rval);
60 
61  /**
62  * @brief Virtual destructor
63  */
64  virtual ~LayerDecorator() = default;
65 
66  /**
67  * @brief The operator creates generic builder
68  * @return Generic builder
69  */
70  virtual operator Layer() const;
71 
72  /**
73  * @brief The operator creates generic builder
74  * @return Pointer to generic builder
75  */
76  virtual operator Layer::Ptr();
77 
78  /**
79  * @brief The operator creates generic builder
80  * @return Constant pointer to generic builder
81  */
82  virtual operator Layer::CPtr() const;
83 
84  IE_SUPPRESS_DEPRECATED_END
85 
86  /**
87  * @brief Returns layer type
88  * @return Layer type
89  */
90  const std::string& getType() const;
91  /**
92  * @brief Returns layer name
93  * @return Layer name
94  */
95  const std::string& getName() const;
96 
97 protected:
98  IE_SUPPRESS_DEPRECATED_START
99 
100  Layer::Ptr& getLayer();
101  const Layer::CPtr getLayer() const;
102  void checkType(const std::string& type) const;
103 
104  Layer::CPtr cLayer;
105 
106 private:
107  Layer::Ptr layer;
108 
109  IE_SUPPRESS_DEPRECATED_END
110 };
111 
112 } // namespace Builder
113 
114 } // namespace InferenceEngine
This class implements a builder for IE Layer.
Definition: ie_layer_builder.hpp:43
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
std::shared_ptr< const Layer > CPtr
A shared pointer to the constant Layer builder.
Definition: ie_layer_builder.hpp:52
std::string name
Layer name.
Definition: ie_layers.h:42
This class defines the basic functional for layer builders.
Definition: ie_layer_decorator.hpp:26
std::shared_ptr< Layer > Ptr
A shared pointer to the Layer builder.
Definition: ie_layer_builder.hpp:48
std::string type
Layer type.
Definition: ie_layers.h:47