From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- .../classarmnn_1_1_optional_reference_switch.xhtml | 572 +++++++++++++++++++++ 1 file changed, 572 insertions(+) create mode 100644 20.02/classarmnn_1_1_optional_reference_switch.xhtml (limited to '20.02/classarmnn_1_1_optional_reference_switch.xhtml') diff --git a/20.02/classarmnn_1_1_optional_reference_switch.xhtml b/20.02/classarmnn_1_1_optional_reference_switch.xhtml new file mode 100644 index 0000000000..b5002d8f7e --- /dev/null +++ b/20.02/classarmnn_1_1_optional_reference_switch.xhtml @@ -0,0 +1,572 @@ + + + + + + + + + + + + + +ArmNN: OptionalReferenceSwitch< IsReference, T > Class Template Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
OptionalReferenceSwitch< IsReference, T > Class Template Reference
+
+
+ +

The default implementation is the non-reference case. + More...

+ +

#include <Optional.hpp>

+
+Inheritance diagram for OptionalReferenceSwitch< IsReference, T >:
+
+
+ + +OptionalBase + +
+ + + + +

+Public Types

using Base = OptionalBase
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 OptionalReferenceSwitch () noexcept
 
 OptionalReferenceSwitch (EmptyOptional) noexcept
 
 OptionalReferenceSwitch (const T &value)
 
template<class... Args>
 OptionalReferenceSwitch (ConstructInPlace, Args &&... args)
 
 OptionalReferenceSwitch (const OptionalReferenceSwitch &other)
 
OptionalReferenceSwitchoperator= (const T &value)
 
OptionalReferenceSwitchoperator= (const OptionalReferenceSwitch &other)
 
OptionalReferenceSwitchoperator= (EmptyOptional)
 
 ~OptionalReferenceSwitch ()
 
void reset ()
 
const T & value () const
 
T & value ()
 
- Public Member Functions inherited from OptionalBase
 OptionalBase () noexcept
 
bool has_value () const noexcept
 
 operator bool () const noexcept
 Conversion to bool, so can be used in if-statements and similar contexts expecting a bool. More...
 
+ + + + + + + +

+Additional Inherited Members

- Protected Member Functions inherited from OptionalBase
 OptionalBase (bool hasValue) noexcept
 
- Protected Attributes inherited from OptionalBase
bool m_HasValue
 
+

Detailed Description

+

template<bool IsReference, typename T>
+class armnn::OptionalReferenceSwitch< IsReference, T >

+ +

The default implementation is the non-reference case.

+

This has an unsigned char array for storing the optional value which is in-place constructed there.

+ +

Definition at line 81 of file Optional.hpp.

+

Member Typedef Documentation

+ +

◆ Base

+ +
+
+ + + + +
using Base = OptionalBase
+
+ +

Definition at line 84 of file Optional.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ OptionalReferenceSwitch() [1/5]

+ +
+
+ + + + + +
+ + + + + + + +
OptionalReferenceSwitch ()
+
+inlinenoexcept
+
+ +

Definition at line 86 of file Optional.hpp.

+
86 : Base{} {}
+
+
+
+ +

◆ OptionalReferenceSwitch() [2/5]

+ +
+
+ + + + + +
+ + + + + + + + +
OptionalReferenceSwitch (EmptyOptional )
+
+inlinenoexcept
+
+ +

Definition at line 87 of file Optional.hpp.

+
87 : Base{} {}
+
+
+
+ +

◆ OptionalReferenceSwitch() [3/5]

+ +
+
+ + + + + +
+ + + + + + + + +
OptionalReferenceSwitch (const T & value)
+
+inline
+
+ +

Definition at line 89 of file Optional.hpp.

+
90  : Base{}
91  {
92  Construct(value);
93  }
+ +
+
+
+ +

◆ OptionalReferenceSwitch() [4/5]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
OptionalReferenceSwitch (ConstructInPlace ,
Args &&... args 
)
+
+inline
+
+ +

