Lines Matching refs:T
34 template<class T, class U> struct MemPtr<U T::*> {
35 using type = T;
130 template<class T> struct Descriptor {
131 static_assert(sizeof(T) == 0, "You need to implement descriptor for your own types");
159 template<class T> const auto &MessageType()
161 static const auto message = Descriptor<T>::type();
165 template<class T, class Enable = void> struct Serializer;
176 template<class T, class V, class F, class W, class Enable = void>
180 template<class T, class V, class F, class W>
181 struct HasSerializePacked<T, V, F, W,
182 std::void_t<decltype(std::declval<T>().SerializePacked(
186 template<class T, class V, class F, class W>
187 constexpr bool HAS_SERIALIZE_PACKED_V = HasSerializePacked<T, V, F, W>::value;
189 template<class T, class V, class F, class R, class Enable = void>
193 template<class T, class V, class F, class R>
194 struct HasParsePacked<T, V, F, R,
195 std::void_t<decltype(std::declval<T>().ParsePacked(
199 template<class T, class V, class F, class R>
200 constexpr bool HAS_PARSE_PACKED_V = HasParsePacked<T, V, F, R>::value;
523 template<class T, uint32_t Tag, size_t Index, class MemPtrT, MemPtrT MemPtr, uint32_t Flags>
524 void WriteField(const T &value,
532 …template<class T, uint32_t Tag, class MemPtrT, MemPtrT MemPtr, uint32_t KeyFlags, uint32_t ValueFl…
533 void WriteField(const T &value,
541 template<class T, uint32_t Tag, class MemPtrT, MemPtrT MemPtr, uint32_t Flags>
542 …void WriteField(const T &value, const SerialDetail::FieldImpl<Tag, MemPtrT, MemPtr, Flags> &, Writ…
549 template<class T, class... Field>
550 … void WriteMessage(const T &value, const SerialDetail::MessageImpl<Field...> &message, Writer &out)
586 template<uint32_t KeyFlags, uint32_t ValueFlags, class T>
587 void WriteMap(uint32_t tag, const T &value, Writer &out)
609 template<uint32_t KeyFlags, uint32_t ValueFlags, class T>
610 bool ReadMap(WireType wireType, T &value, reader &in)
619 std::pair<typename T::key_type, typename T::mapped_type> item;
665 template<class T, uint32_t Tag, size_t Index, class MemPtrT, MemPtrT MemPtr, uint32_t Flags>
666 void ReadField(T &value, uint32_t tag, WireType wireType,
677 …template<class T, uint32_t Tag, class MemPtrT, MemPtrT MemPtr, uint32_t KeyFlags, uint32_t ValueFl…
678 void ReadField(T &value, uint32_t tag, WireType wireType,
689 template<class T, uint32_t Tag, class MemPtrT, MemPtrT MemPtr, uint32_t Flags>
690 void ReadField(T &value, uint32_t tag, WireType wireType,
700 …template<class T, class... Field> bool ReadMessage(T &value, const MessageImpl<Field...> &message,…
713 template<class T, class Enable> struct Serializer {
715 … static void Serialize(uint32_t tag, const T &value, FlagsType<>, Writer &out, bool force = false)
718 SerialDetail::WriteMessage(value, MessageType<T>(), sizeCollector);
724 SerialDetail::WriteMessage(value, MessageType<T>(), out);
727 static bool Parse(WireType wireType, T &value, FlagsType<>, reader &in)
735 return SerialDetail::ReadMessage(value, MessageType<T>(), limitedIn);
1074 template<class T> struct Serializer<T, std::enable_if_t<std::is_enum_v<T>>> {
1075 using U = std::underlying_type_t<T>;
1077 static void Serialize(uint32_t tag, T value, FlagsType<>, Writer &out, bool force = false)
1082 static void SerializePacked(T value, FlagsType<>, Writer &out)
1087 static bool Parse(WireType wire_type, T &value, FlagsType<>, reader &in)
1091 value = static_cast<T>(intermedaite_value);
1097 static bool ParsePacked(T &value, FlagsType<>, reader &in)
1101 value = static_cast<T>(intermedaite_value);
1132 template<class T> struct Serializer<std::vector<T>> {
1134 … static void Serialize(uint32_t tag, const std::vector<T> &value, FlagsType<Flags>, Writer &out)
1136 SerialDetail::WriteRepeated<Flags, T>(tag, value.begin(), value.end(), out);
1140 static bool Parse(WireType wire_type, std::vector<T> &value, FlagsType<Flags>, reader &in)
1142 return SerialDetail::ReadRepeated<Flags, T>(wire_type, std::back_inserter(value), in);
1146 template<class T> struct Serializer<std::optional<T>> {
1148 … static void Serialize(uint32_t tag, const std::optional<T> &value, FlagsType<Flags>, Writer &out)
1153 Serializer<T>::Serialize(tag, *value, FlagsType<Flags>(), out);
1157 static bool Parse(WireType wire_type, std::optional<T> &value, FlagsType<Flags>, reader &in)
1159 return Serializer<T>::Parse(wire_type, value.emplace(), FlagsType<Flags>(), in);
1163 template<class... T> struct Serializer<std::variant<T...>> {
1165 …static void SerializeOneof(uint32_t tag, const std::variant<T...> &value, FlagsType<Flags>, Writer…
1170 Serializer<std::variant_alternative_t<Index, std::variant<T...>>>::Serialize(
1175 …static bool ParseOneof(WireType wire_type, std::variant<T...> &value, FlagsType<Flags>, reader &in)
1177 return Serializer<std::variant_alternative_t<Index, std::variant<T...>>>::Parse(
1298 template<class T> std::string SerializeToString(const T &value)
1302 SerialDetail::WriteMessage(value, MessageType<T>(), stringOut);
1306 template<class T> bool ParseFromString(T &value, const std::string &in)
1309 return SerialDetail::ReadMessage(value, MessageType<T>(), stringIn);