172 std::cerr <<
"RepHandler::RunLocalCallback() error: "
177#if GOOGLE_PROTOBUF_VERSION >= 5028000
179 google::protobuf::DynamicCastMessage<Req>(&_msgReq);
181 google::protobuf::DynamicCastMessage<Rep>(&_msgRep);
182#elif GOOGLE_PROTOBUF_VERSION >= 4022000
184 google::protobuf::internal::DownCast<const Req*>(&_msgReq);
185 auto msgRep = google::protobuf::internal::DownCast<Rep*>(&_msgRep);
186#elif GOOGLE_PROTOBUF_VERSION > 2999999
187 auto msgReq = google::protobuf::down_cast<const Req*>(&_msgReq);
188 auto msgRep = google::protobuf::down_cast<Rep*>(&_msgRep);
191 google::protobuf::internal::down_cast<const Req*>(&_msgReq);
192 auto msgRep = google::protobuf::internal::down_cast<Rep*>(&_msgRep);
196 if (msgReq ==
nullptr || msgRep ==
nullptr)
198 if (msgReq ==
nullptr)
200 if (_msgReq.GetDescriptor() !=
nullptr)
202 std::cerr <<
"RepHandler::RunLocalCallback() error: "
203 <<
"Failed to cast the request of the type "
204 << _msgReq.GetDescriptor()->full_name()
205 <<
" to the specified type" <<
'\n';
209 std::cerr <<
"RepHandler::RunLocalCallback() error: "
210 <<
"Failed to cast the request of an unknown type"
211 <<
" to the specified type" <<
'\n';
214 if (msgRep ==
nullptr)
216 if (_msgRep.GetDescriptor() !=
nullptr)
218 std::cerr <<
"RepHandler::RunLocalCallback() error: "
219 <<
"Failed to cast the response of the type "
220 << _msgRep.GetDescriptor()->full_name()
221 <<
" to the specified type" <<
'\n';
225 std::cerr <<
"RepHandler::RunLocalCallback() error: "
226 <<
"Failed to cast the response of an unknown type"
227 <<
" to the specified type" <<
'\n';
234 return this->cb(*msgReq, *msgRep);