int BattleResultResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // required .message.BattleResultResponse.PlayerMatchResult result = 1; if (has_result()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->result()); } // optional .message.UpdateUserInfo selfInfo = 2; if (has_selfinfo()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->selfinfo()); } // optional .message.UpdateUserInfo tageterInfo = 3; if (has_tageterinfo()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->tageterinfo()); } } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; }
void CSJoinRoomResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 result = 1; if (has_result()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->result(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } }
::google::protobuf::uint8* CSJoinRoomResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 result = 1; if (has_result()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->result(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; }
void BattleResultResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // required .message.BattleResultResponse.PlayerMatchResult result = 1; if (has_result()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 1, this->result(), output); } // optional .message.UpdateUserInfo selfInfo = 2; if (has_selfinfo()) { ::google::protobuf::internal::WireFormatLite::WriteMessage( 2, this->selfinfo(), output); } // optional .message.UpdateUserInfo tageterInfo = 3; if (has_tageterinfo()) { ::google::protobuf::internal::WireFormatLite::WriteMessage( 3, this->tageterinfo(), output); } }
int CSJoinRoomResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 result = 1; if (has_result()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->result()); } } if (!unknown_fields().empty()) { total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( unknown_fields()); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; }
std::string o3d3xx::PCICClient::Call(const std::string& request) { std::atomic_bool has_result(false); std::string result; Call(request, [&](const std::string& content) { // Copy content, notify and leave callback result = content; std::unique_lock<std::mutex> lock(this->in_mutex_); has_result.store(true); this->in_cv_.notify_all(); }); std::unique_lock<std::mutex> lock(this->in_mutex_); while(!has_result.load()) { this->in_cv_.wait(lock); } lock.unlock(); return result; }