示例#1
0
int LoginRequest::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional string wb_UUID = 1;
    if (has_wb_uuid()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->wb_uuid());
    }

    // optional uint32 channel = 2;
    if (has_channel()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->channel());
    }

    // optional uint32 version = 3;
    if (has_version()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->version());
    }

  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}
示例#2
0
 static PushChannel<MsgT, DstObjT>& create_push_channel(ChannelSource& src_list, ObjList<DstObjT>& dst_list,
                                                        const std::string& channel_name) {
     if (has_channel(channel_name)) {
         throw base::HuskyException("A Channel named " + channel_name + " already exists.");
     }
     auto& channel = create_push_channel<MsgT, DstObjT>(src_list, dst_list);
     get_channel_name_map().insert({channel_name, &channel});
     return channel;
 }
示例#3
0
void pixel_t::update_array_refs()
{
    assert( has_channel( core::g_Z_name));
    assert( has_channel( core::g_A_name));
    
    z_data_ = arrays::array_ref_t<float>( array( core::g_Z_name));
    a_data_ = arrays::array_ref_t<color::color3f_t>( array( core::g_A_name));
    
    if( has_channel( core::g_Zback_name))
        z_back_data_ = arrays::array_ref_t<float>( array( core::g_Zback_name));
    else
        z_back_data_ = arrays::array_ref_t<float>();

    if( has_channel( core::g_C_name))
        c_data_ = arrays::array_ref_t<color::color3f_t>( array( core::g_C_name));
    else
        c_data_ = arrays::array_ref_t<color::color3f_t>();
}
示例#4
0
void LoginRequest::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // optional string wb_UUID = 1;
  if (has_wb_uuid()) {
    ::google::protobuf::internal::WireFormatLite::WriteString(
      1, this->wb_uuid(), output);
  }

  // optional uint32 channel = 2;
  if (has_channel()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->channel(), output);
  }

  // optional uint32 version = 3;
  if (has_version()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->version(), output);
  }

}