#pragma once #include "abstract_dispatcher.hpp" #include #include #include #include namespace tinyrpc { class TinypbDispatcher : public AbstractDispatcher { using Service = google::protobuf::Service; using Method = google::protobuf::MethodDescriptor; using Message = google::protobuf::Message; public: TinypbDispatcher(); ~TinypbDispatcher(); void dispatcher(TcpConnection& conn, AbstractData& data, AbstractData& respond) override; bool parseServiceFullName(const std::string& name, std::string& serviceName, std::string& methodName); private: std::unordered_map m_service_map; }; }