137 std::cerr <<
"RepHandler::RunLocalCallback() error: "
142#if GOOGLE_PROTOBUF_VERSION >= 5028000
144 google::protobuf::DynamicCastMessage<Req>(&_msgReq);
146 google::protobuf::DynamicCastMessage<Rep>(&_msgRep);
147#elif GOOGLE_PROTOBUF_VERSION >= 4022000
149 google::protobuf::internal::DownCast<const Req*>(&_msgReq);
150 auto msgRep = google::protobuf::internal::DownCast<Rep*>(&_msgRep);
151#elif GOOGLE_PROTOBUF_VERSION > 2999999
152 auto msgReq = google::protobuf::down_cast<const Req*>(&_msgReq);
153 auto msgRep = google::protobuf::down_cast<Rep*>(&_msgRep);
156 google::protobuf::internal::down_cast<const Req*>(&_msgReq);
157 auto msgRep = google::protobuf::internal::down_cast<Rep*>(&_msgRep);
161 if (msgReq ==
nullptr || msgRep ==
nullptr)
163 if (msgReq ==
nullptr)
165 if (_msgReq.GetDescriptor() !=
nullptr)
167 std::cerr <<
"RepHandler::RunLocalCallback() error: "
168 <<
"Failed to cast the request of the type "
169 << _msgReq.GetDescriptor()->full_name()
170 <<
" to the specified type" <<
'\n';
174 std::cerr <<
"RepHandler::RunLocalCallback() error: "
175 <<
"Failed to cast the request of an unknown type"
176 <<
" to the specified type" <<
'\n';
179 if (msgRep ==
nullptr)
181 if (_msgRep.GetDescriptor() !=
nullptr)
183 std::cerr <<
"RepHandler::RunLocalCallback() error: "
184 <<
"Failed to cast the response of the type "
185 << _msgRep.GetDescriptor()->full_name()
186 <<
" to the specified type" <<
'\n';
190 std::cerr <<
"RepHandler::RunLocalCallback() error: "
191 <<
"Failed to cast the response of an unknown type"
192 <<
" to the specified type" <<
'\n';
199 return this->cb(*msgReq, *msgRep);