Lines Matching defs:Any
128 class Any;
130 inline typename std::enable_if<std::is_enum<T>::value, bool>::type MakeAnyFromParcel(Any& value, MessageParcel& parcel);
132 inline typename std::enable_if<!std::is_enum<T>::value, bool>::type MakeAnyFromParcel(Any& value, MessageParcel& parcel)
177 class Any final {
179 constexpr Any() noexcept
183 __attribute__((no_sanitize("cfi"))) Any(const Any &other) : functionTable_(other.functionTable_)
190 __attribute__((no_sanitize("cfi"))) Any(Any &&other) noexcept : functionTable_(other.functionTable_)
201 * @tparam Type ValueType is not the same as Any itself. The decay type of ValueType must be copy constructible.
204 template <typename ValueType, enable_if_t<!std::is_same<decay_t<ValueType>, Any>::value &&
207 Any(ValueType&& value) // NOLINT: explicit
212 Any& operator=(const Any& other)
214 *this = Any(other);
218 Any& operator=(Any&& other) noexcept
221 MoveFrom(std::forward<Any>(other));
226 * Assigns contents to Any.
228 * @tparam ValueType Type ValueType is not the same as Any itself. The decay type of ValueType must be copy
233 template <typename ValueType, enable_if_t<!std::is_same<decay_t<ValueType>, Any>::value &&
236 Any& operator=(ValueType&& value)
238 *this = Any(std::forward<ValueType>(value));
254 static bool IsSameTypeWith(const Any& other) noexcept
259 return other.SameTypeWith(Any::GetTypeName<T>());
263 ~Any()
324 void Swap(Any& other) noexcept
326 Any tmp(std::move(*this));
371 return functionTable_->fromParcel(const_cast<Any *>(this), parcel);
393 bool __attribute__((no_sanitize("cfi"))) SameTypeWith(const Any &other) const noexcept
404 friend const T* AnyCast(const Any* operand) noexcept;
406 friend T* AnyCast(Any* operand) noexcept;
408 friend bool AnyCast(const Any* operand, T& value) noexcept;
424 bool (*toParcel)(const Any *operand, MessageParcel& parcel) noexcept;
425 bool (*fromParcel)(Any *operand, MessageParcel& parcel) noexcept;
433 static bool BaseTypesToParcel(const Any *operand, MessageParcel& parcel) noexcept;
435 static int BaseTypesFromParcel(Any *operand, MessageParcel& parcel) noexcept;
452 static bool ToParcel(const Any *operand, MessageParcel& parcel) noexcept
476 static bool FromParcel(Any *operand, MessageParcel& parcel) noexcept
528 static bool ToParcel(const Any *operand, MessageParcel& parcel) noexcept
552 static bool FromParcel(Any *operand, MessageParcel& parcel) noexcept
605 static bool ToParcel(const Any *operand, MessageParcel& parcel) noexcept
629 static bool FromParcel(Any *operand, MessageParcel& parcel) noexcept
710 void __attribute__((no_sanitize("cfi"))) MoveFrom(Any &&other) noexcept
729 if (!SameTypeWith(Any::GetTypeName<DecayedValueType>())) {
749 if (!SameTypeWith(Any::GetTypeName<DecayedValueType>())) {
766 * cast one Any pointer into ValueType pointer
774 const ValueType* AnyCast(const Any* operand) noexcept
784 * cast one Any pointer into ValueType object
793 bool AnyCast(const Any* operand, ValueType& value) noexcept
802 if (!operand->SameTypeWith(Any::GetTypeName<ValueType>())) {
816 * cast one Any pointer into ValueType pointer
824 ValueType* AnyCast(Any* operand) noexcept
834 * cast one Any object into ValueType object
841 * one object of ValueType contained in Any.
844 ValueType AnyCast(const Any& other)
856 * cast one Any object into ValueType object
863 * one object of ValueType contained in Any.
866 ValueType AnyCast(Any& other)
878 * cast one Any object into ValueType object
885 * one object of ValueType contained in Any.
888 ValueType AnyCast(Any&& other)
900 * Constructs Any object, whose content is constructed by args. The content type is T.
902 * @tparam T type of Any's content
905 * @return Any object
908 Any MakeAny(Args&&... args)
910 Any tmp;
916 * Constructs Any object, whose content is constructed by il and args. The content type is T.
918 * @tparam T type of Any's content
923 * @return Any object
926 Any MakeAny(std::initializer_list<U> il, Args&&... args)
928 Any tmp;
934 inline typename std::enable_if<std::is_enum<T>::value, bool>::type MakeAnyFromParcel(Any& value, MessageParcel
948 inline void swap(OHOS::Media::Any& lhs, OHOS::Media::Any& rhs) noexcept