diff options
Diffstat (limited to 'include/armnn')
-rw-r--r-- | include/armnn/Descriptors.hpp | 8 | ||||
-rw-r--r-- | include/armnn/INetwork.hpp | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp index b37db540da..280c18e78c 100644 --- a/include/armnn/Descriptors.hpp +++ b/include/armnn/Descriptors.hpp @@ -21,9 +21,17 @@ namespace armnn /// Base class for all descriptors. struct BaseDescriptor { + virtual bool IsNull() const { return false; } virtual ~BaseDescriptor() = default; }; +/// Null Descriptor used as a return value from the IConnectableLayer GetParameters method +/// by layers which do not have a descriptor +struct NullDescriptor : BaseDescriptor +{ + bool IsNull() const override { return true; } +}; + /// An ActivationDescriptor for the ActivationLayer. struct ActivationDescriptor : BaseDescriptor { diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index a48ee25f72..073f119ef4 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -112,6 +112,13 @@ public: /// Returns the armnn::LayerType of this layer virtual LayerType GetType() const = 0; + /// If the layer has a descriptor return it. + /// The base descriptor can then be cast to the correct descriptor class. + /// If the layer has no associated descriptor a struct of type NullDescriptor will be returned. + /// Note: NullDescriptors can be detected because they return true when + /// the BaseDescriptor IsNull function is invoked. + virtual const BaseDescriptor& GetParameters() const = 0; + protected: /// Objects are not deletable via the handle ~IConnectableLayer() {} |