uint32_t memory_unit::operator[](const uint32_t& addr) { if (has_address(addr) == false) { // _mem[addr] = 0x0; return 0; } return _mem[addr]; }
void LoginResponse::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { status_ = 1; if (has_address()) { if (address_ != NULL) address_->::message::NetAddress::Clear(); } if (has_dailyrewarddata()) { if (dailyrewarddata_ != NULL) dailyrewarddata_->::message::DailyRewardSystemData::Clear(); } if (has_olduid()) { if (olduid_ != &::google::protobuf::internal::kEmptyString) { olduid_->clear(); } } version_ = 0u; if (has_gamename()) { if (gamename_ != &::google::protobuf::internal::kEmptyString) { gamename_->clear(); } } if (has_gamedownload()) { if (gamedownload_ != &::google::protobuf::internal::kEmptyString) { gamedownload_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); }
int LoginResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // required .message.LoginResponse.LoginStatus status = 1; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->status()); } // optional .message.NetAddress address = 2; if (has_address()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->address()); } // optional .message.DailyRewardSystemData dailyRewardData = 3; if (has_dailyrewarddata()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->dailyrewarddata()); } // optional string oldUid = 4; if (has_olduid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->olduid()); } // optional uint32 version = 5; if (has_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->version()); } // optional string gameName = 6; if (has_gamename()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->gamename()); } // optional string gameDownload = 7; if (has_gamedownload()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->gamedownload()); } } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = total_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); return total_size; }
void LoginResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // required .message.LoginResponse.LoginStatus status = 1; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 1, this->status(), output); } // optional .message.NetAddress address = 2; if (has_address()) { ::google::protobuf::internal::WireFormatLite::WriteMessage( 2, this->address(), output); } // optional .message.DailyRewardSystemData dailyRewardData = 3; if (has_dailyrewarddata()) { ::google::protobuf::internal::WireFormatLite::WriteMessage( 3, this->dailyrewarddata(), output); } // optional string oldUid = 4; if (has_olduid()) { ::google::protobuf::internal::WireFormatLite::WriteString( 4, this->olduid(), output); } // optional uint32 version = 5; if (has_version()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->version(), output); } // optional string gameName = 6; if (has_gamename()) { ::google::protobuf::internal::WireFormatLite::WriteString( 6, this->gamename(), output); } // optional string gameDownload = 7; if (has_gamedownload()) { ::google::protobuf::internal::WireFormatLite::WriteString( 7, this->gamedownload(), output); } }
void memory_unit::remove_address(const uint32_t& addr) { if (has_address(addr)) { map<uint32_t, uint32_t>::iterator it = _mem.find(addr); _mem.erase(it); } }