Lines Matching refs:T
118 template <class T>
119 void MoveFromBinaryFormat(T& data, const char*& p) { in MoveFromBinaryFormat()
120 static_assert(std::is_standard_layout<T>::value, "not standard layout"); in MoveFromBinaryFormat()
121 memcpy(&data, p, sizeof(T)); in MoveFromBinaryFormat()
122 p += sizeof(T); in MoveFromBinaryFormat()
125 template <class T>
126 void MoveFromBinaryFormat(T& data, char*& p) { in MoveFromBinaryFormat()
127 static_assert(std::is_standard_layout<T>::value, "not standard layout"); in MoveFromBinaryFormat()
128 memcpy(&data, p, sizeof(T)); in MoveFromBinaryFormat()
129 p += sizeof(T); in MoveFromBinaryFormat()
132 template <class T>
133 void MoveFromBinaryFormat(T* data_p, size_t n, const char*& p) { in MoveFromBinaryFormat()
134 static_assert(std::is_standard_layout<T>::value, "not standard layout"); in MoveFromBinaryFormat()
135 size_t size = n * sizeof(T); in MoveFromBinaryFormat()
140 template <class T>
141 void MoveToBinaryFormat(const T& data, char*& p) { in MoveToBinaryFormat()
142 static_assert(std::is_standard_layout<T>::value, "not standard layout"); in MoveToBinaryFormat()
143 memcpy(p, &data, sizeof(T)); in MoveToBinaryFormat()
144 p += sizeof(T); in MoveToBinaryFormat()
147 template <class T>
148 void MoveToBinaryFormat(const T* data_p, size_t n, char*& p) { in MoveToBinaryFormat()
149 static_assert(std::is_standard_layout<T>::value, "not standard layout"); in MoveToBinaryFormat()
150 size_t size = n * sizeof(T); in MoveToBinaryFormat()
179 template <class T>
180 void Read(T& data) { in Read()
181 static_assert(std::is_standard_layout<T>::value, "not standard layout"); in Read()
185 if (UNLIKELY(LeftSize() < sizeof(T))) { in Read()
188 memcpy(&data, head, sizeof(T)); in Read()
189 head += sizeof(T); in Read()
193 template <class T>
194 void Read(T* data_p, size_t n) { in Read()
195 static_assert(std::is_standard_layout<T>::value, "not standard layout"); in Read()
200 if (UNLIKELY(__builtin_mul_overflow(n, sizeof(T), &size) || LeftSize() < size)) { in Read()
263 template <typename T>
264 std::optional<std::set<T>> ParseUintVector(const std::string& s) { in ParseUintVector()
265 std::set<T> result; in ParseUintVector()
266 T value; in ParseUintVector()
268 if (!android::base::ParseUint(p.c_str(), &value, std::numeric_limits<T>::max())) { in ParseUintVector()
278 template <typename T>
279 static inline void HashCombine(size_t& seed, const T& val) { in HashCombine()
280 seed ^= std::hash<T>()(val) + 0x9e3779b9 + (seed << 6) + (seed >> 2); in HashCombine()