Definition at line 96 of file Optional.hpp.

+
97  : Base{}
98  {
99  Construct(CONSTRUCT_IN_PLACE, std::forward<Args>(args)...);
100  }
#define CONSTRUCT_IN_PLACE
Definition: Optional.hpp:41
+ +
+
+
+ +

◆ OptionalReferenceSwitch() [5/5]

+ +
+
+ + + + + +
+ + + + + + + + +
OptionalReferenceSwitch (const OptionalReferenceSwitch< IsReference, T > & other)
+
+inline
+
+ +

Definition at line 102 of file Optional.hpp.

+
103  : Base{}
104  {
105  *this = other;
106  }
+
+
+
+ +

◆ ~OptionalReferenceSwitch()

+ +
+
+ + + + + +
+ + + + + + + +
~OptionalReferenceSwitch ()
+
+inline
+
+ +

Definition at line 132 of file Optional.hpp.

+
133  {
134  reset();
135  }
+
+
+
+

Member Function Documentation

+ +

◆ operator=() [1/3]

+ +
+
+ + + + + +
+ + + + + + + + +
OptionalReferenceSwitch& operator= (const T & value)
+
+inline
+
+ +

Definition at line 108 of file Optional.hpp.

+
109  {
110  reset();
111  Construct(value);
112  return *this;
113  }
+ +
+
+
+ +

◆ operator=() [2/3]

+ +
+
+ + + + + +
+ + + + + + + + +
OptionalReferenceSwitch& operator= (const OptionalReferenceSwitch< IsReference, T > & other)
+
+inline
+
+ +

Definition at line 115 of file Optional.hpp.

+
116  {
117  reset();
118  if (other.has_value())
119  {
120  Construct(other.value());
121  }
122 
123  return *this;
124  }
+
+
+
+ +

◆ operator=() [3/3]

+ +
+
+ + + + + +
+ + + + + + + + +
OptionalReferenceSwitch& operator= (EmptyOptional )
+
+inline
+
+ +

Definition at line 126 of file Optional.hpp.

+
127  {
128  reset();
129  return *this;
130  }
+
+
+
+ +

◆ reset()

+ +
+
+ + + + + +
+ + + + + + + +
void reset ()
+
+inline
+
+ +

Definition at line 137 of file Optional.hpp.

+
138  {
139  if (Base::has_value())
140  {
141  value().T::~T();
142  Base::m_HasValue = false;
143  }
144  }
+ +
bool has_value() const noexcept
Definition: Optional.hpp:53
+
+
+
+ +

◆ value() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
const T& value () const
+
+inline
+
+ +

Definition at line 146 of file Optional.hpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), armnn::GetBiasDataType(), armnnUtils::GetPerAxisParams(), OptionalReferenceSwitch< std::is_reference< int32_t >::value, int32_t >::operator=(), SerializerVisitor::VisitConvolution2dLayer(), SerializerVisitor::VisitDepthwiseConvolution2dLayer(), SerializerVisitor::VisitFullyConnectedLayer(), and SerializerVisitor::VisitTransposeConvolution2dLayer().

+
147  {
148  if (!Base::has_value())
149  {
150  throw BadOptionalAccessException("Optional has no value");
151  }
152 
153  auto valuePtr = reinterpret_cast<const T*>(m_Storage);
154  return *valuePtr;
155  }
bool has_value() const noexcept
Definition: Optional.hpp:53
+
+
+
+ +

◆ value() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
T& value ()
+
+inline
+
+ +

Definition at line 157 of file Optional.hpp.

+
158  {
159  if (!Base::has_value())
160  {
161  throw BadOptionalAccessException("Optional has no value");
162  }
163 
164  auto valuePtr = reinterpret_cast<T*>(m_Storage);
165  return *valuePtr;
166  }
bool has_value() const noexcept
Definition: Optional.hpp:53
+
+
+
+
The documentation for this class was generated from the following file: +
+
+ + + + -- cgit v1.2.1