Lines Matching defs:Any
91 class Any final {
93 constexpr Any() noexcept
97 Any(const Any& other) : functionTable_(other.functionTable_)
104 Any(Any&& other) noexcept : functionTable_(other.functionTable_)
115 * @tparam Type ValueType is not the same as Any itself. The decay type of ValueType must be copy constructible.
118 template <typename ValueType, enable_if_t<!std::is_same<decay_t<ValueType>, Any>::value &&
121 Any(ValueType&& value) // NOLINT: explicit
126 Any& operator=(const Any& other)
128 *this = Any(other);
132 Any& operator=(Any&& other) noexcept
135 MoveFrom(std::forward<Any>(other));
140 * Assigns contents to Any.
142 * @tparam ValueType Type ValueType is not the same as Any itself. The decay type of ValueType must be copy
147 template <typename ValueType, enable_if_t<!std::is_same<decay_t<ValueType>, Any>::value &&
150 Any& operator=(ValueType&& value)
152 *this = Any(std::forward<ValueType>(value));
168 static bool IsSameTypeWith(const Any& other) noexcept
173 return other.SameTypeWith(Any::GetTypeName<T>());
177 ~Any()
238 void Swap(Any& other) noexcept
240 Any tmp(std::move(*this));
296 bool SameTypeWith(const Any& other) const noexcept
307 friend const T* AnyCast(const Any* operand) noexcept;
309 friend T* AnyCast(Any* operand) noexcept;
311 friend bool AnyCast(const Any* operand, T& value) noexcept;
502 void MoveFrom(Any&& other) noexcept
521 if (!SameTypeWith(Any::GetTypeName<DecayedValueType>())) {
541 if (!SameTypeWith(Any::GetTypeName<DecayedValueType>())) {
558 * cast one Any pointer into ValueType pointer
566 const ValueType* AnyCast(const Any* operand) noexcept
576 * cast one Any pointer into ValueType object
585 bool AnyCast(const Any* operand, ValueType& value) noexcept
594 if (!operand->SameTypeWith(Any::GetTypeName<ValueType>())) {
608 * cast one Any pointer into ValueType pointer
616 ValueType* AnyCast(Any* operand) noexcept
626 * cast one Any object into ValueType object
633 * one object of ValueType contained in Any.
636 ValueType AnyCast(const Any& other)
651 * cast one Any object into ValueType object
658 * one object of ValueType contained in Any.
661 ValueType AnyCast(Any& other)
676 * cast one Any object into ValueType object
683 * one object of ValueType contained in Any.
686 ValueType AnyCast(Any&& other)
701 * Constructs Any object, whose content is constructed by args. The content type is T.
703 * @tparam T type of Any's content
706 * @return Any object
709 Any MakeAny(Args&&... args)
711 Any tmp;
717 * Constructs Any object, whose content is constructed by il and args. The content type is T.
719 * @tparam T type of Any's content
724 * @return Any object
727 Any MakeAny(std::initializer_list<U> il, Args&&... args)
729 Any tmp;
738 inline void swap(OHOS::Media::Plugin::Any& lhs, OHOS::Media::Plugin::Any& rhs) noexcept