Lines Matching refs:T

335 template<typename T>
337 using value_type = T;
340 static_assert(hidl_vec<T>::kOffsetOfBuffer == 0, "wrong offset"); in hidl_vec()
347 hidl_vec(const hidl_vec<T> &other) : hidl_vec() { in hidl_vec()
351 hidl_vec(hidl_vec<T> &&other) noexcept : hidl_vec() { in hidl_vec()
355 hidl_vec(const std::initializer_list<T> list) : hidl_vec() { *this = list; } in hidl_vec()
357 hidl_vec(const std::vector<T> &other) : hidl_vec() { in hidl_vec()
374 mBuffer = new T[mSize](); in hidl_vec()
379 mBuffer[idx++] = static_cast<T>(*first); in hidl_vec()
393 void setToExternal(T *data, size_t size, bool shouldOwn = false) {
405 T *data() { in data()
409 const T *data() const { in data()
413 T *releaseData() { in releaseData()
444 hidl_vec &operator=(const std::vector<T> &other) {
452 hidl_vec& operator=(const std::initializer_list<T> list) {
460 mBuffer = new T[mSize]();
471 operator std::vector<T>() const {
472 std::vector<T> v(mSize);
501 T &operator[](size_t index) {
505 const T &operator[](size_t index) const {
514 T* newBuffer = new T[size](); in resize()
537 T,
539 typename std::conditional<is_const, const T *, T *>::type /* Pointer */,
540 typename std::conditional<is_const, const T &, T &>::type /* Reference */>
578 iterator find(const T& v) { return std::find(begin(), end(), v); } in find()
579 const_iterator find(const T& v) const { return std::find(begin(), end(), v); } in find()
580 bool contains(const T& v) const { return find(v) != end(); } in contains()
583 details::hidl_pointer<T> mBuffer;
594 mBuffer = new T[size](); in copyFrom()
604 template <typename T>
605 const size_t hidl_vec<T>::kOffsetOfBuffer = offsetof(hidl_vec<T>, mBuffer);
621 template<typename T, size_t SIZE1, size_t... SIZES>
623 using type = std::array<typename std_array<T, SIZES...>::type, SIZE1>;
626 template<typename T, size_t SIZE1>
627 struct std_array<T, SIZE1> {
628 using type = std::array<T, SIZE1>;
631 template<typename T, size_t SIZE1, size_t... SIZES>
634 using std_array_type = typename std_array<T, SIZE1, SIZES...>::type;
636 explicit accessor(T *base)
640 accessor<T, SIZES...> operator[](size_t index) {
641 return accessor<T, SIZES...>(
653 T *mBase;
656 template<typename T, size_t SIZE1>
657 struct accessor<T, SIZE1> {
659 using std_array_type = typename std_array<T, SIZE1>::type;
661 explicit accessor(T *base)
665 T &operator[](size_t index) {
677 T *mBase;
680 template<typename T, size_t SIZE1, size_t... SIZES>
683 using std_array_type = typename std_array<T, SIZE1, SIZES...>::type;
685 explicit const_accessor(const T *base)
689 const_accessor<T, SIZES...> operator[](size_t index) const {
690 return const_accessor<T, SIZES...>(
703 const T *mBase;
706 template<typename T, size_t SIZE1>
707 struct const_accessor<T, SIZE1> {
709 using std_array_type = typename std_array<T, SIZE1>::type;
711 explicit const_accessor(const T *base)
715 const T &operator[](size_t index) const {
728 const T *mBase;
736 template<typename T, size_t SIZE1, size_t... SIZES>
739 using std_array_type = typename details::std_array<T, SIZE1, SIZES...>::type;
746 hidl_array(const T *source) {
754 details::accessor<T, SIZE1, SIZES...> modifier(mBuffer);
761 T *data() { return mBuffer; }
762 const T *data() const { return mBuffer; }
764 details::accessor<T, SIZES...> operator[](size_t index) {
765 return details::accessor<T, SIZES...>(
769 details::const_accessor<T, SIZES...> operator[](size_t index) const {
770 return details::const_accessor<T, SIZES...>(
799 return details::const_accessor<T, SIZE1, SIZES...>(mBuffer);
803 T mBuffer[elementCount()];
807 template<typename T, size_t SIZE1>
808 struct hidl_array<T, SIZE1> {
809 using value_type = T;
810 using std_array_type = typename details::std_array<T, SIZE1>::type;
817 hidl_array(const T *source) {
829 T *data() { return mBuffer; }
830 const T *data() const { return mBuffer; }
832 T &operator[](size_t index) {
836 const T &operator[](size_t index) const {
867 T mBuffer[SIZE1];
920 template<typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
921 inline std::string toString(T t) {
927 template<typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
928 inline std::string toHexString(T t, bool prefix = true) {
958 template<typename T, size_t SIZE1>
959 std::string toString(details::const_accessor<T, SIZE1> a) {
978 template<typename T, size_t SIZE1, size_t SIZE2, size_t... SIZES>
979 std::string toString(details::const_accessor<T, SIZE1, SIZE2, SIZES...> a) {
1010 template<typename T>
1011 std::string toString(const hidl_vec<T> &a) {
1018 template<typename T, size_t SIZE1>
1019 std::string toString(const hidl_array<T, SIZE1> &a) {
1021 + details::toString(details::const_accessor<T, SIZE1>(a.data()));
1024 template<typename T, size_t SIZE1, size_t SIZE2, size_t... SIZES>
1025 std::string toString(const hidl_array<T, SIZE1, SIZE2, SIZES...> &a) {
1027 + details::toString(details::const_accessor<T, SIZE1, SIZE2, SIZES...>(a.data()));
1032 template <typename T>
1036 template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
1037 constexpr hidl_invalid_type<T> hidl_enum_values;
1044 template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
1047 using value_type = T;
1049 constexpr auto begin() const { return std::begin(details::hidl_enum_values<T>); }
1051 constexpr auto rbegin() const { return std::rbegin(details::hidl_enum_values<T>); }
1053 constexpr auto end() const { return std::end(details::hidl_enum_values<T>); }
1055 constexpr auto rend() const { return std::rend(details::hidl_enum_values<T>); }
1059 template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
1061 static_assert(!std::is_enum<T>::value,