15 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_OPTIONAL_H_ 16 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_OPTIONAL_H_ 31 template <
typename ValueT>
60 void set(
const ValueT&
value);
80 ValueT
valueOr(
const ValueT& other)
const;
142 inline ValueT& getReference();
144 inline const ValueT& getReference()
const;
157 template <
typename ValueT>
161 template <
typename ValueT>
164 new (&m_value) ValueT(other);
167 template <
typename ValueT>
170 new (&m_value) ValueT(other.getReference());
174 template <
typename ValueT>
176 return *
reinterpret_cast<ValueT*
>(&m_value);
179 template <
typename ValueT>
181 return *
reinterpret_cast<const ValueT*
>(&m_value);
184 template <
typename ValueT>
187 getReference() = other;
190 new (&m_value) ValueT(other);
194 template <
typename ValueT>
198 getReference().~ValueT();
202 template <
typename ValueT>
207 template <
typename ValueT>
210 return getReference();
216 template <
typename ValueT>
219 return getReference();
224 template <
typename ValueT>
227 getReference().~ValueT();
231 template <
typename ValueT>
235 getReference() = rhs.
value();
238 getReference().~ValueT();
242 new (&m_value) ValueT(rhs.
value());
247 template <
typename ValueT>
249 if (this->hasValue()) {
255 template <
typename ValueT>
257 return !(*
this == rhs);
260 template <
typename ValueT>
262 if (m_hasValue && rhs.m_hasValue) {
263 return getReference() < rhs.getReference();
265 return m_hasValue < rhs.m_hasValue;
268 template <
typename ValueT>
273 template <
typename ValueT>
275 return !(rhs < *
this);
278 template <
typename ValueT>
280 return !(*
this < rhs);
287 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_OPTIONAL_H_ bool operator==(const Optional< ValueT > &rhs) const
Definition: Optional.h:248
ValueT valueOr(const ValueT &other) const
Definition: Optional.h:217
void reset()
Definition: Optional.h:195
Optional()
Definition: Optional.h:158
bool operator==(const BlockingPolicy &lhs, const BlockingPolicy &rhs)
bool operator<=(const Optional &rhs) const
Definition: Optional.h:274
bool operator!=(const Optional< ValueT > &rhs) const
Definition: Optional.h:256
bool operator!=(const BlockingPolicy &lhs, const BlockingPolicy &rhs)
~Optional()
Definition: Optional.h:225
Optional< ValueT > & operator=(const Optional< ValueT > &rhs)
Definition: Optional.h:232
bool operator>(const Optional &rhs) const
Definition: Optional.h:269
bool hasValue() const
Definition: Optional.h:203
Definition: Optional.h:32
set
Definition: gmock_class.py:44
bool operator>=(const Optional &rhs) const
Definition: Optional.h:279
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
type
Definition: upload.py:443
void acsdkError(const LogEntry &entry)
ValueT value() const
Definition: Optional.h:208
bool operator<(const Optional &rhs) const
Definition: Optional.h:261
LogEntry is used to compile the log entry text to log via Logger.
Definition: LogEntry.h:33