aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util/proto_file_parser.h
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-07-07 11:09:49 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-07-07 11:09:49 -0700
commit256cc7aa034f038f8e82f3e278ca61b64252693b (patch)
treec446f55c412de675313c01bcbd7e0a5af43c2925 /test/cpp/util/proto_file_parser.h
parent123a1b76d30f47527774d878f9e0e6cb30f4fb83 (diff)
Support server reflection in CLI
Diffstat (limited to 'test/cpp/util/proto_file_parser.h')
-rw-r--r--test/cpp/util/proto_file_parser.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/cpp/util/proto_file_parser.h b/test/cpp/util/proto_file_parser.h
index 46cdd66503..b442d77db9 100644
--- a/test/cpp/util/proto_file_parser.h
+++ b/test/cpp/util/proto_file_parser.h
@@ -38,8 +38,10 @@
#include <google/protobuf/compiler/importer.h>
#include <google/protobuf/dynamic_message.h>
+#include <grpc++/channel.h>
#include "src/compiler/config.h"
+#include "test/cpp/util/proto_reflection_descriptor_database.h"
namespace grpc {
namespace testing {
@@ -53,6 +55,9 @@ class ProtoFileParser {
// even just Method. It will log an error if there is ambiguity.
ProtoFileParser(const grpc::string& proto_path, const grpc::string& file_name,
const grpc::string& method);
+
+ ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
+ const grpc::string& method);
~ProtoFileParser();
grpc::string GetFullMethodName() const { return full_method_name_; }
@@ -68,12 +73,18 @@ class ProtoFileParser {
void LogError(const grpc::string& error_msg);
private:
+ void InitProtoFileParser(
+ const grpc::string& method,
+ const std::vector<const google::protobuf::ServiceDescriptor*> services);
+
bool has_error_;
grpc::string request_text_;
grpc::string full_method_name_;
google::protobuf::compiler::DiskSourceTree source_tree_;
std::unique_ptr<ErrorPrinter> error_printer_;
std::unique_ptr<google::protobuf::compiler::Importer> importer_;
+ std::unique_ptr<grpc::ProtoReflectionDescriptorDatabase> desc_db_;
+ std::unique_ptr<google::protobuf::DescriptorPool> desc_pool_;
std::unique_ptr<google::protobuf::DynamicMessageFactory> dynamic_factory_;
std::unique_ptr<grpc::protobuf::Message> request_prototype_;
std::unique_ptr<grpc::protobuf::Message> response_prototype_;