text
stringlengths
5
1.04M
#include <CNationSettingFactoryGBDetail.hpp> #include <common/ATFCore.hpp> START_ATF_NAMESPACE namespace Detail { Info::CNationSettingFactoryGBctor_CNationSettingFactoryGB2_ptr CNationSettingFactoryGBctor_CNationSettingFactoryGB2_next(nullptr); Info::CNationSettingFactoryGBctor_CNationSettingFactoryGB2_clbk CNationSettingFactoryGBctor_CNationSettingFactoryGB2_user(nullptr); Info::CNationSettingFactoryGBCreate4_ptr CNationSettingFactoryGBCreate4_next(nullptr); Info::CNationSettingFactoryGBCreate4_clbk CNationSettingFactoryGBCreate4_user(nullptr); void CNationSettingFactoryGBctor_CNationSettingFactoryGB2_wrapper(struct CNationSettingFactoryGB* _this) { CNationSettingFactoryGBctor_CNationSettingFactoryGB2_user(_this, CNationSettingFactoryGBctor_CNationSettingFactoryGB2_next); }; struct CNationSettingData* CNationSettingFactoryGBCreate4_wrapper(struct CNationSettingFactoryGB* _this, int iNationCode, char* szNationCodeStr, bool bServiceMode) { return CNationSettingFactoryGBCreate4_user(_this, iNationCode, szNationCodeStr, bServiceMode, CNationSettingFactoryGBCreate4_next); }; ::std::array<hook_record, 2> CNationSettingFactoryGB_functions = { _hook_record { (LPVOID)0x140219520L, (LPVOID *)&CNationSettingFactoryGBctor_CNationSettingFactoryGB2_user, (LPVOID *)&CNationSettingFactoryGBctor_CNationSettingFactoryGB2_next, (LPVOID)cast_pointer_function(CNationSettingFactoryGBctor_CNationSettingFactoryGB2_wrapper), (LPVOID)cast_pointer_function((void(CNationSettingFactoryGB::*)())&CNationSettingFactoryGB::ctor_CNationSettingFactoryGB) }, _hook_record { (LPVOID)0x14022bc60L, (LPVOID *)&CNationSettingFactoryGBCreate4_user, (LPVOID *)&CNationSettingFactoryGBCreate4_next, (LPVOID)cast_pointer_function(CNationSettingFactoryGBCreate4_wrapper), (LPVOID)cast_pointer_function((struct CNationSettingData*(CNationSettingFactoryGB::*)(int, char*, bool))&CNationSettingFactoryGB::Create) }, }; }; // end namespace Detail END_ATF_NAMESPACE
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file contains unit tests for ServiceResolverThunk. #include <stddef.h> #include <memory> #include "base/bit_cast.h" #include "base/macros.h" #include "base/win/windows_version.h" #include "sandbox/win/src/resolver.h" #include "sandbox/win/src/sandbox_utils.h" #include "sandbox/win/src/service_resolver.h" #include "testing/gtest/include/gtest/gtest.h" namespace { // This is the concrete resolver used to perform service-call type functions // inside ntdll.dll. template<typename T> class ResolverThunkTest : public T { public: // The service resolver needs a child process to write to. explicit ResolverThunkTest(bool relaxed) : T(::GetCurrentProcess(), relaxed) {} // Sets the interception target to the desired address. void set_target(void* target) { fake_target_ = target; } protected: // Overrides Resolver::Init virtual NTSTATUS Init(const void* target_module, const void* interceptor_module, const char* target_name, const char* interceptor_name, const void* interceptor_entry_point, void* thunk_storage, size_t storage_bytes) { NTSTATUS ret = STATUS_SUCCESS; ret = T::Init(target_module, interceptor_module, target_name, interceptor_name, interceptor_entry_point, thunk_storage, storage_bytes); EXPECT_EQ(STATUS_SUCCESS, ret); this->target_ = fake_target_; return ret; }; private: // Holds the address of the fake target. void* fake_target_; DISALLOW_COPY_AND_ASSIGN(ResolverThunkTest); }; typedef ResolverThunkTest<sandbox::ServiceResolverThunk> WinXpResolverTest; #if !defined(_WIN64) typedef ResolverThunkTest<sandbox::Win8ResolverThunk> Win8ResolverTest; typedef ResolverThunkTest<sandbox::Wow64ResolverThunk> Wow64ResolverTest; typedef ResolverThunkTest<sandbox::Wow64W8ResolverThunk> Wow64W8ResolverTest; typedef ResolverThunkTest<sandbox::Wow64W10ResolverThunk> Wow64W10ResolverTest; #endif const BYTE kJump32 = 0xE9; void CheckJump(void* source, void* target) { #pragma pack(push) #pragma pack(1) struct Code { BYTE jump; ULONG delta; }; #pragma pack(pop) #if defined(_WIN64) FAIL() << "Running 32-bit codepath"; #else Code* patched = reinterpret_cast<Code*>(source); EXPECT_EQ(kJump32, patched->jump); ULONG source_addr = bit_cast<ULONG>(source); ULONG target_addr = bit_cast<ULONG>(target); EXPECT_EQ(target_addr + 19 - source_addr, patched->delta); #endif } NTSTATUS PatchNtdllWithResolver(const char* function, bool relaxed, sandbox::ServiceResolverThunk* resolver) { HMODULE ntdll_base = ::GetModuleHandle(L"ntdll.dll"); EXPECT_TRUE(NULL != ntdll_base); void* target = ::GetProcAddress(ntdll_base, function); EXPECT_TRUE(NULL != target); if (NULL == target) return STATUS_UNSUCCESSFUL; BYTE service[50]; memcpy(service, target, sizeof(service)); static_cast<WinXpResolverTest*>(resolver)->set_target(service); // Any pointer will do as an interception_entry_point void* function_entry = resolver; size_t thunk_size = resolver->GetThunkSize(); std::unique_ptr<char[]> thunk(new char[thunk_size]); size_t used; resolver->AllowLocalPatches(); NTSTATUS ret = resolver->Setup(ntdll_base, NULL, function, NULL, function_entry, thunk.get(), thunk_size, &used); if (NT_SUCCESS(ret)) { EXPECT_EQ(thunk_size, used); EXPECT_NE(0, memcmp(service, target, sizeof(service))); EXPECT_NE(kJump32, service[0]); if (relaxed) { // It's already patched, let's patch again, and simulate a direct patch. service[0] = kJump32; ret = resolver->Setup(ntdll_base, NULL, function, NULL, function_entry, thunk.get(), thunk_size, &used); CheckJump(service, thunk.get()); } } return ret; } sandbox::ServiceResolverThunk* GetTestResolver(bool relaxed) { #if defined(_WIN64) return new WinXpResolverTest(relaxed); #else base::win::OSInfo* os_info = base::win::OSInfo::GetInstance(); if (os_info->wow64_status() == base::win::OSInfo::WOW64_ENABLED) { if (os_info->version() >= base::win::VERSION_WIN10) return new Wow64W10ResolverTest(relaxed); if (os_info->version() >= base::win::VERSION_WIN8) return new Wow64W8ResolverTest(relaxed); return new Wow64ResolverTest(relaxed); } if (os_info->version() >= base::win::VERSION_WIN8) return new Win8ResolverTest(relaxed); return new WinXpResolverTest(relaxed); #endif } NTSTATUS PatchNtdll(const char* function, bool relaxed) { sandbox::ServiceResolverThunk* resolver = GetTestResolver(relaxed); NTSTATUS ret = PatchNtdllWithResolver(function, relaxed, resolver); delete resolver; return ret; } TEST(ServiceResolverTest, PatchesServices) { NTSTATUS ret = PatchNtdll("NtClose", false); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtClose, last error: " << ::GetLastError(); ret = PatchNtdll("NtCreateFile", false); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtCreateFile, last error: " << ::GetLastError(); ret = PatchNtdll("NtCreateMutant", false); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtCreateMutant, last error: " << ::GetLastError(); ret = PatchNtdll("NtMapViewOfSection", false); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtMapViewOfSection, last error: " << ::GetLastError(); } TEST(ServiceResolverTest, FailsIfNotService) { #if !defined(_WIN64) EXPECT_NE(STATUS_SUCCESS, PatchNtdll("RtlUlongByteSwap", false)); #endif EXPECT_NE(STATUS_SUCCESS, PatchNtdll("LdrLoadDll", false)); } TEST(ServiceResolverTest, PatchesPatchedServices) { // We don't support "relaxed mode" for Win64 apps. #if !defined(_WIN64) NTSTATUS ret = PatchNtdll("NtClose", true); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtClose, last error: " << ::GetLastError(); ret = PatchNtdll("NtCreateFile", true); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtCreateFile, last error: " << ::GetLastError(); ret = PatchNtdll("NtCreateMutant", true); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtCreateMutant, last error: " << ::GetLastError(); ret = PatchNtdll("NtMapViewOfSection", true); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtMapViewOfSection, last error: " << ::GetLastError(); #endif } TEST(ServiceResolverTest, MultiplePatchedServices) { // We don't support "relaxed mode" for Win64 apps. #if !defined(_WIN64) sandbox::ServiceResolverThunk* resolver = GetTestResolver(true); NTSTATUS ret = PatchNtdllWithResolver("NtClose", true, resolver); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtClose, last error: " << ::GetLastError(); ret = PatchNtdllWithResolver("NtCreateFile", true, resolver); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtCreateFile, last error: " << ::GetLastError(); ret = PatchNtdllWithResolver("NtCreateMutant", true, resolver); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtCreateMutant, last error: " << ::GetLastError(); ret = PatchNtdllWithResolver("NtMapViewOfSection", true, resolver); EXPECT_EQ(STATUS_SUCCESS, ret) << "NtMapViewOfSection, last error: " << ::GetLastError(); delete resolver; #endif } TEST(ServiceResolverTest, LocalPatchesAllowed) { sandbox::ServiceResolverThunk* resolver = GetTestResolver(true); HMODULE ntdll_base = ::GetModuleHandle(L"ntdll.dll"); ASSERT_TRUE(NULL != ntdll_base); const char kFunctionName[] = "NtClose"; void* target = ::GetProcAddress(ntdll_base, kFunctionName); ASSERT_TRUE(NULL != target); BYTE service[50]; memcpy(service, target, sizeof(service)); static_cast<WinXpResolverTest*>(resolver)->set_target(service); // Any pointer will do as an interception_entry_point void* function_entry = resolver; size_t thunk_size = resolver->GetThunkSize(); std::unique_ptr<char[]> thunk(new char[thunk_size]); size_t used; NTSTATUS ret = STATUS_UNSUCCESSFUL; // First try patching without having allowed local patches. ret = resolver->Setup(ntdll_base, NULL, kFunctionName, NULL, function_entry, thunk.get(), thunk_size, &used); EXPECT_FALSE(NT_SUCCESS(ret)); // Now allow local patches and check that things work. resolver->AllowLocalPatches(); ret = resolver->Setup(ntdll_base, NULL, kFunctionName, NULL, function_entry, thunk.get(), thunk_size, &used); EXPECT_EQ(STATUS_SUCCESS, ret); } } // namespace
//----------------------------------------------------------------------------- // Copyright 2012-2016 Masanori Morise. All Rights Reserved. // Author: mmorise [at] yamanashi.ac.jp (Masanori Morise) // // Voice synthesis based on f0, spectrogram and aperiodicity. // forward_real_fft, inverse_real_fft and minimum_phase are used to speed up. //----------------------------------------------------------------------------- #include "world/synthesis.h" #include <math.h> #include <stdio.h> #include "world/common.h" #include "world/constantnumbers.h" #include "world/matlabfunctions.h" namespace { static void GetNoiseSpectrum(int noise_size, int fft_size, const ForwardRealFFT *forward_real_fft) { double average = 0.0; for (int i = 0; i < noise_size; ++i) { forward_real_fft->waveform[i] = randn(); average += forward_real_fft->waveform[i]; } average /= static_cast<double>(noise_size); for (int i = 0; i < noise_size; ++i) forward_real_fft->waveform[i] -= average; for (int i = noise_size; i < fft_size; ++i) forward_real_fft->waveform[i] = 0.0; fft_execute(forward_real_fft->forward_fft); } //----------------------------------------------------------------------------- // GetAperiodicResponse() calculates an aperiodic response. //----------------------------------------------------------------------------- static void GetAperiodicResponse(int noise_size, int fft_size, const double *spectrum, const double *aperiodic_ratio, double current_vuv, const ForwardRealFFT *forward_real_fft, const InverseRealFFT *inverse_real_fft, const MinimumPhaseAnalysis *minimum_phase, double *aperiodic_response) { GetNoiseSpectrum(noise_size, fft_size, forward_real_fft); if (current_vuv != 0.0) { for (int i = 0; i <= minimum_phase->fft_size / 2; ++i) minimum_phase->log_spectrum[i] = log(spectrum[i] * aperiodic_ratio[i]) / 2.0; } else { for (int i = 0; i <= minimum_phase->fft_size / 2; ++i) minimum_phase->log_spectrum[i] = log(spectrum[i]) / 2.0; } GetMinimumPhaseSpectrum(minimum_phase); for (int i = 0; i <= fft_size / 2; ++i) { inverse_real_fft->spectrum[i][0] = minimum_phase->minimum_phase_spectrum[i][0]; inverse_real_fft->spectrum[i][1] = minimum_phase->minimum_phase_spectrum[i][1]; inverse_real_fft->spectrum[i][0] = minimum_phase->minimum_phase_spectrum[i][0] * forward_real_fft->spectrum[i][0] - minimum_phase->minimum_phase_spectrum[i][1] * forward_real_fft->spectrum[i][1]; inverse_real_fft->spectrum[i][1] = minimum_phase->minimum_phase_spectrum[i][0] * forward_real_fft->spectrum[i][1] + minimum_phase->minimum_phase_spectrum[i][1] * forward_real_fft->spectrum[i][0]; } fft_execute(inverse_real_fft->inverse_fft); fftshift(inverse_real_fft->waveform, fft_size, aperiodic_response); } //----------------------------------------------------------------------------- // GetPeriodicResponse() calculates an aperiodic response. //----------------------------------------------------------------------------- static void GetPeriodicResponse(int fft_size, const double *spectrum, const double *aperiodic_ratio, double current_vuv, const InverseRealFFT *inverse_real_fft, const MinimumPhaseAnalysis *minimum_phase, double *periodic_response) { if (current_vuv <= 0.5) { for (int i = 0; i < fft_size; ++i) periodic_response[i] = 0.0; return; } for (int i = 0; i <= minimum_phase->fft_size / 2; ++i) minimum_phase->log_spectrum[i] = log(spectrum[i] * (1.0 - aperiodic_ratio[i]) + world::kMySafeGuardMinimum) / 2.0; GetMinimumPhaseSpectrum(minimum_phase); for (int i = 0; i <= fft_size / 2; ++i) { inverse_real_fft->spectrum[i][0] = minimum_phase->minimum_phase_spectrum[i][0]; inverse_real_fft->spectrum[i][1] = minimum_phase->minimum_phase_spectrum[i][1]; } fft_execute(inverse_real_fft->inverse_fft); fftshift(inverse_real_fft->waveform, fft_size, periodic_response); } static void GetSpectralEnvelope(double current_time, double frame_period, int f0_length, double **const spectrogram, int fft_size, double *spectral_envelope) { int current_frame_floor = MyMinInt(f0_length - 1, static_cast<int>(floor(current_time / frame_period))); int current_frame_ceil = MyMinInt(f0_length - 1, static_cast<int>(ceil(current_time / frame_period))); double interpolation = current_time / frame_period - current_frame_floor; if (current_frame_floor == current_frame_ceil) { for (int i = 0; i <= fft_size / 2; ++i) spectral_envelope[i] = spectrogram[current_frame_floor][i]; } else { for (int i = 0; i <= fft_size / 2; ++i) spectral_envelope[i] = (1.0 - interpolation) * spectrogram[current_frame_floor][i] + interpolation * spectrogram[current_frame_ceil][i]; } } static void GetAperiodicRatio(double current_time, double frame_period, int f0_length, double **const aperiodicity, int fft_size, double *aperiodic_spectrum) { int current_frame_floor = MyMinInt(f0_length - 1, static_cast<int>(floor(current_time / frame_period))); int current_frame_ceil = MyMinInt(f0_length - 1, static_cast<int>(ceil(current_time / frame_period))); double interpolation = current_time / frame_period - current_frame_floor; if (current_frame_floor == current_frame_ceil) { for (int i = 0; i <= fft_size / 2; ++i) aperiodic_spectrum[i] = pow(aperiodicity[current_frame_floor][i], 2.0); } else { for (int i = 0; i <= fft_size / 2; ++i) aperiodic_spectrum[i] = pow((1.0 - interpolation) * aperiodicity[current_frame_floor][i] + interpolation * aperiodicity[current_frame_ceil][i], 2.0); } } //----------------------------------------------------------------------------- // GetOneFrameSegment() calculates a periodic and aperiodic response at a time. //----------------------------------------------------------------------------- static void GetOneFrameSegment(double current_vuv, int noise_size, double **const spectrogram, int fft_size, double **const aperiodicity, int f0_length, double frame_period, double current_time, int fs, const ForwardRealFFT *forward_real_fft, const InverseRealFFT *inverse_real_fft, const MinimumPhaseAnalysis *minimum_phase, double *response) { double *aperiodic_response = new double[fft_size]; double *periodic_response = new double[fft_size]; double *spectral_envelope = new double[fft_size]; double *aperiodic_ratio = new double[fft_size]; GetSpectralEnvelope(current_time, frame_period, f0_length, spectrogram, fft_size, spectral_envelope); GetAperiodicRatio(current_time, frame_period, f0_length, aperiodicity, fft_size, aperiodic_ratio); // Synthesis of the periodic response GetPeriodicResponse(fft_size, spectral_envelope, aperiodic_ratio, current_vuv, inverse_real_fft, minimum_phase, periodic_response); // Synthesis of the aperiodic response GetAperiodicResponse(noise_size, fft_size, spectral_envelope, aperiodic_ratio, current_vuv, forward_real_fft, inverse_real_fft, minimum_phase, aperiodic_response); double sqrt_noise_size = sqrt(static_cast<double>(noise_size)); for (int i = 0; i < fft_size; ++i) response[i] = (periodic_response[i] * sqrt_noise_size + aperiodic_response[i]) / fft_size; delete[] spectral_envelope; delete[] aperiodic_ratio; delete[] periodic_response; delete[] aperiodic_response; } static void GetTemporalParametersForTimeBase(const double *f0, int f0_length, int fs, int y_length, double frame_period, double *time_axis, double *coarse_time_axis, double *coarse_f0, double *coarse_vuv) { for (int i = 0; i < y_length; ++i) time_axis[i] = i / static_cast<double>(fs); for (int i = 0; i < f0_length; ++i) coarse_time_axis[i] = i * frame_period; for (int i = 0; i < f0_length; ++i) coarse_f0[i] = f0[i]; coarse_f0[f0_length] = coarse_f0[f0_length - 1] * 2 - coarse_f0[f0_length - 2]; for (int i = 0; i < f0_length; ++i) coarse_vuv[i] = f0[i] == 0.0 ? 0.0 : 1.0; coarse_vuv[f0_length] = coarse_vuv[f0_length - 1] * 2 - coarse_vuv[f0_length - 2]; } static int GetPulseLocationsForTimeBase(const double *interpolated_f0, const double *time_axis, int y_length, int fs, double *pulse_locations, int *pulse_locations_index) { double *total_phase = new double[y_length]; total_phase[0] = 2.0 * world::kPi * interpolated_f0[0] / fs; for (int i = 1; i < y_length; ++i) total_phase[i] = total_phase[i - 1] + 2.0 * world::kPi * interpolated_f0[i] / fs; double *wrap_phase = new double[y_length]; for (int i = 0; i < y_length; ++i) wrap_phase[i] = fmod(total_phase[i], 2.0 * world::kPi); double *wrap_phase_abs = new double[y_length]; for (int i = 0; i < y_length - 1; ++i) wrap_phase_abs[i] = fabs(wrap_phase[i + 1] - wrap_phase[i]); int number_of_pulses = 0; for (int i = 0; i < y_length - 1; ++i) { if (wrap_phase_abs[i] > world::kPi) { pulse_locations[number_of_pulses] = time_axis[i]; pulse_locations_index[number_of_pulses] = static_cast<int> (matlab_round(pulse_locations[number_of_pulses] * fs)); ++number_of_pulses; } } delete[] wrap_phase_abs; delete[] wrap_phase; delete[] total_phase; return number_of_pulses; } static int GetTimeBase(const double *f0, int f0_length, int fs, double frame_period, int y_length, double *pulse_locations, int *pulse_locations_index, double *interpolated_vuv) { double *time_axis = new double[y_length]; double *coarse_time_axis = new double[f0_length + 1]; double *coarse_f0 = new double[f0_length + 1]; double *coarse_vuv = new double[f0_length + 1]; GetTemporalParametersForTimeBase(f0, f0_length, fs, y_length, frame_period, time_axis, coarse_time_axis, coarse_f0, coarse_vuv); double *interpolated_f0 = new double[y_length]; interp1(coarse_time_axis, coarse_f0, f0_length + 1, time_axis, y_length, interpolated_f0); interp1(coarse_time_axis, coarse_vuv, f0_length + 1, time_axis, y_length, interpolated_vuv); for (int i = 0; i < y_length; ++i) interpolated_vuv[i] = interpolated_vuv[i] > 0.5 ? 1.0 : 0.0; for (int i = 0; i < y_length; ++i) interpolated_f0[i] = interpolated_vuv[i] == 0.0 ? world::kDefaultF0 : interpolated_f0[i]; int number_of_pulses = GetPulseLocationsForTimeBase(interpolated_f0, time_axis, y_length, fs, pulse_locations, pulse_locations_index); delete[] coarse_vuv; delete[] coarse_f0; delete[] coarse_time_axis; delete[] time_axis; delete[] interpolated_f0; return number_of_pulses; } } // namespace void Synthesis(const double *f0, int f0_length, double **const spectrogram, double **const aperiodicity, int fft_size, double frame_period, int fs, int y_length, double *y) { double *impulse_response = new double[fft_size]; for (int i = 0; i < y_length; ++i) y[i] = 0.0; MinimumPhaseAnalysis minimum_phase = {0}; InitializeMinimumPhaseAnalysis(fft_size, &minimum_phase); InverseRealFFT inverse_real_fft = {0}; InitializeInverseRealFFT(fft_size, &inverse_real_fft); ForwardRealFFT forward_real_fft = {0}; InitializeForwardRealFFT(fft_size, &forward_real_fft); double *pulse_locations = new double[y_length]; int *pulse_locations_index = new int[y_length]; double *interpolated_vuv = new double[y_length]; int number_of_pulses = GetTimeBase(f0, f0_length, fs, frame_period / 1000.0, y_length, pulse_locations, pulse_locations_index, interpolated_vuv); frame_period /= 1000.0; int noise_size; // printf("%d\n", number_of_pulses); for (int i = 0; i < number_of_pulses; ++i) { noise_size = pulse_locations_index[MyMinInt(number_of_pulses - 1, i + 1)] - pulse_locations_index[i]; // printf("%d %d\n", i, number_of_pulses); GetOneFrameSegment(interpolated_vuv[pulse_locations_index[i]], noise_size, spectrogram, fft_size, aperiodicity, f0_length, frame_period, pulse_locations[i], fs, &forward_real_fft, &inverse_real_fft, &minimum_phase, impulse_response); int index = 0; for (int j = 0; j < fft_size; ++j) { index = MyMinInt(y_length - 1, MyMaxInt(0, j + pulse_locations_index[i] - fft_size / 2 + 1)); y[index] += impulse_response[j]; } } delete[] pulse_locations; delete[] pulse_locations_index; delete[] interpolated_vuv; DestroyMinimumPhaseAnalysis(&minimum_phase); DestroyInverseRealFFT(&inverse_real_fft); DestroyForwardRealFFT(&forward_real_fft); delete[] impulse_response; }
///////////////////////////////////////////////////////////////////////////////// // // SourceFile: ColorEdit.cpp // // Marlin Component: Internet server/client // // Copyright (c) 2014-2021 ir. W.E. Huisman // All rights reserved // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files(the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and / or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions : // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #include "stdafx.h" #include "ColorEdit.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // ColorEdit ColorEdit::ColorEdit() :m_colorBackground(RGB(152,188,231)) ,m_bkBrush(m_colorBackground) ,m_bkEmptyBrush(m_colorBackground) { m_pFont = new CFont; m_fontSize = 110; // 11 punts font m_colorText = RGB(0,0,0); // Black m_colorTextEmpty = RGB(0x7F,0x7F,0x7F); // gray m_colorPasswordEye = RGB(0x7f,0x7f,0x7F); // gray m_italic = false; m_bold = false; m_focus = false; m_over = false; m_underLine = false; m_fontName = EDIT_DEFAULT_FONT; m_language = ENGLISH; m_empty = true; m_isPassword = false; m_pixelShift = false; m_colorBorderInn = RGB( 81, 81,233); m_colorBorderOut = RGB( 81, 81,233); m_colorBorderDisabledInn = RGB(255,255,255); m_colorBorderDisabledOut = RGB(133,133,133); m_colorBorderFocusInn = RGB(255, 0, 0); // hover and focus m_colorBorderFocusOut = RGB(255, 0, 0); m_colorBorderNonFocusInn = RGB( 0,255, 0); // Hover over - no focus m_colorBorderNonFocusOut = RGB( 0,255, 0); m_colorBackgroundEmpty = RGB(152,188,231); } ColorEdit::~ColorEdit() { if(m_pFont) { delete m_pFont; m_pFont = NULL; } } BEGIN_MESSAGE_MAP(ColorEdit, CEdit) ON_WM_PAINT() ON_WM_MOUSEMOVE() ON_WM_LBUTTONUP() ON_WM_LBUTTONDOWN() ON_MESSAGE(WM_MOUSEHOVER, OnMouseHover) ON_MESSAGE(WM_MOUSELEAVE, OnMouseLeave) ON_CONTROL_REFLECT_EX(EN_KILLFOCUS, OnKillfocus) ON_CONTROL_REFLECT (EN_SETFOCUS, OnSetfocus) ON_WM_CTLCOLOR_REFLECT() ON_WM_CHAR() END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // ColorEdit message handlers void ColorEdit::SetTextColor(COLORREF p_colorText) { m_colorText = p_colorText; } void ColorEdit::SetTextColorEmpty(COLORREF p_colorText) { m_colorTextEmpty = p_colorText; } void ColorEdit::SetFontSize(int p_size) { m_fontSize = p_size; ResetFont(); } void ColorEdit::SetFontStyle(bool p_bold ,bool p_italic ,bool p_underLine) { m_bold = p_bold; m_italic = p_italic; m_underLine = p_underLine; ResetFont(); } void ColorEdit::SetBkColor(COLORREF p_colorBackground) { m_colorBackground = p_colorBackground; if( m_bkBrush.m_hObject ) { m_bkBrush.DeleteObject(); } m_bkBrush.CreateSolidBrush(m_colorBackground); } void ColorEdit::SetBkColorEmpty(COLORREF p_colorEmptyBackground) { m_colorBackgroundEmpty = p_colorEmptyBackground; if(m_bkEmptyBrush.m_hObject) { m_bkEmptyBrush.DeleteObject(); } m_bkEmptyBrush.CreateSolidBrush(m_colorBackgroundEmpty); } void ColorEdit::SetPasswordEyeColor(COLORREF p_colorPasswordEye) { m_colorPasswordEye = p_colorPasswordEye; DrawPasswordEye(); } void ColorEdit::SetFontName(CString p_fontName,BYTE p_language /* = ENGLISH */) { m_fontName = p_fontName; m_language = p_language; ResetFont(); } void ColorEdit::SetBorderColor(COLORREF p_inner,COLORREF p_outer) { m_colorBorderInn = p_inner; m_colorBorderOut = p_outer; DrawEditFrame(); } void ColorEdit::SetBorderColorDisabled(COLORREF p_inner,COLORREF p_outer) { m_colorBorderDisabledInn = p_inner; m_colorBorderDisabledOut = p_outer; DrawEditFrame(); } void ColorEdit::SetBorderColorFocus(COLORREF p_inner,COLORREF p_outer) { m_colorBorderFocusInn = p_inner; m_colorBorderFocusOut = p_outer; DrawEditFrame(); } void ColorEdit::SetBorderColorNonFocus(COLORREF p_inner,COLORREF p_outer) { m_colorBorderNonFocusInn = p_inner; m_colorBorderNonFocusOut = p_outer; DrawEditFrame(); } void ColorEdit::SetDoPixelShift(bool p_shift) { m_pixelShift = p_shift; } void ColorEdit::SetEmpty(bool p_empty, CString p_text) { if(p_empty && p_text.IsEmpty()) { p_text = EDIT_EMPTYFIELD; } m_empty = p_empty; m_emptyText = p_text; SetWindowText(p_text); } void ColorEdit::DrawEditFrame() { CRect rect; CDC* dc=this->GetDC(); this->GetClientRect(&rect); if(m_pixelShift) { // Do the pixel shift. rect.top -= EDIT_PIXEL_SHIFT; // Hierdoor valt er een gat tussen de bovenkant van de edit box en de tekst. // Deze wordt opgevuld met de huidige achtergrondkleur COLORREF back = m_empty ? m_colorBackgroundEmpty : m_colorBackground; CRect clearme(rect); clearme.InflateRect(-1,-1); clearme.bottom = clearme.top + EDIT_PIXEL_SHIFT; dc->FillSolidRect(clearme,back); } else { // Inner border is drawn outside the client area rect.InflateRect(1,1); } if(!this->IsWindowEnabled()) { dc->Draw3dRect(rect,m_colorBorderDisabledInn,m_colorBorderDisabledInn); rect.InflateRect(1,1); dc->Draw3dRect(rect,m_colorBorderDisabledOut,m_colorBorderDisabledOut); ReleaseDC(dc); return; } if(m_over) { if(m_focus) { dc->Draw3dRect(rect,m_colorBorderFocusInn,m_colorBorderFocusInn); rect.InflateRect(1,1); dc->Draw3dRect(rect,m_colorBorderFocusOut,m_colorBorderFocusOut); } else { dc->Draw3dRect( rect,m_colorBorderNonFocusInn,m_colorBorderNonFocusInn); rect.InflateRect(1,1); dc->Draw3dRect( rect,m_colorBorderNonFocusOut,m_colorBorderNonFocusOut); } } else // !m_over { dc->Draw3dRect(rect,m_colorBorderInn,m_colorBorderInn); rect.InflateRect(1,1); dc->Draw3dRect(rect,m_colorBorderOut,m_colorBorderOut); } ReleaseDC(dc); DrawPasswordEye(); } void ColorEdit::DrawPasswordEye() { // Only draw a password eye if we are a password field if(!m_isPassword) { return; } // Getting the rectangle of the input field CRect rect; CDC* dc = this->GetDC(); this->GetClientRect(&rect); // Bounding rectangle of the eye int top = rect.Height() / 8; int left = rect.right - rect.Height() + top; int bottom = rect.Height() - top; int right = rect.right - top; // Start/end of the eyebrow int startx = right; int starty = (bottom - top) / 2; int endx = left; int endy = starty; // Take a colored pen CPen pen; pen.CreatePen(PS_SOLID,EDIT_EYE_WEIGHT,m_colorPasswordEye); CPen* oldpen = dc->SelectObject(&pen); // Draw the eyebrow dc->Arc(left,top,right,bottom,startx,starty,endx,endy); // Size of the eye circle int inner = WS(EDIT_INNER_EYE); left += inner; right -= inner; top += inner; bottom -= inner; // Draw Circle dc->Ellipse(left,top,right,bottom); // Done, restore pen and DC dc->SelectObject(oldpen); ReleaseDC(dc); } void ColorEdit::ResetFont() { LOGFONT lgFont; lgFont.lfCharSet = m_language; lgFont.lfClipPrecision = 0; lgFont.lfEscapement = 0; strcpy_s(lgFont.lfFaceName,32,m_fontName); lgFont.lfHeight = m_fontSize; lgFont.lfItalic = m_italic; lgFont.lfOrientation = 0; lgFont.lfOutPrecision = 0; lgFont.lfPitchAndFamily = 2; lgFont.lfQuality = 0; lgFont.lfStrikeOut = 0; lgFont.lfUnderline = m_underLine; lgFont.lfWidth = 0; if(m_bold ) { lgFont.lfWeight = FW_BOLD; } else { lgFont.lfWeight = FW_MEDIUM; } if(m_pFont->m_hObject) { m_pFont->DeleteObject(); } m_pFont->CreatePointFontIndirect(&lgFont); SetFont(m_pFont); } void ColorEdit::OnMouseMove(UINT nFlags, CPoint point) { TRACKMOUSEEVENT mouseEvent; mouseEvent.cbSize = sizeof(TRACKMOUSEEVENT); mouseEvent.dwFlags = TME_HOVER | TME_LEAVE; mouseEvent.dwHoverTime = 1; mouseEvent.hwndTrack = m_hWnd; _TrackMouseEvent(&mouseEvent); CEdit::OnMouseMove(nFlags, point); } BOOL ColorEdit::OnKillfocus() { m_focus = true; DrawEditFrame(); // Sta toe dat Dialog ook KILLFOCUS afhandelt. return FALSE; } void ColorEdit::OnSetfocus() { m_focus = true; DrawEditFrame(); if(m_empty) { SetSel(0,0,TRUE); } } LRESULT ColorEdit::OnMouseHover(WPARAM wParam,LPARAM lParam) { m_over = true; DrawEditFrame(); return 0; } LRESULT ColorEdit::OnMouseLeave(WPARAM wParam,LPARAM lParam) { m_over = false; DrawEditFrame(); return 0; } void ColorEdit::OnLButtonDown(UINT nFlags,CPoint point) { CRect rcItem; this->GetClientRect(&rcItem); // Only if the mouse is above the password eye do we reveal the password if(m_isPassword && point.y <= rcItem.bottom && point.x >= (rcItem.right - rcItem.Height())) { SendMessage(EM_SETPASSWORDCHAR,0,0); } CWnd::OnLButtonDown(nFlags,point); } void ColorEdit::OnLButtonUp(UINT nFlags,CPoint point) { CRect rcItem; this->GetClientRect(&rcItem); if(m_isPassword) { // Re-hide the password SendMessage(EM_SETPASSWORDCHAR,'o',0); Invalidate(); } CWnd::OnLButtonUp(nFlags,point); } void ColorEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { if(nChar && m_empty) { if(m_isPassword) { // Hide empty text and start a password SetEmpty(false,""); SendMessage(EM_SETPASSWORDCHAR,'o',0); DrawEditFrame(); } else { CString text; CEdit::GetWindowText(text); if(text.Compare(EDIT_EMPTYFIELD) == 0) { CEdit::SetWindowText(""); } SetEmpty(false,""); } } CEdit::OnChar(nChar,nRepCnt,nFlags); DrawPasswordEye(); } // Return a non-NULL brush if the parent's handler should not be called HBRUSH ColorEdit::CtlColor(CDC* pDC, UINT nCtlColor) { DrawEditFrame(); // Change attributes of the DC here pDC->SetBkMode(TRANSPARENT); if(m_empty) { pDC->SetTextColor(m_colorTextEmpty); pDC->SetBkColor (m_colorBackgroundEmpty); return m_bkEmptyBrush; } else { pDC->SetTextColor(m_colorText); pDC->SetBkColor (m_colorBackground); return m_bkBrush; } } void ColorEdit::OnPaint() { CWnd::OnPaint(); DrawEditFrame(); DrawPasswordEye(); }
#pragma once #include <cstdarg> #include <cstdio> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <memory> #include <sstream> #include <string> #include <unordered_set> #include <vector> #include <algorithm> #include <queue> #include <thread> #include <fcntl.h> // NOLINT(build/include_order) #include <getopt.h> // NOLINT(build/include_order) #include <sys/time.h> // NOLINT(build/include_order) #include <sys/types.h> // NOLINT(build/include_order) #include <sys/uio.h> // NOLINT(build/include_order) #include <unistd.h> // NOLINT(build/include_order) #include "tensorflow/contrib/lite/kernels/register.h" #include "tensorflow/contrib/lite/model.h" #include "tensorflow/contrib/lite/optional_debug_tools.h" #include "tensorflow/contrib/lite/string_util.h" #include "tensorflow/contrib/lite/builtin_op_data.h" #include "tensorflow/contrib/lite/interpreter.h" #include "tensorflow/contrib/lite/kernels/register.h" #include "tensorflow/contrib/lite/string_util.h" #include "tensorflow/contrib/lite/version.h" #include "tensorflow/contrib/lite/string.h" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/features2d/features2d.hpp" #include <QtGui/QPixmap> struct Settings { bool verbose = false; bool accel = false; bool input_floating = false; bool profiling = false; bool allow_fp16 = false; int loop_count = 1; float input_mean = 127.5f; float input_std = 127.5f; tflite::string input_layer_type = "uint8_t"; int number_of_threads = std::max(int(std::thread::hardware_concurrency())-1, 1); int number_of_results = 5; }; template <class T> void get_top_n(T* prediction, int prediction_size, size_t num_results, float threshold, std::vector<std::pair<float, int>>* top_results, bool input_floating); /// The class wraps TensorFlow's APIs so that /// it is more easy to use. class TFLiteTools { public: TFLiteTools(QString const &tflite_file, QString const &label_file); TFLiteTools(QString const &tflite_file); ~TFLiteTools(); void LoadModel(QString &tflite_file); std::string doInference(const cv::Mat &frame); std::string doInferenceWPOD(const cv::Mat &frame); template <class T> void resize(T* out, uint8_t* in, int image_height, int image_width, int image_channels, int wanted_height, int wanted_width, int wanted_channels, Settings* s); private: std::unique_ptr<tflite::FlatBufferModel> _model; std::unique_ptr<tflite::Interpreter> _interpreter; QString _tflite_file; QString _label_file; Settings _s; };
// Copyright (c) 2012-2014 The Bitcoin Core developers // Copyright (c) 2014-2015 The Dash Core developers // Copyright (c) 2015-2017 The PIVX developers // Copyright (c) 2018 The Castle developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "netbase.h" #include <string> #include <boost/test/unit_test.hpp> using namespace std; BOOST_AUTO_TEST_SUITE(netbase_tests) BOOST_AUTO_TEST_CASE(netbase_networks) { BOOST_CHECK(CNetAddr("127.0.0.1").GetNetwork() == NET_UNROUTABLE); BOOST_CHECK(CNetAddr("::1").GetNetwork() == NET_UNROUTABLE); BOOST_CHECK(CNetAddr("8.8.8.8").GetNetwork() == NET_IPV4); BOOST_CHECK(CNetAddr("2001::8888").GetNetwork() == NET_IPV6); BOOST_CHECK(CNetAddr("FD87:D87E:EB43:edb1:8e4:3588:e546:35ca").GetNetwork() == NET_TOR); } BOOST_AUTO_TEST_CASE(netbase_properties) { BOOST_CHECK(CNetAddr("127.0.0.1").IsIPv4()); BOOST_CHECK(CNetAddr("::FFFF:192.168.1.1").IsIPv4()); BOOST_CHECK(CNetAddr("::1").IsIPv6()); BOOST_CHECK(CNetAddr("10.0.0.1").IsRFC1918()); BOOST_CHECK(CNetAddr("192.168.1.1").IsRFC1918()); BOOST_CHECK(CNetAddr("172.31.255.255").IsRFC1918()); BOOST_CHECK(CNetAddr("2001:0DB8::").IsRFC3849()); BOOST_CHECK(CNetAddr("169.254.1.1").IsRFC3927()); BOOST_CHECK(CNetAddr("2002::1").IsRFC3964()); BOOST_CHECK(CNetAddr("FC00::").IsRFC4193()); BOOST_CHECK(CNetAddr("2001::2").IsRFC4380()); BOOST_CHECK(CNetAddr("2001:10::").IsRFC4843()); BOOST_CHECK(CNetAddr("FE80::").IsRFC4862()); BOOST_CHECK(CNetAddr("64:FF9B::").IsRFC6052()); BOOST_CHECK(CNetAddr("FD87:D87E:EB43:edb1:8e4:3588:e546:35ca").IsTor()); BOOST_CHECK(CNetAddr("127.0.0.1").IsLocal()); BOOST_CHECK(CNetAddr("::1").IsLocal()); BOOST_CHECK(CNetAddr("8.8.8.8").IsRoutable()); BOOST_CHECK(CNetAddr("2001::1").IsRoutable()); BOOST_CHECK(CNetAddr("127.0.0.1").IsValid()); } bool static TestSplitHost(string test, string host, int port) { string hostOut; int portOut = -1; SplitHostPort(test, portOut, hostOut); return hostOut == host && port == portOut; } BOOST_AUTO_TEST_CASE(netbase_splithost) { BOOST_CHECK(TestSplitHost("www.bitcoin.org", "www.bitcoin.org", -1)); BOOST_CHECK(TestSplitHost("[www.bitcoin.org]", "www.bitcoin.org", -1)); BOOST_CHECK(TestSplitHost("www.bitcoin.org:80", "www.bitcoin.org", 80)); BOOST_CHECK(TestSplitHost("[www.bitcoin.org]:80", "www.bitcoin.org", 80)); BOOST_CHECK(TestSplitHost("127.0.0.1", "127.0.0.1", -1)); BOOST_CHECK(TestSplitHost("127.0.0.1:51472", "127.0.0.1", 51472)); BOOST_CHECK(TestSplitHost("[127.0.0.1]", "127.0.0.1", -1)); BOOST_CHECK(TestSplitHost("[127.0.0.1]:51472", "127.0.0.1", 51472)); BOOST_CHECK(TestSplitHost("::ffff:127.0.0.1", "::ffff:127.0.0.1", -1)); BOOST_CHECK(TestSplitHost("[::ffff:127.0.0.1]:51472", "::ffff:127.0.0.1", 51472)); BOOST_CHECK(TestSplitHost("[::]:51472", "::", 51472)); BOOST_CHECK(TestSplitHost("::51472", "::51472", -1)); BOOST_CHECK(TestSplitHost(":51472", "", 51472)); BOOST_CHECK(TestSplitHost("[]:51472", "", 51472)); BOOST_CHECK(TestSplitHost("", "", -1)); } bool static TestParse(string src, string canon) { CService addr; if (!LookupNumeric(src.c_str(), addr, 65535)) return canon == ""; return canon == addr.ToString(); } BOOST_AUTO_TEST_CASE(netbase_lookupnumeric) { BOOST_CHECK(TestParse("127.0.0.1", "127.0.0.1:65535")); BOOST_CHECK(TestParse("127.0.0.1:51472", "127.0.0.1:51472")); BOOST_CHECK(TestParse("::ffff:127.0.0.1", "127.0.0.1:65535")); BOOST_CHECK(TestParse("::", "[::]:65535")); BOOST_CHECK(TestParse("[::]:51472", "[::]:51472")); BOOST_CHECK(TestParse("[127.0.0.1]", "127.0.0.1:65535")); BOOST_CHECK(TestParse(":::", "")); } BOOST_AUTO_TEST_CASE(onioncat_test) { // values from https://web.archive.org/web/20121122003543/http://www.cypherpunk.at/onioncat/wiki/OnionCat CNetAddr addr1("5wyqrzbvrdsumnok.onion"); CNetAddr addr2("FD87:D87E:EB43:edb1:8e4:3588:e546:35ca"); BOOST_CHECK(addr1 == addr2); BOOST_CHECK(addr1.IsTor()); BOOST_CHECK(addr1.ToStringIP() == "5wyqrzbvrdsumnok.onion"); BOOST_CHECK(addr1.IsRoutable()); } BOOST_AUTO_TEST_CASE(subnet_test) { BOOST_CHECK(CSubNet("1.2.3.0/24") == CSubNet("1.2.3.0/255.255.255.0")); BOOST_CHECK(CSubNet("1.2.3.0/24") != CSubNet("1.2.4.0/255.255.255.0")); BOOST_CHECK(CSubNet("1.2.3.0/24").Match(CNetAddr("1.2.3.4"))); BOOST_CHECK(!CSubNet("1.2.2.0/24").Match(CNetAddr("1.2.3.4"))); BOOST_CHECK(CSubNet("1.2.3.4").Match(CNetAddr("1.2.3.4"))); BOOST_CHECK(CSubNet("1.2.3.4/32").Match(CNetAddr("1.2.3.4"))); BOOST_CHECK(!CSubNet("1.2.3.4").Match(CNetAddr("5.6.7.8"))); BOOST_CHECK(!CSubNet("1.2.3.4/32").Match(CNetAddr("5.6.7.8"))); BOOST_CHECK(CSubNet("::ffff:127.0.0.1").Match(CNetAddr("127.0.0.1"))); BOOST_CHECK(CSubNet("1:2:3:4:5:6:7:8").Match(CNetAddr("1:2:3:4:5:6:7:8"))); BOOST_CHECK(!CSubNet("1:2:3:4:5:6:7:8").Match(CNetAddr("1:2:3:4:5:6:7:9"))); BOOST_CHECK(CSubNet("1:2:3:4:5:6:7:0/112").Match(CNetAddr("1:2:3:4:5:6:7:1234"))); BOOST_CHECK(CSubNet("192.168.0.1/24").Match(CNetAddr("192.168.0.2"))); BOOST_CHECK(CSubNet("192.168.0.20/29").Match(CNetAddr("192.168.0.18"))); BOOST_CHECK(CSubNet("1.2.2.1/24").Match(CNetAddr("1.2.2.4"))); BOOST_CHECK(CSubNet("1.2.2.110/31").Match(CNetAddr("1.2.2.111"))); BOOST_CHECK(CSubNet("1.2.2.20/26").Match(CNetAddr("1.2.2.63"))); // All-Matching IPv6 Matches arbitrary IPv4 and IPv6 BOOST_CHECK(CSubNet("::/0").Match(CNetAddr("1:2:3:4:5:6:7:1234"))); BOOST_CHECK(CSubNet("::/0").Match(CNetAddr("1.2.3.4"))); // All-Matching IPv4 does not Match IPv6 BOOST_CHECK(!CSubNet("0.0.0.0/0").Match(CNetAddr("1:2:3:4:5:6:7:1234"))); // Invalid subnets Match nothing (not even invalid addresses) BOOST_CHECK(!CSubNet().Match(CNetAddr("1.2.3.4"))); BOOST_CHECK(!CSubNet("").Match(CNetAddr("4.5.6.7"))); BOOST_CHECK(!CSubNet("bloop").Match(CNetAddr("0.0.0.0"))); BOOST_CHECK(!CSubNet("bloop").Match(CNetAddr("hab"))); // Check valid/invalid BOOST_CHECK(CSubNet("1.2.3.0/0").IsValid()); BOOST_CHECK(!CSubNet("1.2.3.0/-1").IsValid()); BOOST_CHECK(CSubNet("1.2.3.0/32").IsValid()); BOOST_CHECK(!CSubNet("1.2.3.0/33").IsValid()); BOOST_CHECK(CSubNet("1:2:3:4:5:6:7:8/0").IsValid()); BOOST_CHECK(CSubNet("1:2:3:4:5:6:7:8/33").IsValid()); BOOST_CHECK(!CSubNet("1:2:3:4:5:6:7:8/-1").IsValid()); BOOST_CHECK(CSubNet("1:2:3:4:5:6:7:8/128").IsValid()); BOOST_CHECK(!CSubNet("1:2:3:4:5:6:7:8/129").IsValid()); BOOST_CHECK(!CSubNet("fuzzy").IsValid()); //CNetAddr constructor test BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).IsValid()); BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).Match(CNetAddr("127.0.0.1"))); BOOST_CHECK(!CSubNet(CNetAddr("127.0.0.1")).Match(CNetAddr("127.0.0.2"))); BOOST_CHECK(CSubNet(CNetAddr("127.0.0.1")).ToString() == "127.0.0.1/32"); BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).IsValid()); BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).Match(CNetAddr("1:2:3:4:5:6:7:8"))); BOOST_CHECK(!CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).Match(CNetAddr("1:2:3:4:5:6:7:9"))); BOOST_CHECK(CSubNet(CNetAddr("1:2:3:4:5:6:7:8")).ToString() == "1:2:3:4:5:6:7:8/128"); CSubNet subnet = CSubNet("1.2.3.4/255.255.255.255"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.4/32"); subnet = CSubNet("1.2.3.4/255.255.255.254"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.4/31"); subnet = CSubNet("1.2.3.4/255.255.255.252"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.4/30"); subnet = CSubNet("1.2.3.4/255.255.255.248"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.0/29"); subnet = CSubNet("1.2.3.4/255.255.255.240"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.0/28"); subnet = CSubNet("1.2.3.4/255.255.255.224"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.0/27"); subnet = CSubNet("1.2.3.4/255.255.255.192"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.0/26"); subnet = CSubNet("1.2.3.4/255.255.255.128"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.0/25"); subnet = CSubNet("1.2.3.4/255.255.255.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.3.0/24"); subnet = CSubNet("1.2.3.4/255.255.254.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.2.0/23"); subnet = CSubNet("1.2.3.4/255.255.252.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/22"); subnet = CSubNet("1.2.3.4/255.255.248.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/21"); subnet = CSubNet("1.2.3.4/255.255.240.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/20"); subnet = CSubNet("1.2.3.4/255.255.224.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/19"); subnet = CSubNet("1.2.3.4/255.255.192.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/18"); subnet = CSubNet("1.2.3.4/255.255.128.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/17"); subnet = CSubNet("1.2.3.4/255.255.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/16"); subnet = CSubNet("1.2.3.4/255.254.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/15"); subnet = CSubNet("1.2.3.4/255.252.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.0.0.0/14"); subnet = CSubNet("1.2.3.4/255.248.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.0.0.0/13"); subnet = CSubNet("1.2.3.4/255.240.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.0.0.0/12"); subnet = CSubNet("1.2.3.4/255.224.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.0.0.0/11"); subnet = CSubNet("1.2.3.4/255.192.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.0.0.0/10"); subnet = CSubNet("1.2.3.4/255.128.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.0.0.0/9"); subnet = CSubNet("1.2.3.4/255.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.0.0.0/8"); subnet = CSubNet("1.2.3.4/254.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "0.0.0.0/7"); subnet = CSubNet("1.2.3.4/252.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "0.0.0.0/6"); subnet = CSubNet("1.2.3.4/248.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "0.0.0.0/5"); subnet = CSubNet("1.2.3.4/240.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "0.0.0.0/4"); subnet = CSubNet("1.2.3.4/224.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "0.0.0.0/3"); subnet = CSubNet("1.2.3.4/192.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "0.0.0.0/2"); subnet = CSubNet("1.2.3.4/128.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "0.0.0.0/1"); subnet = CSubNet("1.2.3.4/0.0.0.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "0.0.0.0/0"); subnet = CSubNet("1:2:3:4:5:6:7:8/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"); BOOST_CHECK_EQUAL(subnet.ToString(), "1:2:3:4:5:6:7:8/128"); subnet = CSubNet("1:2:3:4:5:6:7:8/ffff:0000:0000:0000:0000:0000:0000:0000"); BOOST_CHECK_EQUAL(subnet.ToString(), "1::/16"); subnet = CSubNet("1:2:3:4:5:6:7:8/0000:0000:0000:0000:0000:0000:0000:0000"); BOOST_CHECK_EQUAL(subnet.ToString(), "::/0"); subnet = CSubNet("1.2.3.4/255.255.232.0"); BOOST_CHECK_EQUAL(subnet.ToString(), "1.2.0.0/255.255.232.0"); subnet = CSubNet("1:2:3:4:5:6:7:8/ffff:ffff:ffff:fffe:ffff:ffff:ffff:ff0f"); BOOST_CHECK_EQUAL(subnet.ToString(), "1:2:3:4:5:6:7:8/ffff:ffff:ffff:fffe:ffff:ffff:ffff:ff0f"); } BOOST_AUTO_TEST_SUITE_END()
#ifndef MyController_hpp #define MyController_hpp #include "oatpp-websocket/Handshaker.hpp" #include "oatpp/web/server/api/ApiController.hpp" #include "oatpp/network/ConnectionHandler.hpp" #include "oatpp/core/macro/codegen.hpp" #include "oatpp/core/macro/component.hpp" #include OATPP_CODEGEN_BEGIN(ApiController) //<-- codegen begin /** * Controller with WebSocket-connect endpoint. */ class MyController : public oatpp::web::server::api::ApiController { private: typedef MyController __ControllerType; private: OATPP_COMPONENT(std::shared_ptr<oatpp::network::ConnectionHandler>, websocketConnectionHandler, "websocket"); public: MyController(OATPP_COMPONENT(std::shared_ptr<ObjectMapper>, objectMapper)) : oatpp::web::server::api::ApiController(objectMapper) {} public: ENDPOINT_ASYNC("GET", "/", Root) { ENDPOINT_ASYNC_INIT(Root) const char* pageTemplate = "<html lang='en'>" "<head>" "<meta charset=utf-8/>" "</head>" "<body>" "<p>Hello Async WebSocket Server!</p>" "<p>" "<code>websocket endpoint is: localhost:8000/ws</code>" "</p>" "</body>" "</html>"; Action act() override { return _return(controller->createResponse(Status::CODE_200, pageTemplate)); } }; ENDPOINT_ASYNC("GET", "ws", WS) { ENDPOINT_ASYNC_INIT(WS) Action act() override { auto response = oatpp::websocket::Handshaker::serversideHandshake(request->getHeaders(), controller->websocketConnectionHandler); return _return(response); } }; // TODO Insert Your endpoints here !!! }; #include OATPP_CODEGEN_END(ApiController) //<-- codegen end #endif /* MyController_hpp */
// ArduinoJson - arduinojson.org // Copyright Benoit Blanchon 2014-2018 // MIT License #pragma once #include "integral_constant.hpp" namespace ARDUINOJSON_NAMESPACE { template <typename> struct is_signed : false_type {}; template <> struct is_signed<char> : true_type {}; template <> struct is_signed<signed char> : true_type {}; template <> struct is_signed<signed short> : true_type {}; template <> struct is_signed<signed int> : true_type {}; template <> struct is_signed<signed long> : true_type {}; template <> struct is_signed<float> : true_type {}; template <> struct is_signed<double> : true_type {}; #if ARDUINOJSON_HAS_LONG_LONG template <> struct is_signed<signed long long> : true_type {}; #endif #if ARDUINOJSON_HAS_INT64 template <> struct is_signed<signed __int64> : true_type {}; #endif } // namespace ARDUINOJSON_NAMESPACE
/** * @file * brief description, full stop. * * long description, many sentences. * */ #include "number.h" #include <QPainter> #include <QPaintEvent> #include "../config.h" #include "../exception.h" #include "../datamgr.h" #include "../tokens.h" Number::Number(QWidget *parent,Tokeniser *t) : QWidget(NULL){ invalid = true; value = 0; renderer = NULL; char varName[64]; varName[0]=0; char title[64]; title[0]=0; ConfigRect pos = ConfigManager::parseRect(); bool done = false; t->getnextcheck(T_OCURLY); DataBuffer<float> *b=NULL; while(!done){ switch(t->getnext()){ case T_VAR: case T_EXPR: t->rewind(); b = ConfigManager::parseFloatSource(); break; case T_TITLE: if(!t->getnextstring(title)) throw Exception(t->getline()).set("Unexpected '%s'",t->getstring()); break; case T_CCURLY: done=true; break; default: throw Exception(t->getline()).set("Unexpected '%s'",t->getstring()); } } if(title[0]==0) strcpy(title,b->name); layout = new QVBoxLayout(this); layout->setSpacing(0); main = new QLabel(""); label = new QLabel(title); label->setAlignment(Qt::AlignCenter); label->setMaximumSize(10000,30); main->setMinimumSize(pos.minsizex,pos.minsizey); layout->addWidget(main); layout->addWidget(label); setLayout(layout); main->setAlignment(Qt::AlignVCenter|Qt::AlignHCenter); if(!b) throw Exception("no data source given",t->getline()); renderer = new DataRenderer(this,b); QGridLayout *l = (QGridLayout*)parent->layout(); l->addWidget(this,pos.y,pos.x,pos.h,pos.w); ConfigManager::setStyle(this); } void Number::dataChanged(){ if(renderer){ DataBuffer<float> *b = renderer->getBuffer()->getFloatBuffer(); // get most recent datum Datum<float> *d = b->read(0); if(d && d->isRecent()){ value = d->d; // get data if any recent invalid = false; } } if(invalid){ main->setStyleSheet("color:gray;"); main->setText("no data"); }else{ ConfigManager::setStyle(main); main->setText(QString::number(value)); } }
// -- exception_test.cpp -- The Boost Lambda Library ------------------ // // Copyright (C) 2000-2003 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) // Copyright (C) 2000-2003 Gary Powell (powellg@amazon.com) // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // For more information, see www.boost.org // ----------------------------------------------------------------------- #include <boost/test/minimal.hpp> // see "Header Implementation Option" #include "boost/lambda/lambda.hpp" #include "boost/lambda/exceptions.hpp" #include "boost/lambda/bind.hpp" #include<iostream> #include<algorithm> #include <cstdlib> #include <iostream> using namespace boost::lambda; using namespace std; // to prevent unused variables warnings template <class T> void dummy(const T&) {} void erroneous_exception_related_lambda_expressions() { int i = 0; dummy(i); // Uncommenting any of the below code lines should result in a compile // time error // this should fail (a rethrow binder outside of catch // rethrow()(); // this should fail too for the same reason // try_catch(rethrow(), catch_all(cout << constant("Howdy")))(); // this fails too (_e outside of catch_exception) // (_1 + _2 + _e)(i, i, i); // and this (_e outside of catch_exception) // try_catch( throw_exception(1), catch_all(cout << _e)); // and this (_3 in catch_exception // try_catch( throw_exception(1), catch_exception<int>(cout << _3)); } class A1 {}; class A2 {}; class A3 {}; class A4 {}; class A5 {}; class A6 {}; class A7 {}; class A8 {}; class A9 {}; void throw_AX(int j) { int i = j; switch(i) { case 1: throw A1(); case 2: throw A2(); case 3: throw A3(); case 4: throw A4(); case 5: throw A5(); case 6: throw A6(); case 7: throw A7(); case 8: throw A8(); case 9: throw A9(); } } void test_different_number_of_catch_blocks() { int ecount; // no catch(...) cases ecount = 0; for(int i=1; i<=1; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 1); ecount = 0; for(int i=1; i<=2; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 2); ecount = 0; for(int i=1; i<=3; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 3); ecount = 0; for(int i=1; i<=4; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 4); ecount = 0; for(int i=1; i<=5; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 5); ecount = 0; for(int i=1; i<=6; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ), catch_exception<A6>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 6); ecount = 0; for(int i=1; i<=7; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ), catch_exception<A6>( var(ecount)++ ), catch_exception<A7>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 7); ecount = 0; for(int i=1; i<=8; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ), catch_exception<A6>( var(ecount)++ ), catch_exception<A7>( var(ecount)++ ), catch_exception<A8>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 8); ecount = 0; for(int i=1; i<=9; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ), catch_exception<A6>( var(ecount)++ ), catch_exception<A7>( var(ecount)++ ), catch_exception<A8>( var(ecount)++ ), catch_exception<A9>( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 9); // with catch(...) blocks ecount = 0; for(int i=1; i<=1; i++) { try_catch( bind(throw_AX, _1), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 1); ecount = 0; for(int i=1; i<=2; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 2); ecount = 0; for(int i=1; i<=3; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 3); ecount = 0; for(int i=1; i<=4; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 4); ecount = 0; for(int i=1; i<=5; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 5); ecount = 0; for(int i=1; i<=6; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 6); ecount = 0; for(int i=1; i<=7; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ), catch_exception<A6>( var(ecount)++ ), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 7); ecount = 0; for(int i=1; i<=8; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ), catch_exception<A6>( var(ecount)++ ), catch_exception<A7>( var(ecount)++ ), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 8); ecount = 0; for(int i=1; i<=9; i++) { try_catch( bind(throw_AX, _1), catch_exception<A1>( var(ecount)++ ), catch_exception<A2>( var(ecount)++ ), catch_exception<A3>( var(ecount)++ ), catch_exception<A4>( var(ecount)++ ), catch_exception<A5>( var(ecount)++ ), catch_exception<A6>( var(ecount)++ ), catch_exception<A7>( var(ecount)++ ), catch_exception<A8>( var(ecount)++ ), catch_all( var(ecount)++ ) )(i); } BOOST_CHECK(ecount == 9); } void test_empty_catch_blocks() { try_catch( bind(throw_AX, _1), catch_exception<A1>() )(make_const(1)); try_catch( bind(throw_AX, _1), catch_all() )(make_const(1)); } void return_type_matching() { // Rules for return types of the lambda functors in try and catch parts: // 1. The try part dictates the return type of the whole // try_catch lambda functor // 2. If return type of try part is void, catch parts can return anything, // but the return types are ignored // 3. If the return type of the try part is A, then each catch return type // must be implicitly convertible to A, or then it must throw for sure int i = 1; BOOST_CHECK( try_catch( _1 + 1, catch_exception<int>((&_1, rethrow())), // no match, but ok since throws catch_exception<char>(_e) // ok, char convertible to int )(i) == 2 ); // note that while e.g. char is convertible to int, it is not convertible // to int&, (some lambda functors return references) // try_catch( // _1 += 1, // catch_exception<char>(_e) // NOT ok, char not convertible to int& // )(i); // if you don't care about the return type, you can use make_void try_catch( make_void(_1 += 1), catch_exception<char>(_e) // since try is void, catch can return anything )(i); BOOST_CHECK(i == 2); try_catch( (_1 += 1, throw_exception('a')), catch_exception<char>(_e) // since try throws, it is void, // so catch can return anything )(i); BOOST_CHECK(i == 3); char a = 'a'; try_catch( try_catch( throw_exception(1), catch_exception<int>(throw_exception('b')) ), catch_exception<char>( _1 = _e ) )(a); BOOST_CHECK(a == 'b'); } int test_main(int, char *[]) { try { test_different_number_of_catch_blocks(); return_type_matching(); test_empty_catch_blocks(); } catch (int) { BOOST_CHECK(false); } catch(...) { BOOST_CHECK(false); } return EXIT_SUCCESS; }
// Copyright 2019 Google LLC // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. // // Auto-generated file. Do not edit! // Specification: test/f32-vclamp.yaml // Generator: tools/generate-vunary-test.py #include <gtest/gtest.h> #include <xnnpack/common.h> #include <xnnpack/isa-checks.h> #include <xnnpack/vunary.h> #include "vunary-microkernel-tester.h" #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_VCLAMP__NEON_X4, batch_eq_4) { TEST_REQUIRES_ARM_NEON; VUnaryMicrokernelTester() .batch_size(4) .Test(xnn_f32_vclamp_ukernel__neon_x4, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__NEON_X4, batch_div_4) { TEST_REQUIRES_ARM_NEON; for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__neon_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__NEON_X4, batch_lt_4) { TEST_REQUIRES_ARM_NEON; for (size_t batch_size = 1; batch_size < 4; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__neon_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__NEON_X4, batch_gt_4) { TEST_REQUIRES_ARM_NEON; for (size_t batch_size = 5; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__neon_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__NEON_X4, inplace) { TEST_REQUIRES_ARM_NEON; for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__neon_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__NEON_X4, qmin) { TEST_REQUIRES_ARM_NEON; for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__neon_x4, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__NEON_X4, qmax) { TEST_REQUIRES_ARM_NEON; for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__neon_x4, xnn_init_f32_minmax_scalar_params); } } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_ARM || XNN_ARCH_ARM64 TEST(F32_VCLAMP__NEON_X8, batch_eq_8) { TEST_REQUIRES_ARM_NEON; VUnaryMicrokernelTester() .batch_size(8) .Test(xnn_f32_vclamp_ukernel__neon_x8, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__NEON_X8, batch_div_8) { TEST_REQUIRES_ARM_NEON; for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__neon_x8, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__NEON_X8, batch_lt_8) { TEST_REQUIRES_ARM_NEON; for (size_t batch_size = 1; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__neon_x8, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__NEON_X8, batch_gt_8) { TEST_REQUIRES_ARM_NEON; for (size_t batch_size = 9; batch_size < 16; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__neon_x8, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__NEON_X8, inplace) { TEST_REQUIRES_ARM_NEON; for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__neon_x8, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__NEON_X8, qmin) { TEST_REQUIRES_ARM_NEON; for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__neon_x8, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__NEON_X8, qmax) { TEST_REQUIRES_ARM_NEON; for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__neon_x8, xnn_init_f32_minmax_scalar_params); } } } #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_VCLAMP__SSE_X4, batch_eq_4) { TEST_REQUIRES_X86_SSE; VUnaryMicrokernelTester() .batch_size(4) .Test(xnn_f32_vclamp_ukernel__sse_x4, xnn_init_f32_minmax_sse_params); } TEST(F32_VCLAMP__SSE_X4, batch_div_4) { TEST_REQUIRES_X86_SSE; for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__sse_x4, xnn_init_f32_minmax_sse_params); } } TEST(F32_VCLAMP__SSE_X4, batch_lt_4) { TEST_REQUIRES_X86_SSE; for (size_t batch_size = 1; batch_size < 4; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__sse_x4, xnn_init_f32_minmax_sse_params); } } TEST(F32_VCLAMP__SSE_X4, batch_gt_4) { TEST_REQUIRES_X86_SSE; for (size_t batch_size = 5; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__sse_x4, xnn_init_f32_minmax_sse_params); } } TEST(F32_VCLAMP__SSE_X4, inplace) { TEST_REQUIRES_X86_SSE; for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__sse_x4, xnn_init_f32_minmax_sse_params); } } TEST(F32_VCLAMP__SSE_X4, qmin) { TEST_REQUIRES_X86_SSE; for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__sse_x4, xnn_init_f32_minmax_sse_params); } } } TEST(F32_VCLAMP__SSE_X4, qmax) { TEST_REQUIRES_X86_SSE; for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__sse_x4, xnn_init_f32_minmax_sse_params); } } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_VCLAMP__SSE_X8, batch_eq_8) { TEST_REQUIRES_X86_SSE; VUnaryMicrokernelTester() .batch_size(8) .Test(xnn_f32_vclamp_ukernel__sse_x8, xnn_init_f32_minmax_sse_params); } TEST(F32_VCLAMP__SSE_X8, batch_div_8) { TEST_REQUIRES_X86_SSE; for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__sse_x8, xnn_init_f32_minmax_sse_params); } } TEST(F32_VCLAMP__SSE_X8, batch_lt_8) { TEST_REQUIRES_X86_SSE; for (size_t batch_size = 1; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__sse_x8, xnn_init_f32_minmax_sse_params); } } TEST(F32_VCLAMP__SSE_X8, batch_gt_8) { TEST_REQUIRES_X86_SSE; for (size_t batch_size = 9; batch_size < 16; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__sse_x8, xnn_init_f32_minmax_sse_params); } } TEST(F32_VCLAMP__SSE_X8, inplace) { TEST_REQUIRES_X86_SSE; for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__sse_x8, xnn_init_f32_minmax_sse_params); } } TEST(F32_VCLAMP__SSE_X8, qmin) { TEST_REQUIRES_X86_SSE; for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__sse_x8, xnn_init_f32_minmax_sse_params); } } } TEST(F32_VCLAMP__SSE_X8, qmax) { TEST_REQUIRES_X86_SSE; for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__sse_x8, xnn_init_f32_minmax_sse_params); } } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_VCLAMP__AVX_X8, batch_eq_8) { TEST_REQUIRES_X86_AVX; VUnaryMicrokernelTester() .batch_size(8) .Test(xnn_f32_vclamp_ukernel__avx_x8, xnn_init_f32_minmax_avx_params); } TEST(F32_VCLAMP__AVX_X8, batch_div_8) { TEST_REQUIRES_X86_AVX; for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx_x8, xnn_init_f32_minmax_avx_params); } } TEST(F32_VCLAMP__AVX_X8, batch_lt_8) { TEST_REQUIRES_X86_AVX; for (size_t batch_size = 1; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx_x8, xnn_init_f32_minmax_avx_params); } } TEST(F32_VCLAMP__AVX_X8, batch_gt_8) { TEST_REQUIRES_X86_AVX; for (size_t batch_size = 9; batch_size < 16; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx_x8, xnn_init_f32_minmax_avx_params); } } TEST(F32_VCLAMP__AVX_X8, inplace) { TEST_REQUIRES_X86_AVX; for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__avx_x8, xnn_init_f32_minmax_avx_params); } } TEST(F32_VCLAMP__AVX_X8, qmin) { TEST_REQUIRES_X86_AVX; for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__avx_x8, xnn_init_f32_minmax_avx_params); } } } TEST(F32_VCLAMP__AVX_X8, qmax) { TEST_REQUIRES_X86_AVX; for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__avx_x8, xnn_init_f32_minmax_avx_params); } } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_VCLAMP__AVX_X16, batch_eq_16) { TEST_REQUIRES_X86_AVX; VUnaryMicrokernelTester() .batch_size(16) .Test(xnn_f32_vclamp_ukernel__avx_x16, xnn_init_f32_minmax_avx_params); } TEST(F32_VCLAMP__AVX_X16, batch_div_16) { TEST_REQUIRES_X86_AVX; for (size_t batch_size = 32; batch_size < 160; batch_size += 16) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx_x16, xnn_init_f32_minmax_avx_params); } } TEST(F32_VCLAMP__AVX_X16, batch_lt_16) { TEST_REQUIRES_X86_AVX; for (size_t batch_size = 1; batch_size < 16; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx_x16, xnn_init_f32_minmax_avx_params); } } TEST(F32_VCLAMP__AVX_X16, batch_gt_16) { TEST_REQUIRES_X86_AVX; for (size_t batch_size = 17; batch_size < 32; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx_x16, xnn_init_f32_minmax_avx_params); } } TEST(F32_VCLAMP__AVX_X16, inplace) { TEST_REQUIRES_X86_AVX; for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__avx_x16, xnn_init_f32_minmax_avx_params); } } TEST(F32_VCLAMP__AVX_X16, qmin) { TEST_REQUIRES_X86_AVX; for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__avx_x16, xnn_init_f32_minmax_avx_params); } } } TEST(F32_VCLAMP__AVX_X16, qmax) { TEST_REQUIRES_X86_AVX; for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__avx_x16, xnn_init_f32_minmax_avx_params); } } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_VCLAMP__AVX512F_X16, batch_eq_16) { TEST_REQUIRES_X86_AVX512F; VUnaryMicrokernelTester() .batch_size(16) .Test(xnn_f32_vclamp_ukernel__avx512f_x16, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__AVX512F_X16, batch_div_16) { TEST_REQUIRES_X86_AVX512F; for (size_t batch_size = 32; batch_size < 160; batch_size += 16) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx512f_x16, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__AVX512F_X16, batch_lt_16) { TEST_REQUIRES_X86_AVX512F; for (size_t batch_size = 1; batch_size < 16; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx512f_x16, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__AVX512F_X16, batch_gt_16) { TEST_REQUIRES_X86_AVX512F; for (size_t batch_size = 17; batch_size < 32; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx512f_x16, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__AVX512F_X16, inplace) { TEST_REQUIRES_X86_AVX512F; for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__avx512f_x16, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__AVX512F_X16, qmin) { TEST_REQUIRES_X86_AVX512F; for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__avx512f_x16, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__AVX512F_X16, qmax) { TEST_REQUIRES_X86_AVX512F; for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__avx512f_x16, xnn_init_f32_minmax_scalar_params); } } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F32_VCLAMP__AVX512F_X32, batch_eq_32) { TEST_REQUIRES_X86_AVX512F; VUnaryMicrokernelTester() .batch_size(32) .Test(xnn_f32_vclamp_ukernel__avx512f_x32, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__AVX512F_X32, batch_div_32) { TEST_REQUIRES_X86_AVX512F; for (size_t batch_size = 64; batch_size < 320; batch_size += 32) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx512f_x32, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__AVX512F_X32, batch_lt_32) { TEST_REQUIRES_X86_AVX512F; for (size_t batch_size = 1; batch_size < 32; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx512f_x32, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__AVX512F_X32, batch_gt_32) { TEST_REQUIRES_X86_AVX512F; for (size_t batch_size = 33; batch_size < 64; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__avx512f_x32, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__AVX512F_X32, inplace) { TEST_REQUIRES_X86_AVX512F; for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__avx512f_x32, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__AVX512F_X32, qmin) { TEST_REQUIRES_X86_AVX512F; for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__avx512f_x32, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__AVX512F_X32, qmax) { TEST_REQUIRES_X86_AVX512F; for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__avx512f_x32, xnn_init_f32_minmax_scalar_params); } } } #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_VCLAMP__WASMSIMD_ARM_X4, batch_eq_4) { VUnaryMicrokernelTester() .batch_size(4) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x4, xnn_init_f32_minmax_wasmsimd_params); } TEST(F32_VCLAMP__WASMSIMD_ARM_X4, batch_div_4) { for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x4, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_ARM_X4, batch_lt_4) { for (size_t batch_size = 1; batch_size < 4; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x4, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_ARM_X4, batch_gt_4) { for (size_t batch_size = 5; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x4, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_ARM_X4, inplace) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x4, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_ARM_X4, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x4, xnn_init_f32_minmax_wasmsimd_params); } } } TEST(F32_VCLAMP__WASMSIMD_ARM_X4, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x4, xnn_init_f32_minmax_wasmsimd_params); } } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_VCLAMP__WASMSIMD_ARM_X8, batch_eq_8) { VUnaryMicrokernelTester() .batch_size(8) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x8, xnn_init_f32_minmax_wasmsimd_params); } TEST(F32_VCLAMP__WASMSIMD_ARM_X8, batch_div_8) { for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x8, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_ARM_X8, batch_lt_8) { for (size_t batch_size = 1; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x8, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_ARM_X8, batch_gt_8) { for (size_t batch_size = 9; batch_size < 16; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x8, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_ARM_X8, inplace) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x8, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_ARM_X8, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x8, xnn_init_f32_minmax_wasmsimd_params); } } } TEST(F32_VCLAMP__WASMSIMD_ARM_X8, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__wasmsimd_arm_x8, xnn_init_f32_minmax_wasmsimd_params); } } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_VCLAMP__WASMSIMD_X86_X4, batch_eq_4) { VUnaryMicrokernelTester() .batch_size(4) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x4, xnn_init_f32_minmax_wasmsimd_params); } TEST(F32_VCLAMP__WASMSIMD_X86_X4, batch_div_4) { for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x4, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_X86_X4, batch_lt_4) { for (size_t batch_size = 1; batch_size < 4; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x4, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_X86_X4, batch_gt_4) { for (size_t batch_size = 5; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x4, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_X86_X4, inplace) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x4, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_X86_X4, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x4, xnn_init_f32_minmax_wasmsimd_params); } } } TEST(F32_VCLAMP__WASMSIMD_X86_X4, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x4, xnn_init_f32_minmax_wasmsimd_params); } } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_VCLAMP__WASMSIMD_X86_X8, batch_eq_8) { VUnaryMicrokernelTester() .batch_size(8) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x8, xnn_init_f32_minmax_wasmsimd_params); } TEST(F32_VCLAMP__WASMSIMD_X86_X8, batch_div_8) { for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x8, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_X86_X8, batch_lt_8) { for (size_t batch_size = 1; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x8, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_X86_X8, batch_gt_8) { for (size_t batch_size = 9; batch_size < 16; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x8, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_X86_X8, inplace) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x8, xnn_init_f32_minmax_wasmsimd_params); } } TEST(F32_VCLAMP__WASMSIMD_X86_X8, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x8, xnn_init_f32_minmax_wasmsimd_params); } } } TEST(F32_VCLAMP__WASMSIMD_X86_X8, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__wasmsimd_x86_x8, xnn_init_f32_minmax_wasmsimd_params); } } } #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_VCLAMP__WASM_X1, batch_eq_1) { VUnaryMicrokernelTester() .batch_size(1) .Test(xnn_f32_vclamp_ukernel__wasm_x1, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__WASM_X1, batch_gt_1) { for (size_t batch_size = 2; batch_size < 10; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasm_x1, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X1, inplace) { for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__wasm_x1, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X1, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__wasm_x1, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__WASM_X1, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__wasm_x1, xnn_init_f32_minmax_scalar_params); } } } #endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_VCLAMP__WASM_X2, batch_eq_2) { VUnaryMicrokernelTester() .batch_size(2) .Test(xnn_f32_vclamp_ukernel__wasm_x2, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__WASM_X2, batch_div_2) { for (size_t batch_size = 4; batch_size < 20; batch_size += 2) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasm_x2, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X2, batch_lt_2) { for (size_t batch_size = 1; batch_size < 2; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasm_x2, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X2, batch_gt_2) { for (size_t batch_size = 3; batch_size < 4; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasm_x2, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X2, inplace) { for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__wasm_x2, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X2, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__wasm_x2, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__WASM_X2, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__wasm_x2, xnn_init_f32_minmax_scalar_params); } } } #endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD #if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_VCLAMP__WASM_X4, batch_eq_4) { VUnaryMicrokernelTester() .batch_size(4) .Test(xnn_f32_vclamp_ukernel__wasm_x4, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__WASM_X4, batch_div_4) { for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasm_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X4, batch_lt_4) { for (size_t batch_size = 1; batch_size < 4; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasm_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X4, batch_gt_4) { for (size_t batch_size = 5; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__wasm_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X4, inplace) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__wasm_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__WASM_X4, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__wasm_x4, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__WASM_X4, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__wasm_x4, xnn_init_f32_minmax_scalar_params); } } } #endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD TEST(F32_VCLAMP__SCALAR_X1, batch_eq_1) { VUnaryMicrokernelTester() .batch_size(1) .Test(xnn_f32_vclamp_ukernel__scalar_x1, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__SCALAR_X1, batch_gt_1) { for (size_t batch_size = 2; batch_size < 10; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__scalar_x1, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X1, inplace) { for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__scalar_x1, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X1, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__scalar_x1, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__SCALAR_X1, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__scalar_x1, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__SCALAR_X2, batch_eq_2) { VUnaryMicrokernelTester() .batch_size(2) .Test(xnn_f32_vclamp_ukernel__scalar_x2, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__SCALAR_X2, batch_div_2) { for (size_t batch_size = 4; batch_size < 20; batch_size += 2) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__scalar_x2, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X2, batch_lt_2) { for (size_t batch_size = 1; batch_size < 2; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__scalar_x2, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X2, batch_gt_2) { for (size_t batch_size = 3; batch_size < 4; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__scalar_x2, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X2, inplace) { for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__scalar_x2, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X2, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__scalar_x2, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__SCALAR_X2, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__scalar_x2, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__SCALAR_X4, batch_eq_4) { VUnaryMicrokernelTester() .batch_size(4) .Test(xnn_f32_vclamp_ukernel__scalar_x4, xnn_init_f32_minmax_scalar_params); } TEST(F32_VCLAMP__SCALAR_X4, batch_div_4) { for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__scalar_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X4, batch_lt_4) { for (size_t batch_size = 1; batch_size < 4; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__scalar_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X4, batch_gt_4) { for (size_t batch_size = 5; batch_size < 8; batch_size++) { VUnaryMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vclamp_ukernel__scalar_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X4, inplace) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vclamp_ukernel__scalar_x4, xnn_init_f32_minmax_scalar_params); } } TEST(F32_VCLAMP__SCALAR_X4, qmin) { for (uint8_t qmin = 1; qmin < 255; qmin++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmin(qmin) .Test(xnn_f32_vclamp_ukernel__scalar_x4, xnn_init_f32_minmax_scalar_params); } } } TEST(F32_VCLAMP__SCALAR_X4, qmax) { for (uint8_t qmax = 1; qmax < 255; qmax++) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VUnaryMicrokernelTester() .batch_size(batch_size) .qmax(qmax) .Test(xnn_f32_vclamp_ukernel__scalar_x4, xnn_init_f32_minmax_scalar_params); } } }
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "hermes/Support/CheckedMalloc.h" #include "hermes/Support/ErrorHandling.h" #include "hermes/Support/SlowAssert.h" #include "hermes/VM/CheckHeapWellFormedAcceptor.h" #include "hermes/VM/GC.h" #include "hermes/VM/GCBase-inline.h" #include "hermes/VM/GCPointer-inline.h" #include "hermes/VM/HermesValue-inline.h" #include "hermes/VM/HiddenClass.h" #include "hermes/VM/JSWeakMapImpl.h" #include "hermes/VM/SlotAcceptorDefault.h" #include "llvm/Support/Debug.h" #include <algorithm> #define DEBUG_TYPE "gc" namespace hermes { namespace vm { struct MallocGC::MarkingAcceptor final : public SlotAcceptorDefault, public WeakRootAcceptor { std::vector<CellHeader *> worklist_; /// The WeakMap objects that have been discovered to be reachable. std::vector<JSWeakMap *> reachableWeakMaps_; /// markedSymbols_ represents which symbols have been proven live so far in /// a collection. True means that it is live, false means that it could /// possibly be garbage. At the end of the collection, it is guaranteed that /// the falses are garbage. std::vector<bool> markedSymbols_; MarkingAcceptor(GC &gc) : SlotAcceptorDefault(gc) { markedSymbols_.resize(gc.gcCallbacks_->getSymbolsEnd(), false); } using SlotAcceptorDefault::accept; void accept(void *&ptr) override { if (!ptr) { return; } GCCell *&cell = reinterpret_cast<GCCell *&>(ptr); HERMES_SLOW_ASSERT( gc.validPointer(cell) && "Marked a pointer that the GC didn't allocate"); CellHeader *header = CellHeader::from(cell); #ifdef HERMESVM_SANITIZE_HANDLES /// Make the acceptor idempotent: allow it to be called multiple /// times on the same slot during a collection. Do this by /// recognizing when the pointer is already a "new" pointer. if (gc.newPointers_.count(header)) { return; } // With handle-san on, handle moving pointers here. if (header->isMarked()) { cell = header->getForwardingPointer()->data(); } else { // It hasn't been seen before, move it. // At this point, also trim the object. const bool canBeTrimmed = cell->getVT()->canBeTrimmed(); const gcheapsize_t trimmedSize = cell->getVT()->getTrimmedSize(cell, cell->getAllocatedSize()); auto *newLocation = new (checkedMalloc(trimmedSize + sizeof(CellHeader))) CellHeader(); newLocation->mark(); memcpy(newLocation->data(), cell, trimmedSize); if (canBeTrimmed) { auto *newVarCell = reinterpret_cast<VariableSizeRuntimeCell *>(newLocation->data()); newVarCell->setSizeDuringGCCompaction(trimmedSize); newVarCell->getVT()->trim(newVarCell); } // Make sure to put an element on the worklist that is at the updated // location. Don't update the stale address that is about to be free'd. header->markWithForwardingPointer(newLocation); auto *newCell = newLocation->data(); if (newCell->getKind() == CellKind::WeakMapKind) { reachableWeakMaps_.push_back(vmcast<JSWeakMap>(newCell)); } else { worklist_.push_back(newLocation); } gc.newPointers_.insert(newLocation); if (gc.idTracker_.isTrackingIDs()) { gc.idTracker_.moveObject(cell, newLocation->data()); } cell = newLocation->data(); } #else if (!header->isMarked()) { // Only add to the worklist if it hasn't been marked yet. header->mark(); // Trim the cell. This is fine to do with malloc'ed memory because the // original size is retained by malloc. if (cell->getVT()->canBeTrimmed()) { cell->getVT()->trim(cell); } if (cell->getKind() == CellKind::WeakMapKind) { reachableWeakMaps_.push_back(vmcast<JSWeakMap>(cell)); } else { worklist_.push_back(header); } // Move the pointer from the old pointers to the new pointers. gc.pointers_.erase(header); gc.newPointers_.insert(header); } // Else the cell is already marked and either on the worklist or already // visited entirely, do nothing. #endif } void acceptWeak(void *&ptr) override { if (ptr == nullptr) { return; } auto *cell = reinterpret_cast<GCCell *>(ptr); CellHeader *header = CellHeader::from(cell); // Reset weak root if target GCCell is dead. #ifdef HERMESVM_SANITIZE_HANDLES ptr = header->isMarked() ? header->getForwardingPointer()->data() : nullptr; #else ptr = header->isMarked() ? ptr : nullptr; #endif } void accept(HermesValue &hv) override { if (hv.isPointer()) { void *ptr = hv.getPointer(); accept(ptr); hv.setInGC(hv.updatePointer(ptr), &gc); } else if (hv.isSymbol()) { accept(hv.getSymbol()); } } void accept(SymbolID sym) override { if (sym.isInvalid()) { return; } assert( sym.unsafeGetIndex() < markedSymbols_.size() && "Tried to mark a symbol not in range"); markedSymbols_[sym.unsafeGetIndex()] = true; } void accept(WeakRefBase &wr) override { wr.unsafeGetSlot()->mark(); } }; gcheapsize_t MallocGC::Size::storageFootprint() const { // MallocGC uses no storage from the StorageProvider. return 0; } gcheapsize_t MallocGC::Size::minStorageFootprint() const { // MallocGC uses no storage from the StorageProvider. return 0; } MallocGC::MallocGC( MetadataTable metaTable, GCCallbacks *gcCallbacks, PointerBase *pointerBase, const GCConfig &gcConfig, std::shared_ptr<CrashManager> crashMgr, std::shared_ptr<StorageProvider> provider) : GCBase( metaTable, gcCallbacks, pointerBase, gcConfig, std::move(crashMgr)), pointers_(), weakPointers_(), maxSize_(Size(gcConfig).max()), sizeLimit_(gcConfig.getInitHeapSize()) {} MallocGC::~MallocGC() { for (CellHeader *header : pointers_) { free(header); } } void MallocGC::collectBeforeAlloc(uint32_t size) { const auto growSizeLimit = [this, size](gcheapsize_t sizeLimit) { // Either double the size limit, or increase to size, at a max of maxSize_. return std::min(maxSize_, std::max(sizeLimit * 2, size)); }; if (size > sizeLimit_) { sizeLimit_ = growSizeLimit(sizeLimit_); } if (size > maxSize_) { // No way to handle the allocation no matter what. oom(make_error_code(OOMError::MaxHeapReached)); } assert( size <= sizeLimit_ && "Should be guaranteed not to be asking for more space than the heap can " "provide"); // Check for memory pressure conditions to do a collection. // Use subtraction to prevent overflow. #ifndef HERMESVM_SANITIZE_HANDLES if (allocatedBytes_ < sizeLimit_ - size) { return; } #endif // Do a collection if the sanitization of handles is requested or if there // is memory pressure. collect(); // While we still can't fill the allocation, keep growing. while (allocatedBytes_ >= sizeLimit_ - size) { if (sizeLimit_ == maxSize_) { // Can't grow memory any higher, OOM. oom(make_error_code(OOMError::MaxHeapReached)); } sizeLimit_ = growSizeLimit(sizeLimit_); } } #ifdef HERMES_SLOW_DEBUG void MallocGC::checkWellFormed() { GCCycle cycle{this}; CheckHeapWellFormedAcceptor acceptor(*this); DroppingAcceptor<CheckHeapWellFormedAcceptor> nameAcceptor{acceptor}; markRoots(nameAcceptor, true); markWeakRoots(acceptor); for (CellHeader *header : pointers_) { GCCell *cell = header->data(); assert(cell->isValid() && "Invalid cell encountered in heap"); GCBase::markCell(cell, this, acceptor); } } void MallocGC::clearUnmarkedPropertyMaps() { for (CellHeader *header : pointers_) if (!header->isMarked()) if (auto hc = dyn_vmcast<HiddenClass>(header->data())) hc->clearPropertyMap(); } #endif void MallocGC::collect() { assert(noAllocLevel_ == 0 && "no GC allowed right now"); using std::chrono::steady_clock; LLVM_DEBUG(llvm::dbgs() << "Beginning collection"); #ifdef HERMES_SLOW_DEBUG checkWellFormed(); #endif const auto wallStart = steady_clock::now(); const auto cpuStart = oscompat::thread_cpu_time(); auto allocatedBefore = allocatedBytes_; resetStats(); // Begin the collection phases. { GCCycle cycle{this, gcCallbacks_, "Full collection"}; MarkingAcceptor acceptor(*this); DroppingAcceptor<MarkingAcceptor> nameAcceptor{acceptor}; markRoots(nameAcceptor, true); #ifdef HERMES_SLOW_DEBUG clearUnmarkedPropertyMaps(); #endif drainMarkStack(acceptor); // The marking loop above will have accumulated WeakMaps; // find things reachable from values of reachable keys. completeWeakMapMarking(acceptor); // Update weak roots references. markWeakRoots(acceptor); // Update and remove weak references. updateWeakReferences(); resetWeakReferences(); // Free the unused symbols. gcCallbacks_->freeSymbols(acceptor.markedSymbols_); // By the end of the marking loop, all pointers left in pointers_ are dead. for (CellHeader *header : pointers_) { #ifndef HERMESVM_SANITIZE_HANDLES // If handle sanitization isn't on, these pointers should all be dead. assert(!header->isMarked() && "Live pointer left in dead heap section"); #endif GCCell *cell = header->data(); #ifndef NDEBUG // Extract before running any potential finalizers. const auto freedSize = cell->getAllocatedSize(); #endif // Run the finalizer if it exists and the cell is actually dead. if (!header->isMarked()) { cell->getVT()->finalizeIfExists(cell, this); #ifndef NDEBUG // Update statistics. if (cell->getVT()->finalize_) { ++numFinalizedObjects_; } #endif } if (idTracker_.isTrackingIDs()) { idTracker_.untrackObject(cell); } #ifndef NDEBUG // Before free'ing, fill with a dead value for debugging std::fill_n(reinterpret_cast<char *>(cell), freedSize, kInvalidHeapValue); #endif free(header); } #ifndef NDEBUG #ifdef HERMESVM_SANITIZE_HANDLES // If handle sanitization is on, pointers_ is unmodified from before the // collection, and the number of collected objects is the difference between // the pointers before, and the pointers after the collection. assert( pointers_.size() >= newPointers_.size() && "There cannot be more new pointers than there are old pointers"); numCollectedObjects_ = pointers_.size() - newPointers_.size(); #else // If handle sanitization is not on, live pointers are removed from // pointers_ so the number of collected objects is equal to the size of // pointers_. numCollectedObjects_ = pointers_.size(); #endif numReachableObjects_ = newPointers_.size(); numAllocatedObjects_ = newPointers_.size(); #endif pointers_ = std::move(newPointers_); assert( newPointers_.empty() && "newPointers_ should be empty between collections"); // Clear all the mark bits in pointers_. for (CellHeader *header : pointers_) { assert(header->isMarked() && "Should only be live pointers left"); header->unmark(); } } // End of the collection phases, begin cleanup and stat recording. #ifdef HERMES_SLOW_DEBUG checkWellFormed(); #endif // Grow the size limit if the heap is still more than 75% full. if (allocatedBytes_ >= sizeLimit_ * 3 / 4) { sizeLimit_ = std::min(maxSize_, sizeLimit_ * 2); } const auto cpuEnd = oscompat::thread_cpu_time(); const auto wallEnd = steady_clock::now(); double wallElapsedSecs = GCBase::clockDiffSeconds(wallStart, wallEnd); double cpuElapsedSecs = GCBase::clockDiffSeconds(cpuStart, cpuEnd); recordGCStats( wallElapsedSecs, cpuElapsedSecs, allocatedBytes_, allocatedBefore, allocatedBytes_); checkTripwire(allocatedBytes_); } void MallocGC::drainMarkStack(MarkingAcceptor &acceptor) { while (!acceptor.worklist_.empty()) { CellHeader *header = acceptor.worklist_.back(); acceptor.worklist_.pop_back(); assert(header->isMarked() && "Pointer on the worklist isn't marked"); GCCell *cell = header->data(); GCBase::markCell(cell, this, acceptor); allocatedBytes_ += cell->getAllocatedSize(); } } void MallocGC::completeWeakMapMarking(MarkingAcceptor &acceptor) { gcheapsize_t weakMapAllocBytes = GCBase::completeWeakMapMarking( this, acceptor, acceptor.reachableWeakMaps_, /*objIsMarked*/ [](GCCell *cell) { return CellHeader::from(cell)->isMarked(); }, /*markFromVal*/ [this, &acceptor](GCCell *valCell, HermesValue &valRef) { CellHeader *valHeader = CellHeader::from(valCell); if (valHeader->isMarked()) { #ifdef HERMESVM_SANITIZE_HANDLES valRef.setInGC( HermesValue::encodeObjectValue( valHeader->getForwardingPointer()->data()), this); #endif return false; } acceptor.accept(valRef); drainMarkStack(acceptor); return true; }, /*drainMarkStack*/ [this](MarkingAcceptor &acceptor) { drainMarkStack(acceptor); }, /*checkMarkStackOverflow (MallocGC does not have mark stack overflow)*/ []() { return false; }); acceptor.reachableWeakMaps_.clear(); // drainMarkStack will have added the size of every object popped // from the mark stack. WeakMaps are never pushed on that stack, // but the call above returns their total size. So add that. allocatedBytes_ += weakMapAllocBytes; } void MallocGC::finalizeAll() { for (CellHeader *header : pointers_) { GCCell *cell = header->data(); cell->getVT()->finalizeIfExists(cell, this); } } void MallocGC::printStats(llvm::raw_ostream &os, bool trailingComma) { if (!recordGcStats_) { return; } GCBase::printStats(os, true); os << "\t\"specific\": {\n" << "\t\t\"collector\": \"malloc\",\n" << "\t\t\"stats\": {}\n" << "\t},\n"; gcCallbacks_->printRuntimeGCStats(os); if (trailingComma) { os << ","; } os << "\n"; } void MallocGC::resetStats() { #ifndef NDEBUG numAllocatedObjects_ = 0; numReachableObjects_ = 0; numCollectedObjects_ = 0; numMarkedSymbols_ = 0; numHiddenClasses_ = 0; numLeafHiddenClasses_ = 0; #endif allocatedBytes_ = 0; numFinalizedObjects_ = 0; } void MallocGC::getHeapInfo(HeapInfo &info) { GCBase::getHeapInfo(info); info.allocatedBytes = allocatedBytes_; // MallocGC does not have a heap size. info.heapSize = 0; } void MallocGC::getHeapInfoWithMallocSize(HeapInfo &info) { getHeapInfo(info); info.mallocSizeEstimate = 0; for (CellHeader *header : pointers_) { GCCell *cell = header->data(); info.mallocSizeEstimate += cell->getVT()->getMallocSize(cell); } } void MallocGC::getCrashManagerHeapInfo(CrashManager::HeapInformation &info) { info.used_ = allocatedBytes_; // MallocGC does not have a heap size. info.size_ = 0; } #ifndef NDEBUG size_t MallocGC::countUsedWeakRefs() const { size_t count = 0; for (auto &slot : weakPointers_) { if (slot.state() != WeakSlotState::Free) { ++count; } } return count; } #endif void MallocGC::forAllObjs(const std::function<void(GCCell *)> &callback) { for (auto *ptr : pointers_) { callback(ptr->data()); } } void MallocGC::resetWeakReferences() { for (auto &slot : weakPointers_) { // Set all allocated slots to unmarked. if (slot.state() == WeakSlotState::Marked) slot.unmark(); } } void MallocGC::updateWeakReferences() { for (auto &slot : weakPointers_) { switch (slot.state()) { case WeakSlotState::Free: break; case WeakSlotState::Unmarked: freeWeakSlot(&slot); break; case WeakSlotState::Marked: // If it's not a pointer, nothing to do. if (!slot.hasPointer()) { break; } auto *cell = reinterpret_cast<GCCell *>(slot.getPointer()); HERMES_SLOW_ASSERT( validPointer(cell) && "Got a pointer out of a weak reference slot that is not owned by " "the GC"); CellHeader *header = CellHeader::from(cell); if (!header->isMarked()) { // This pointer is no longer live, zero it out slot.clearPointer(); } else { #ifdef HERMESVM_SANITIZE_HANDLES // Update the value to point to the new location GCCell *nextCell = header->getForwardingPointer()->data(); HERMES_SLOW_ASSERT( validPointer(cell) && "Forwarding weak ref must be to a valid cell"); slot.setPointer(nextCell); #endif } break; } } } WeakRefSlot *MallocGC::allocWeakSlot(HermesValue init) { weakPointers_.push_back({init}); return &weakPointers_.back(); } void MallocGC::freeWeakSlot(WeakRefSlot *slot) { slot->free(nullptr); } #ifndef NDEBUG bool MallocGC::validPointer(const void *p) const { auto *ptr = reinterpret_cast<GCCell *>(const_cast<void *>(p)); CellHeader *header = CellHeader::from(ptr); bool isValid = pointers_.find(header) != pointers_.end(); isValid = isValid || newPointers_.find(header) != newPointers_.end(); return isValid; } bool MallocGC::isMostRecentFinalizableObj(const GCCell *cell) const { // We don't keep track of the sequence of finalizable objects in // MallocGC; rather, it looks directly at whether a freed cell's vtable has // a finalizer method. So we just return whether \p cell has a finalizer. // This won't detect errors, but it also won't give false positives. return cell->getVT()->finalize_ != nullptr; } #endif void MallocGC::createSnapshot(llvm::raw_ostream &os) { hermes_fatal("No snapshots allowed with MallocGC"); } #ifdef HERMESVM_SERIALIZE void MallocGC::serializeWeakRefs(Serializer &s) { hermes_fatal("serializeWeakRefs not implemented for current GC"); } void MallocGC::deserializeWeakRefs(Deserializer &d) { hermes_fatal("deserializeWeakRefs not implemented for current GC"); } void MallocGC::serializeHeap(Serializer &s) { hermes_fatal("serializeHeap not implemented for current GC"); } void MallocGC::deserializeHeap(Deserializer &d) { hermes_fatal("serializeHeap not implemented for current GC"); } void MallocGC::deserializeStart() { hermes_fatal("Serialization/Deserialization not allowed with MallocGC"); } void MallocGC::deserializeEnd() { hermes_fatal("Serialization/Deserialization not allowed with MallocGC"); } #endif /// @name Forward instantiations /// @{ template void *MallocGC::alloc</*FixedSize*/ true, HasFinalizer::Yes>( uint32_t size); template void *MallocGC::alloc</*FixedSize*/ false, HasFinalizer::Yes>( uint32_t size); template void *MallocGC::alloc</*FixedSize*/ true, HasFinalizer::No>( uint32_t size); template void *MallocGC::alloc</*FixedSize*/ false, HasFinalizer::No>( uint32_t size); template void *MallocGC::allocLongLived<HasFinalizer::Yes>(uint32_t size); template void *MallocGC::allocLongLived<HasFinalizer::No>(uint32_t size); /// @} } // namespace vm } // namespace hermes
/********************************************************************************* * * Inviwo - Interactive Visualization Workshop * * Copyright (c) 2016-2020 Inviwo Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *********************************************************************************/ #include <modules/basegl/algorithm/entryexitpoints.h> #include <inviwo/core/datastructures/camera.h> #include <inviwo/core/datastructures/coordinatetransformer.h> #include <inviwo/core/datastructures/image/image.h> #include <inviwo/core/datastructures/volume/volume.h> #include <modules/opengl/texture/textureutils.h> #include <modules/opengl/shader/shaderutils.h> #include <modules/opengl/openglutils.h> #include <modules/opengl/rendering/meshdrawergl.h> #include <modules/opengl/image/imagegl.h> #include <glm/gtx/handed_coordinate_space.hpp> namespace inviwo { namespace algorithm { EntryExitPointsHelper::EntryExitPointsHelper() : entryExitShader_("standard.vert", "standard.frag") , meshEntryExitShader_("meshentryexit.vert", "standard.frag") , nearClipShader_("img_identity.vert", "capnearclipping.frag") {} void EntryExitPointsHelper::operator()(Image& entryPoints, Image& exitPoints, const Camera& camera, const Mesh& mesh, bool capNearClip) { if (capNearClip) { createCappedEntryExitPoints(*entryPoints.getEditableRepresentation<ImageGL>(), *exitPoints.getEditableRepresentation<ImageGL>(), camera, mesh); } else { createEntryExitPoints(*entryPoints.getEditableRepresentation<ImageGL>(), *exitPoints.getEditableRepresentation<ImageGL>(), camera, mesh); } } void EntryExitPointsHelper::operator()(ImageGL& entryPoints, ImageGL& exitPoints, const Camera& camera, const Mesh& mesh, bool capNearClip) { if (capNearClip) { createCappedEntryExitPoints(entryPoints, exitPoints, camera, mesh); } else { createEntryExitPoints(entryPoints, exitPoints, camera, mesh); } } void EntryExitPointsHelper::operator()(Image& entryPoints, Image& exitPoints, const Camera& camera, const Volume& volume, const Mesh& mesh, bool capNearClip) { const mat4 meshDataToVolumeData = volume.getCoordinateTransformer(camera).getWorldToDataMatrix() * mesh.getCoordinateTransformer().getDataToWorldMatrix(); if (capNearClip) { createCappedEntryExitPoints(*entryPoints.getEditableRepresentation<ImageGL>(), *exitPoints.getEditableRepresentation<ImageGL>(), camera, mesh, true, meshDataToVolumeData); } else { createEntryExitPoints(*entryPoints.getEditableRepresentation<ImageGL>(), *exitPoints.getEditableRepresentation<ImageGL>(), camera, mesh, true, meshDataToVolumeData); } } void EntryExitPointsHelper::operator()(ImageGL& entryPoints, ImageGL& exitPoints, const Camera& camera, const Volume& volume, const Mesh& mesh, bool capNearClip) { const mat4 meshDataToVolumeData = volume.getCoordinateTransformer(camera).getWorldToDataMatrix() * mesh.getCoordinateTransformer().getDataToWorldMatrix(); if (capNearClip) { createCappedEntryExitPoints(entryPoints, exitPoints, camera, mesh, true, meshDataToVolumeData); } else { createEntryExitPoints(entryPoints, exitPoints, camera, mesh, true, meshDataToVolumeData); } } std::vector<std::reference_wrapper<Shader>> EntryExitPointsHelper::getShaders() { return {entryExitShader_, meshEntryExitShader_, nearClipShader_}; } void EntryExitPointsHelper::createEntryExitPoints(ImageGL& entryPoints, ImageGL& exitPoints, const Camera& camera, const Mesh& mesh, bool applyTrafo, const mat4& meshDataToVolumeData) { Shader& shader = applyTrafo ? meshEntryExitShader_ : entryExitShader_; shader.activate(); const mat4 dataToClipMatrix = mesh.getCoordinateTransformer(camera).getDataToClipMatrix(); shader.setUniform("dataToClip", dataToClipMatrix); shader.setUniform("meshDataToVolData", meshDataToVolumeData); const bool righthanded = glm::rightHanded(vec3(dataToClipMatrix[0]), vec3(dataToClipMatrix[1]), vec3(dataToClipMatrix[2])); auto drawer = MeshDrawerGL::getDrawObject(&mesh); { // generate exit points utilgl::DepthFuncState depthfunc(GL_GREATER); utilgl::ClearDepth clearDepth(0.0f); exitPoints.activateBuffer(ImageType::ColorDepth); utilgl::clearCurrentTarget(); utilgl::CullFaceState cull(righthanded ? GL_BACK : GL_FRONT); drawer.draw(); utilgl::deactivateCurrentTarget(); } { // generate entry points utilgl::DepthFuncState depthfunc(GL_LESS); entryPoints.activateBuffer(ImageType::ColorDepth); utilgl::clearCurrentTarget(); utilgl::CullFaceState cull(righthanded ? GL_FRONT : GL_BACK); drawer.draw(); utilgl::deactivateCurrentTarget(); } shader.deactivate(); } void EntryExitPointsHelper::createCappedEntryExitPoints(ImageGL& entryPoints, ImageGL& exitPoints, const Camera& camera, const Mesh& mesh, bool applyTrafo, const mat4& meshDataToVolumeData) { Shader& shader = applyTrafo ? meshEntryExitShader_ : entryExitShader_; shader.activate(); const mat4 dataToClipMatrix = mesh.getCoordinateTransformer(camera).getDataToClipMatrix(); shader.setUniform("dataToClip", dataToClipMatrix); shader.setUniform("meshDataToVolData", meshDataToVolumeData); const bool righthanded = glm::rightHanded(vec3(dataToClipMatrix[0]), vec3(dataToClipMatrix[1]), vec3(dataToClipMatrix[2])); auto drawer = MeshDrawerGL::getDrawObject(&mesh); { // generate exit points utilgl::DepthFuncState depthfunc(GL_GREATER); utilgl::ClearDepth clearDepth(0.0f); exitPoints.activateBuffer(ImageType::ColorDepth); utilgl::clearCurrentTarget(); utilgl::CullFaceState cull(righthanded ? GL_BACK : GL_FRONT); drawer.draw(); utilgl::deactivateCurrentTarget(); } { // generate entry points utilgl::DepthFuncState depthfunc(GL_LESS); if (!tmpEntry_ || tmpEntry_->getDimensions() != entryPoints.getDimensions() || tmpEntry_->getDataFormat() != entryPoints.getColorLayerGL()->getDataFormat()) { tmpEntry_.reset(new Image(entryPoints.getDimensions(), entryPoints.getColorLayerGL()->getDataFormat())); tmpEntryGL_ = tmpEntry_->getEditableRepresentation<ImageGL>(); } tmpEntryGL_->activateBuffer(ImageType::AllLayers); utilgl::clearCurrentTarget(); utilgl::CullFaceState cull(righthanded ? GL_FRONT : GL_BACK); drawer.draw(); utilgl::deactivateCurrentTarget(); } // render an image plane aligned quad to cap the proxy geometry entryPoints.activateBuffer(ImageType::ColorDepth); utilgl::clearCurrentTarget(); nearClipShader_.activate(); TextureUnit entryColorUnit, entryDepthUnit; tmpEntryGL_->getColorLayerGL()->bindTexture(entryColorUnit); tmpEntryGL_->getDepthLayerGL()->bindTexture(entryDepthUnit); nearClipShader_.setUniform("entryColor", entryColorUnit); nearClipShader_.setUniform("entryDepth", entryDepthUnit); TextureUnit exitColorUnit, exitDepthUnit; exitPoints.getColorLayerGL()->bindTexture(exitColorUnit); exitPoints.getDepthLayerGL()->bindTexture(exitDepthUnit); nearClipShader_.setUniform("exitColor", exitColorUnit); nearClipShader_.setUniform("exitDepth", exitDepthUnit); // the rendered plane is specified in camera coordinates // thus we must transform from camera to world to texture coordinates mat4 clipToTexMat = mesh.getCoordinateTransformer(camera).getClipToDataMatrix(); nearClipShader_.setUniform("NDCToTextureMat", clipToTexMat); nearClipShader_.setUniform("nearDist", camera.getNearPlaneDist()); utilgl::singleDrawImagePlaneRect(); nearClipShader_.deactivate(); utilgl::deactivateCurrentTarget(); } } // namespace algorithm } // namespace inviwo
/**************************************************************************** ** ** GateImpl.cpp -- Main control implementation file. ** ** Date Modification Author ** -----------|----------------------------------------------------|---------- ** 1999/03/20 Initial development. C. Monroe ** 2003/05/29 On Debug builds, add tracing of Open and Close to ** C:\OposCCO_Gate.log ** 2004/03/22 Add significantly more tracing when Debug. ** 2004/10/26 Minor enhancement of Debug tracing of strings. ** 2005/12/14 Add Debug tracing of event delivery. ** 2008/01/15 Add more parameter and error checking. ** 2013/09/29 Update license section. ** 2015/02/07 Update license section. ** Use OposVariantResult for Invoke results. ** Correct possible buffer overflow in Open. ** Updates to copies and printf to remove any ** potential buffer overflows. ** 2015/02/07 Version 1.14.001. ** 2021/12/02 Version 1.16.000. K. Fukuchi ** ***************************************************************************** ** {{Begin License}} Copyright 2015 Monroe Consulting Services, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. {{End License}} */ ///////////////////////////////////////////////////////////////////////////// // Includes ///////////////////////////////////////////////////////////////////////////// // Include the standard header. #include "stdafx.h" // Include the MIDL-generated header. #include "Gate.h" // Include this control's header. #include "GateImpl.h" // Include character <--> wide conversions header. #include "CWString.h" // Include the OPOS header. #include "OposGate.hi" // TSIZEOF(x) returns characters in "x" bytes. #define TSIZEOF(x) (sizeof(x)/sizeof(TCHAR)) // Ensure that character array has NUL as last character. #define NULTERMINATE(x) x[TSIZEOF(x) - 1] = '\0'; ///////////////////////////////////////////////////////////////////////////// // Data ///////////////////////////////////////////////////////////////////////////// // Hidden window class and window name. TCHAR g_WindowName[] = _T("HW_OPOSGate"); // Control Object description and version. char g_ControlDescription[] = "OPOS Gate Control 1.16.000 [Public, by CRM/MCS, and modified by KF]" IFDEBUG(" [With Tracing]"); LONG g_ControlVersion = 1 * 1000000 + 16 * 1000 + 000; // Count of instances within this process. int COPOSGate::s_nInstances = 0; //=========================================================================== // Method name table. Used to lookup methods in SO. //=========================================================================== static char* s_SOMethodNames[SO_DISP_COUNT + 1] = { // Release 1.12 methods "COFreezeEvents", #define nDICOFreezeEvents 0 "GetPropertyNumber", #define nDIGetPropertyNumber 1 "SetPropertyNumber", #define nDISetPropertyNumber 2 "GetPropertyString", #define nDIGetPropertyString 3 "SetPropertyString", #define nDISetPropertyString 4 "OpenService", #define nDIOpenService 5 "CheckHealth", #define nDICheckHealth 6 "ClaimDevice", #define nDIClaimDevice 7 "CloseService", #define nDICloseService 8 "DirectIO", #define nDIDirectIO 9 "ReleaseDevice", #define nDIReleaseDevice 10 "ResetStatistics", #define nDIResetStatistics 11 "RetrieveStatistics", #define nDIRetrieveStatistics 12 "UpdateStatistics", #define nDIUpdateStatistics 13 "CompareFirmwareVersion", #define nDICompareFirmwareVersion 14 "UpdateFirmware", #define nDIUpdateFirmware 15 "OpenGate", #define nDIOpenGate 16 "WaitForGateClose", #define nDIWaitForGateClose 17 0 }; //=========================================================================== // Required method count table. // Contains count of methods from table above that must be present // for each release. // Followed by the initial minor release of the OPOS Gate. //=========================================================================== static int s_RequiredMethodsPerRelease[] = { 18 // Release 1.12 }; const int MinorReleaseInitial = 12; ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // // Constructor / Destructor // ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// COPOSGate::COPOSGate() IFDEBUG( : CProxy_IOPOSEvents< COPOSGate >(this) ) { } //=========================================================================== HRESULT COPOSGate::FinalConstruct() { TRACEINIT; DOTRACE( ( _T("") ) ); DOTRACE( ( _T("*Constructing: %hs"), g_ControlDescription ) ); _bOpened = false; _nOpenResult = 0; _nSOMajor = 0; _nSOMinor = 0; _nCOResultCode = -1; _nCOFreezeEventCount = 0; _bFreezeState = false; IFDEBUG( _nBinaryConversion = OPOS_BC_NONE ); HRESULT hRC = EventInit(); s_nInstances++; // Increment instance count at end of FinalConstruct. return hRC; } //=========================================================================== COPOSGate::~COPOSGate() { DOTRACE( ( _T("*Destructing") ) ); s_nInstances--; // Decrement instance count at start of destructor. long RC; if ( _bOpened ) Close( &RC ); EventUninit(); DOTRACE( ( _T("") ) ); TRACEEXIT; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // // Control handlers // ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Override the IOleControlImpl handler for container request to freeze/unfreeze events. STDMETHODIMP COPOSGate::FreezeEvents( BOOL bFreeze ) { // If requesting events to be frozen... if ( bFreeze ) { DOTRACEV( ( _T("*FreezeEvents: Freezing %d"), _nCOFreezeEventCount ) ); if ( _nCOFreezeEventCount == 0 && // If events are not currently frozen and _bOpened ) // SO is opened, SetCOFreezeEvents( TRUE ); // then freeze events in the SO. _nCOFreezeEventCount++; // Increment freeze count. Must do after informing SO. } // Else requesting events to be unfrozen... else { _nCOFreezeEventCount--; // Decrement freeze count. Must do before informing SO. DOTRACEV( ( _T("*FreezeEvents: Unfreezing %d"), _nCOFreezeEventCount ) ); if ( _nCOFreezeEventCount == 0 && // If events have become unfrozen and _bOpened ) // SO is opened, SetCOFreezeEvents( FALSE ); // then unfreeze events in the SO. } // Just in case anyone cares ... keep the CComControlBase one in sync. m_nFreezeEvents = _nCOFreezeEventCount; return S_OK; } //=========================================================================== // Implement the draw handler. HRESULT COPOSGate::OnDraw( ATL_DRAWINFO& di ) { RECT& rc = *(RECT*)di.prcBounds; // Draw our bitmap... // - Load bitmap and get info HBITMAP hBitmap = LoadBitmap( _Module.GetModuleInstance(), // handle of the instance containing the image MAKEINTRESOURCE(IDB_OPOSGATE2) ); // bitmap resource name BITMAP bmp; GetObject( hBitmap, // handle to graphics object of interest sizeof(BITMAP), // size of buffer for object information &bmp ); // pointer to buffer for object information // - Create a compatible memory DC and select bitmap into it HDC hMemDC = CreateCompatibleDC( di.hdcDraw ); // handle to the device context HBITMAP hOldBitmap = (HBITMAP) SelectObject( hMemDC, // handle to device context hBitmap ); // handle to object // - Copy bitmap from memory DC to screen DC BitBlt( di.hdcDraw, // handle to destination device context rc.left, // x-coordinate of destination rectangle's upper-left corner rc.top, // y-coordinate of destination rectangle's upper-left corner min( bmp.bmWidth, rc.right - rc.left ), // width of destination rectangle min( bmp.bmHeight, rc.bottom - rc.top ), // height of destination rectangle hMemDC, // handle to source device context 0, // x-coordinate of source rectangle's upper-left corner 0, // y-coordinate of source rectangle's upper-left corner SRCCOPY ); // raster operation code // Cleanup SelectObject( hMemDC, hOldBitmap ); DeleteObject( hMemDC ); DeleteObject( hBitmap ); return S_OK; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // // Property Access / Freeze Setting // ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// HRESULT COPOSGate::GetOposProp( DEBUGPARAM(LPCSTR pPropName) long nIndex, long* pnValue, long nMinor ) { DOTRACEV( ( _T("+%hs [Get]"), pPropName ) ); // Initialize return value. HRESULT hRC = S_OK; *pnValue = 0; // If open and SO version support's property... if ( _bOpened && _nSOMinor >= nMinor ) { // Set up and call the SO's get property number method. OposVariant Var; OposVariantResult VarResult; Var.SetLONG( nIndex ); DISPPARAMS Disp = { &Var, NULL, 1, 0 }; hRC = _pService->Invoke( _DispIDs[nDIGetPropertyNumber], IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &Disp, &VarResult, NULL, NULL ); // If success, then set return result. if ( hRC == S_OK ) VarResult.ChangeLONG( pnValue, hRC ); } // Trace result. #ifdef _DEBUG LPCTSTR pszInfo = _T(""); TCHAR szHR[50]; if ( !_bOpened ) pszInfo = _T(" -- Closed"); else if ( _nSOMinor < nMinor ) pszInfo = _T(" -- Not supported by SO"); else if ( hRC != 0 ) { _sntprintf( szHR, TSIZEOF(szHR), _T(" -- COM error: HR = 0x%X"), hRC ); NULTERMINATE(szHR); pszInfo = szHR; } DOTRACEV( ( _T("-%hs [Get]: %d (0x%X)%s"), pPropName, *pnValue, *pnValue, pszInfo ) ); #endif return hRC; } //--------------------------------------------------------------------------- HRESULT COPOSGate::SetOposProp( DEBUGPARAM(LPCSTR pPropName) long nIndex, long nValue, long nMinor ) { DOTRACEV( ( _T("+%hs [Set]: %d (0x%X)"), pPropName, nValue, nValue ) ); HRESULT hRC = S_OK; SetRC(); // Clear COResultCode. // If open and SO version support's property... if ( _bOpened && _nSOMinor >= nMinor ) { // Set up and call the SO's set property number method. OposVariant Vars[2]; OposVariantResult VarResult; Vars[1].SetLONG( nIndex ); Vars[0].SetLONG( nValue ); OposDispParms Disp( Vars, 2 ); hRC = _pService->Invoke( _DispIDs[nDISetPropertyNumber], IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &Disp, &VarResult, NULL, NULL ); } // Handle error. else if ( _bOpened ) // If open but not supported, SetRC( OPOS_E_NOSERVICE ); // set COResultCode. // Trace result. #ifdef _DEBUG LPCTSTR pszInfo = _T(""); TCHAR szHR[50]; if ( !_bOpened ) pszInfo = _T(" -- Closed"); else if ( _nSOMinor < nMinor ) pszInfo = _T(" -- Not supported by SO"); else if ( hRC != 0 ) { _sntprintf( szHR, TSIZEOF(szHR), _T(" -- COM error: HR = 0x%X"), hRC ); NULTERMINATE(szHR); pszInfo = szHR; } DOTRACEV( ( _T("-%hs [Set]%s"), pPropName, pszInfo ) ); #endif return hRC; } //=========================================================================== HRESULT COPOSGate::GetOposProp( DEBUGPARAM(LPCSTR pPropName) long nIndex, VARIANT_BOOL* pnValue, long nMinor ) { // If getting a boolean, then force return value to proper VARIANT_BOOL value. long nValue; HRESULT hRC = GetOposProp( DEBUGPARAM(pPropName) nIndex, &nValue, nMinor ); *pnValue = nValue ? VARIANT_TRUE : VARIANT_FALSE; return hRC; } //--------------------------------------------------------------------------- HRESULT COPOSGate::SetOposProp( DEBUGPARAM(LPCSTR pPropName) long nIndex, VARIANT_BOOL nValue, long nMinor ) { // If setting a boolean, then force to use VC++ TRUE or FALSE, // since several vendors test specifically against TRUE (1) // rather than non-zero. return SetOposProp( DEBUGPARAM(pPropName) nIndex, static_cast<long>(nValue ? TRUE : FALSE), nMinor ); } //=========================================================================== HRESULT COPOSGate::GetOposProp( DEBUGPARAM(LPCSTR pPropName) long nIndex, BSTR* psValue, long nMinor ) { DOTRACEV( ( _T("+%hs [Get]"), pPropName ) ); // Initialize return value. HRESULT hRC = S_OK; // If open and SO version support's property... if ( _bOpened && _nSOMinor >= nMinor ) { // Set up and call the SO's get property number method. OposVariant Var; OposVariantResult VarResult; Var.SetLONG( nIndex ); DISPPARAMS Disp = { &Var, NULL, 1, 0 }; hRC = _pService->Invoke( _DispIDs[nDIGetPropertyString], IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &Disp, &VarResult, NULL, NULL ); // If succeeds, then return result. if ( hRC == S_OK ) VarResult.ChangeBSTR( psValue, hRC ); } // Else return default string. else *psValue = ::SysAllocString( L"[Error]" ); // Trace result. #ifdef _DEBUG LPCTSTR pszFormat = _T("-%hs [Get]."); if ( !_bOpened ) pszFormat = _T("-%hs [Get] -- Closed."); else if ( _nSOMinor < nMinor ) pszFormat = _T("-%hs [Get] -- Not supported by SO."); else if ( hRC != 0 ) pszFormat = _T("-%hs [Get] -- COM error: HR = 0x%X"); TCHAR szPrefix[100]; _sntprintf( szPrefix, TSIZEOF(szPrefix), pszFormat, pPropName, hRC ); NULTERMINATE(szPrefix); DOTRACESTRINGV( szPrefix, *psValue ); #endif return hRC; } //--------------------------------------------------------------------------- HRESULT COPOSGate::SetOposProp( DEBUGPARAM(LPCSTR pPropName) long nIndex, BSTR sValue, long nMinor ) { #ifdef _DEBUG TCHAR szPrefix[100]; _sntprintf( szPrefix, TSIZEOF(szPrefix), _T("+%hs [Set]."), pPropName ); NULTERMINATE(szPrefix); DOTRACESTRINGV( szPrefix, sValue ); #endif HRESULT hRC = S_OK; SetRC(); // Clear COResultCode. // If open and SO version support's property... if ( _bOpened && _nSOMinor >= nMinor ) { // Set up and call the SO's set property number method. OposVariant Vars[2]; OposVariantResult VarResult; Vars[1].SetLONG( nIndex ); Vars[0].SetBSTR( sValue, hRC ); OposDispParms Disp( Vars, 2 ); if ( hRC == S_OK ) hRC = _pService->Invoke( _DispIDs[nDISetPropertyString], IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &Disp, &VarResult, NULL, NULL ); } // Handle error. else if ( _bOpened ) // If open but not supported, SetRC( OPOS_E_NOSERVICE ); // set COResultCode. // Trace result. #ifdef _DEBUG LPCTSTR pszInfo = _T(""); TCHAR szHR[50]; if ( !_bOpened ) pszInfo = _T(" -- Closed"); else if ( _nSOMinor < nMinor ) pszInfo = _T(" -- Not supported by SO"); else if ( hRC != 0 ) { _sntprintf( szHR, TSIZEOF(szHR), _T(" -- COM error: HR = 0x%X"), hRC ); NULTERMINATE(szHR); pszInfo = szHR; } DOTRACEV( ( _T("-%hs [Set]%s"), pPropName, pszInfo ) ); #endif return hRC; } //=========================================================================== HRESULT COPOSGate::DoInvoke( DEBUGPARAM(LPCSTR pFuncName) HRESULT hRC, OposVariant* pParms, unsigned nParms, int nDispIDIndex, long* pRC, bool bOpenCheck ) { // Trace incoming function and parameters. #ifdef _DEBUG OposVariant* pVar; TCHAR szParmNum[20]; TCHAR szPrefix[100]; OposVariant* pStrRefs = new OposVariant[nParms]; DOTRACEV( ( _T("+%hs [Function] %u parameter%s"), pFuncName, nParms, nParms == 1 ? _T("") : _T("s") ) ); unsigned u; for ( u = 0; ++u <= nParms; ) { HRESULT hRCTmp; pVar = &pParms[ nParms - u ]; _sntprintf( szParmNum, TSIZEOF(szParmNum), _T(" #%u: "), u ); NULTERMINATE(szParmNum); switch ( pVar->vt ) { case VT_EMPTY: DOTRACEV( ( _T("%sEMPTY"), szParmNum ) ); break; case VT_BOOL: DOTRACEV( ( _T("%sBOOL 0x%X"), szParmNum, pVar->boolVal ) ); break; case VT_BYREF|VT_BOOL: DOTRACEV( ( _T("%sBOOL* 0x%X"), szParmNum, *pVar->pboolVal ) ); break; case VT_I4: DOTRACEV( ( _T("%sLONG %d (0x%X)"), szParmNum, pVar->lVal, pVar->lVal ) ); break; case VT_BYREF|VT_I4: DOTRACEV( ( _T("%sLONG* %d (0x%X)"), szParmNum, *pVar->plVal, *pVar->plVal ) ); break; case VT_DISPATCH: DOTRACEV( ( _T("%sDISPATCH 0x%X"), szParmNum, pVar->pdispVal ) ); break; case VT_BSTR: _sntprintf( szPrefix, TSIZEOF(szPrefix), _T("%sSTRING;"), szParmNum ); NULTERMINATE(szPrefix); DOTRACESTRINGV( szPrefix, pVar->bstrVal ); break; case VT_BYREF|VT_BSTR: pStrRefs[u-1].SetBSTR_Copy( *pVar->pbstrVal, hRCTmp ); _sntprintf( szPrefix, TSIZEOF(szPrefix), _T("%sSTRING*;"), szParmNum ); NULTERMINATE(szPrefix); DOTRACESTRINGV( szPrefix, *pVar->pbstrVal ); break; default: DOTRACEV( ( _T("%sUnknown (VarType=0x%X)"), szParmNum, pVar->vt ) ); break; } } // If bad ResultCode pointer, then HRESULT. if ( pRC == 0 ) hRC = E_POINTER; // If bad HRESULT (either due to incoming value or bad ResultCode pointer), then return now. if ( FAILED(hRC) ) { DOTRACEERR( _T("- Failed: Parameter error 0x%X\n %s"), hRC ); delete [] pStrRefs; return hRC; } #endif hRC = -1; // Clear the CO result code. SetRC(); // If the SO must be open... if ( bOpenCheck ) { // If not opened, set error code and return.... if ( ! _bOpened ) { *pRC = OPOS_E_CLOSED; hRC = S_OK; } // If the SO's release level doesn't support this method, then return error. else if ( nDispIDIndex >= _nMaxMethod ) { *pRC = SetRC( OPOS_E_NOSERVICE ); hRC = S_OK; } } // Complete setup for Invoke call. if ( hRC == -1 ) { OposVariantResult VarResult; OposDispParms Disp( pParms, nParms ); // Invoke the SO method. hRC = _pService->Invoke( _DispIDs[nDispIDIndex], IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &Disp, &VarResult, NULL, NULL ); // Set OPOS result code to SO method value if Invoke succeeded, // else flag that we failed to get to the SO. *pRC = (hRC == S_OK) ? VarResult.GetLONG() : SetRC( OPOS_E_NOSERVICE ); } // Trace result and outgoing parameters. #ifdef _DEBUG LPCTSTR pszInfo = _T(""); TCHAR szHR[50]; if ( !_bOpened ) pszInfo = _T(" -- Closed"); else if ( nDispIDIndex >= _nMaxMethod ) pszInfo = _T(" -- Not supported by SO"); else if ( hRC != 0 ) { _sntprintf( szHR, TSIZEOF(szHR), _T(" -- COM error: HR = 0x%X"), hRC ); NULTERMINATE(szHR); pszInfo = szHR; } DOTRACEV( ( _T("-%hs [Function] RC=%d%s"), pFuncName, *pRC, pszInfo ) ); for ( u = 0; ++u <= nParms; ) { pVar = &pParms[ nParms - u ]; _sntprintf( szParmNum, TSIZEOF(szParmNum), _T(" #%u: "), u ); NULTERMINATE(szParmNum); switch ( pVar->vt ) { case VT_BYREF|VT_BOOL: DOTRACEV( ( _T("%sBOOL* 0x%X"), szParmNum, *pVar->pboolVal ) ); break; case VT_BYREF|VT_I4: DOTRACEV( ( _T("%sLONG* %d (0x%X)"), szParmNum, *pVar->plVal, *pVar->plVal ) ); break; case VT_BYREF|VT_BSTR: { _sntprintf( szPrefix, TSIZEOF(szPrefix), _T("%sSTRING*;"), szParmNum ); NULTERMINATE(szPrefix); UINT nStrRefLen; OposVariant* pStrRef = &pStrRefs[u-1]; if ( pStrRef->vt == VT_BSTR && ( nStrRefLen = ::SysStringByteLen( pStrRef->bstrVal ) ) == ::SysStringByteLen( *pVar->pbstrVal ) && 0 == ::memcmp( pStrRef->bstrVal, *pVar->pbstrVal, nStrRefLen ) ) DOTRACEV( ( _T("%s Unchanged"), szPrefix ) ); else DOTRACESTRINGV( szPrefix, *pVar->pbstrVal ); break; } } } delete [] pStrRefs; #endif return hRC; } //=========================================================================== void COPOSGate::SetCOFreezeEvents( VARIANT_BOOL bFreeze ) { // If open... if ( _bOpened ) { DOTRACEV( ( _T("*SetCOFreezeEvents: 0x%X"), bFreeze ) ); // Set up and call the method to inform the SO of container freeze/unfreeze. OposVariant Var; OposVariantResult VarResult; Var.SetVARIANT_BOOL( bFreeze ); DISPPARAMS Disp = { &Var, NULL, 1, 0 }; _pService->Invoke( _DispIDs[nDICOFreezeEvents], IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &Disp, &VarResult, NULL, NULL ); } } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // // Methods // ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Open, Close ///////////////////////////////////////////////////////////////////////////// STDMETHODIMP COPOSGate::Open( BSTR DeviceName, long *pRC ) { HRESULT hRC; LONG nError; DOTRACE( ( _T("*Open [Function]: DeviceName <%ls>"), DeviceName ) ); // If already open, return error. if ( _bOpened ) { *pRC = SetRC( OPOS_E_ILLEGAL ); _nOpenResult = OPOS_OR_ALREADYOPEN; DOTRACE( ( _T("- Failed: CCO already open (%d/%d)"), *pRC, _nOpenResult ) ); return S_OK; } // Initialize ResultCode and OpenResult for possible returns below. *pRC = SetRC( OPOS_E_NOEXIST ); _nOpenResult = OPOS_OR_REGBADNAME; // Check the DeviceName length... UINT nDeviceNameLen = ::SysStringLen( DeviceName ); // - Ensure that the DeviceName is not an empty string. if ( nDeviceNameLen == 0 ) { DOTRACE( ( _T("- Failed: Empty device name (%d/%d)"), *pRC, _nOpenResult ) ); return S_OK; } // - Ensure that the DeviceName is not unreasonably long. // Otherwise it may overrun this line below: wcscpy( szPhysicalDeviceName, DeviceName ) if ( nDeviceNameLen >= MAX_REGBUFFER_SIZE ) { DOTRACE( ( _T("- Failed: Device name too big (%d/%d)"), *pRC, _nOpenResult ) ); return S_OK; } // Form and open the base key. TCHAR szBaseKey[ MAX_REGBUFFER_SIZE ]; HKEY hBaseKey; cw_strcpy( szBaseKey, OPOS_ROOTKEY "\\" OPOS_CLASSKEY_GATE ); nError = RegOpenKeyEx( HKEY_LOCAL_MACHINE, // Handle to open key szBaseKey, // Address of name of subkey to open 0, // Reserved KEY_READ, // Security access mask &hBaseKey ); // Address of handle to open key if ( ERROR_SUCCESS != nError ) { DOTRACE( ( _T("- Failed: Cannot open registry key <%s> (%d/%d)"), szBaseKey, *pRC, _nOpenResult ) ); DOTRACEERR( _T(" RegOpenKeyEx error %d\n %s"), nError ); return S_OK; } DOTRACE( ( _T(" Opened registry key HKLM\\%s"), szBaseKey ) ); // If the DeviceName parameter is a string value in the base key, // then a logical name was specified: // Use the value's data as the physical device name. // Else the name is the physical device name. TCHAR szPhysicalDeviceName[ MAX_REGBUFFER_SIZE ]; DWORD dwType; DWORD dwSize = sizeof( szPhysicalDeviceName ); if ( ERROR_SUCCESS != RegQueryValueEx( hBaseKey, // Handle to key to query _CW(DeviceName), // Address of name of value to query 0, // Reserved &dwType, // Address of buffer for value type (LPBYTE) szPhysicalDeviceName, // Address of data buffer &dwSize ) || // Address of data buffer size dwType != REG_SZ ) { wcscpy( szPhysicalDeviceName, DeviceName ); DOTRACE( ( _T(" DeviceName is not a LogicalName; treating as PhysicalName") ) ); } else { NULTERMINATE(szPhysicalDeviceName); DOTRACE( ( _T(" DeviceName is a LogicalName; converted to PhysicalName <%s>"), szPhysicalDeviceName ) ); } // Open the physical registry entry. Close the base key. // If fails, then return error. HKEY hServiceKey; LONG nRegStat = RegOpenKeyEx( hBaseKey, // handle to open key szPhysicalDeviceName, // address of name of subkey to open 0, // reserved KEY_READ, // security access mask &hServiceKey ); // address of handle to open key RegCloseKey( hBaseKey ); if ( ERROR_SUCCESS != nRegStat ) { DOTRACE( ( _T("- Failed: Cannot open DeviceName subkey (%d/%d)"), *pRC, _nOpenResult ) ); DOTRACEERR( _T(" RegOpenKeyEx error %d\n %s"), nRegStat ); return S_OK; } DOTRACE( ( _T(" Opened DeviceName subkey") ) ); // Initialize ResultCode and OpenResult for possible returns below. *pRC = SetRC( OPOS_E_NOSERVICE ); _nOpenResult = OPOS_OR_REGPROGID; // Now get the Service Object's ProgID, which is the default value's data for the device's key. // If fails, then return error. TCHAR sSOProgID[ MAX_REGBUFFER_SIZE ]; dwSize = sizeof( sSOProgID ); nRegStat = RegQueryValueEx( hServiceKey, // Handle to key to query 0, // Address of name of value to query 0, // Reserved &dwType, // Address of buffer for value type (LPBYTE) sSOProgID, // Address of data buffer &dwSize ); // Address of data buffer size RegCloseKey( hServiceKey ); if ( ERROR_SUCCESS != nRegStat || dwType != REG_SZ ) { DOTRACE( ( _T("- Failed: Cannot get ProgID from registry (%d/%d)"), *pRC, _nOpenResult ) ); DOTRACEERR( _T(" RegOpenKeyEx error %d\n %s"), nRegStat ); return S_OK; } NULTERMINATE(sSOProgID); DOTRACE( ( _T(" DeviceName mapped to ProgID <%s>"), sSOProgID ) ); // Convert the ProgID to a CLSID. CLSID SOClassID; hRC = CLSIDFromProgID( _CW(sSOProgID), // Pointer to the ProgID &SOClassID ); // Pointer to the CLSID if ( S_OK != hRC ) { DOTRACE( ( _T("- Failed: Cannot convert ProgID to ClassID (%d/%d)"), *pRC, _nOpenResult ) ); DOTRACEERR( _T(" CLSIDFromProgID error 0x%X\n %s"), hRC ); return S_OK; } DOTRACE( ( _T(" ProgID mapped to ClassID") ) ); // Make the connection to the Service Object. // We create an instance, get the IDispatch pointer, then release the IUnknown pointer. IUnknown* pUnknown; hRC = CoCreateInstance( SOClassID, // Class identifier (CLSID) of the object 0, // Pointer to whether object is or isn't part of an aggregate CLSCTX_ALL, // Context for running executable code IID_IUnknown, // Reference to the identifier of the interface (void**) &pUnknown); // Address of output variable that receives the interface pointer requested in riid if ( S_OK != hRC ) { _nOpenResult = OPOS_OR_CREATE; DOTRACE( ( _T("- Failed: Cannot create Service Object (%d/%d)"), *pRC, _nOpenResult ) ); DOTRACEERR( _T(" CoCreateInstance error 0x%X\n %s"), hRC ); return S_OK; } DOTRACE( ( _T(" Created Service Object") ) ); hRC = pUnknown->QueryInterface( IID_IDispatch, // Identifier of the requested interface (void**) &_pService ); // Address of output variable that receives the interface pointer requested in iid pUnknown->Release(); // Done with original pointer. if ( S_OK != hRC ) { _nOpenResult = OPOS_OR_CREATE; DOTRACE( ( _T("- Failed: Cannot get Service Object's Dispatch pointer (%d/%d)"), *pRC, _nOpenResult ) ); DOTRACEERR( _T(" QueryInterface error 0x%X\n %s"), hRC ); return S_OK; } DOTRACE( ( _T(" Acquired Service Object's dispatch pointer") ) ); // Get the dispatch IDs for the methods supported by the Service Object. // Stop when we can't get one or when all are acquired. int nMethodCount = 0; while ( s_SOMethodNames[nMethodCount] != 0 ) { _CWNCC MN( s_SOMethodNames[nMethodCount] ); // Init for conversion. OLECHAR* pMN = MN; // Assign pointer, converting to wide if needed. if ( S_OK != _pService->GetIDsOfNames( IID_NULL, &pMN, 1, LOCALE_SYSTEM_DEFAULT, &_DispIDs[nMethodCount] ) ) { // If failed, do special cases: // - If we failed the newer CloseService, then try Close before failing. if ( nMethodCount == nDICloseService ) pMN = L"Close"; // - If we failed the newer COM-friendly name ClaimDevice or ReleaseDevice, // then try the original name Claim or Release before failing. else if ( nMethodCount == nDIClaimDevice ) pMN = L"Claim"; else if ( nMethodCount == nDIReleaseDevice ) pMN = L"Release"; else // If not special case, break; // stop. if ( S_OK != _pService->GetIDsOfNames( IID_NULL, &pMN, 1, LOCALE_SYSTEM_DEFAULT, &_DispIDs[nMethodCount] ) ) break; // If special case but still not found, stop. } nMethodCount++; } // When debug mode, repeat above trying to get all methods, for later tracing. #ifdef _DEBUG int nAllMethods = nMethodCount; while ( s_SOMethodNames[nAllMethods] != 0 ) { _CWNCC MN( s_SOMethodNames[nAllMethods] ); // Init for conversion. OLECHAR* pMN = MN; // Assign pointer, converting to wide if needed. if ( S_OK != _pService->GetIDsOfNames( IID_NULL, &pMN, 1, LOCALE_SYSTEM_DEFAULT, &_DispIDs[nAllMethods] ) ) { pMN = 0; // If failed, do special cases: // - If we failed the newer CloseService, then try Close before failing. if ( nAllMethods == nDICloseService ) pMN = L"Close"; // - If we failed the newer COM-friendly name ClaimDevice or ReleaseDevice, // then try the original name Claim or Release before failing. else if ( nAllMethods == nDIClaimDevice ) pMN = L"Claim"; else if ( nAllMethods == nDIReleaseDevice ) pMN = L"Release"; else // If not special case, _DispIDs[nAllMethods] = -123; // mark. if ( pMN != 0 && S_OK != _pService->GetIDsOfNames( IID_NULL, &pMN, 1, LOCALE_SYSTEM_DEFAULT, &_DispIDs[nAllMethods] ) ) _DispIDs[nAllMethods] = -123; // If special case but still not found, mark. } nAllMethods++; } #endif // The SO must at least support all of the initial release's methods, // or we won't continue. if ( nMethodCount < s_RequiredMethodsPerRelease[0] ) { _nOpenResult = OPOS_OR_BADIF; _pService->Release(); DOTRACE( ( _T("- Failed: Doesn't support all of initial release's methods (%d/%d)"), *pRC, _nOpenResult ) ); DOTRACEMETHODS( _DispIDs, s_RequiredMethodsPerRelease[0] ); return S_OK; } // Get our own dispatch pointer. // Immediately release it -- saves releasing later, // since it is just another reference to us. IDispatch* pDispatch = 0; CMVERIFY( S_OK == QueryInterface( IID_IDispatch, (void**) &pDispatch ) ); if ( pDispatch != 0 ) pDispatch->Release(); // Now call the Service Object's OpenService method. OposVariant Vars[3]; Vars[2].SetString( _CW(OPOS_CLASSKEY_GATE), hRC ); Vars[1].SetString( _CW(szPhysicalDeviceName), hRC ); Vars[0].SetDispatch_Ptr( pDispatch, hRC ); if ( FAILED(hRC) ) { _pService->Release(); DOTRACEERR( _T("- Failed: Setup for OpenService call 0x%X\n %s"), hRC ); return hRC; } hRC = DoInvoke( DEBUGPARAM("Open-OpenService") S_OK, Vars, 3, nDIOpenService, pRC, false ); // If the OpenService fails, then set result code and return. if ( hRC != S_OK || *pRC != OPOS_SUCCESS ) { // Set the default open result code. _nOpenResult = OPOS_OR_FAILEDOPEN; // If not a COM error, and the SO supports the GetOpenResult method, // then call it to get the open result code. if ( hRC == S_OK ) { // Try to get DispID of the method. OLECHAR* pMN = L"GetOpenResult"; DISPID DispID; if ( S_OK == _pService->GetIDsOfNames( IID_NULL, &pMN, 1, LOCALE_SYSTEM_DEFAULT, &DispID ) ) { // If method exists, set up and call the SO's get property open result method. OposVariantResult VarResult; DISPPARAMS Disp = { NULL, NULL, 0, 0 }; if ( S_OK == _pService->Invoke( DispID, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &Disp, &VarResult, NULL, NULL ) ) { // If method succeeds, convert (if needed) to long and set open result code. HRESULT hRCTmp; VarResult.ChangeLONG( &_nOpenResult, hRCTmp ); } } } // Release the SO and return its OpenService HRESULT. _pService->Release(); DOTRACE( ( _T("- Failed: Service Object's OpenService reported failure (%d/%d)"), *pRC, _nOpenResult ) ); DOTRACEERR( _T(" Invoke error 0x%X\n %s"), hRC ); return hRC; } DOTRACE( ( _T(" Service Object's OpenService succeeded") ) ); // Prepare for events. EventOpen(); // The CO and SO are now open. _bOpened = true; // Trace some service object information, and initialize debug data. #ifdef _DEBUG DOTRACE( ( _T(" <Start> Service Object Properties.") ) ); BSTR bstrSOInfo; GetOposProp( DEBUGPARAM("Open-ServiceObjectDescription") PIDX_ServiceObjectDescription, &bstrSOInfo, 0 ); SysFreeString(bstrSOInfo); GetOposProp( DEBUGPARAM("Open-DeviceDescription") PIDX_DeviceDescription, &bstrSOInfo, 0 ); SysFreeString(bstrSOInfo); GetOposProp( DEBUGPARAM("Open-DeviceName") PIDX_DeviceName, &bstrSOInfo, 0 ); SysFreeString(bstrSOInfo); DOTRACE( ( _T(" <End> Service Object Properties.") ) ); #endif // Now do some versioning support checks... bool bBadSO = false; // - Get the SO's version, and determine the major and minor version. long nSOVersion; GetOposProp( DEBUGPARAM("Open-ServiceObjectVersion") PIDX_ServiceObjectVersion, &nSOVersion, 0 ); _nSOMajor = nSOVersion / 1000000; _nSOMinor = ( nSOVersion / 1000 ) % 1000; // - If major version is not 1, then bad SO. if ( _nSOMajor != 1 ) { _nOpenResult = OPOS_OR_BADVERSION; bBadSO = true; DOTRACE( ( _T("- Failed: Service Object's major version is not 1 (%d/%d)"), OPOS_E_NOSERVICE, _nOpenResult ) ); } // - If SO doesn't support enough methods, then bad SO. else { long nReqMethodIndex = sizeof(s_RequiredMethodsPerRelease)/sizeof(int) - 1; // Shouldn't have SO with release below control's first release, but check anyway. if ( _nSOMinor < MinorReleaseInitial ) nReqMethodIndex = 0; // If SO release is below that supported by this control, use its release's methods. else if ( nReqMethodIndex > _nSOMinor - MinorReleaseInitial ) nReqMethodIndex = _nSOMinor - MinorReleaseInitial; // Set the maximum method index. _nMaxMethod = s_RequiredMethodsPerRelease[ nReqMethodIndex ]; // Ensure that the SO supports the methods that it claims to support. if ( nMethodCount < _nMaxMethod ) { _nOpenResult = OPOS_OR_BADIF; bBadSO = true; DOTRACE( ( _T("- Failed: Doesn't support all of its release's methods (%d/%d)"), OPOS_E_NOSERVICE, _nOpenResult ) ); DOTRACEMETHODS( _DispIDs, _nMaxMethod ); } } // If bad SO, then fail the open. if ( bBadSO ) { Close( pRC ); *pRC = SetRC( OPOS_E_NOSERVICE ); return S_OK; } // If CO OnFreezeEvents(TRUE) method has been called before open then freeze // events in the SO at this time. if ( _nCOFreezeEventCount ) SetCOFreezeEvents( TRUE ); // Everything went okay, so return success. SetRC(); *pRC = OPOS_SUCCESS; _nOpenResult = OPOS_SUCCESS; DOTRACE( ( _T("- Success (0/0)") ) ); return S_OK; } //=========================================================================== STDMETHODIMP COPOSGate::Close( long *pRC ) { SetRC(); // If not opened, set return code. if ( ! _bOpened ) { *pRC = OPOS_E_CLOSED; DOTRACE( ( _T("*Close [Function] RC=%d"), *pRC ) ); return S_OK; } // Events are no longer legal. EventPreClose(); // Call down into Service Object to close the control. HRESULT hRC = DoInvoke( DEBUGPARAM("Close-CloseService") S_OK, NULL, 0, nDICloseService, pRC, false ); // Release the connection to the Service Object. _pService->Release(); // Close down events. EventClose(); // We are now closed. _bOpened = false; DOTRACE( ( _T("*Close [Function] RC=%d"), *pRC ) ); return hRC; } ///////////////////////////////////////////////////////////////////////////// // Claim, Release ///////////////////////////////////////////////////////////////////////////// STDMETHODIMP COPOSGate::ClaimDevice( long Timeout, long *pRC ) { SetRC(); // If not opened, set return code. if ( ! _bOpened ) { *pRC = OPOS_E_CLOSED; DOTRACEV( ( _T("*ClaimDevice [Function] -- Closed") ) ); return S_OK; } // Call down into the Service Object to execute this method. OposVariant Var; Var.SetLONG( Timeout ); return DoInvoke( DEBUGPARAM("ClaimDevice") S_OK, &Var, 1, nDIClaimDevice, pRC, false ); } //=========================================================================== STDMETHODIMP COPOSGate::ReleaseDevice( long *pRC ) { SetRC(); // If not opened, set return code. if ( ! _bOpened ) { *pRC = OPOS_E_CLOSED; DOTRACEV( ( _T("*ReleaseDevice [Function] -- Closed") ) ); return S_OK; } // Call down into the Service Object to execute this method. return DoInvoke( DEBUGPARAM("ReleaseDevice") S_OK, NULL, 0, nDIReleaseDevice, pRC, false ); } ///////////////////////////////////////////////////////////////////////////// // SOProcessID ///////////////////////////////////////////////////////////////////////////// STDMETHODIMP COPOSGate::SOProcessID( long *pProcessID ) { *pProcessID = GetCurrentProcessId(); DOTRACEV( ( _T("*SOProcessID: 0x%X"), *pProcessID ) ); return S_OK; } ///////////////////////////////////////////////////////////////////////////// // The other methods. ///////////////////////////////////////////////////////////////////////////// //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!! Release 1.12 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! STDMETHODIMP COPOSGate::CheckHealth( /*[in]*/ LONG Level, /*[out, retval]*/ long* pRC ) { OposVariant Var; Var.SetLONG( Level ); return DoInvoke( DEBUGPARAM("CheckHealth") S_OK, &Var, 1, nDICheckHealth, pRC ); } //=========================================================================== STDMETHODIMP COPOSGate::DirectIO( /*[in]*/ LONG Command, /*[in, out]*/ LONG* pData, /*[in, out]*/ BSTR* pString, /*[out, retval]*/ long* pRC ) { OposVariant Vars[3]; HRESULT hRC = S_OK; Vars[2].SetLONG( Command ); Vars[1].SetLONG_Ptr( pData, hRC ); Vars[0].SetBSTR_InOutPtr( pString, hRC ); return DoInvoke( DEBUGPARAM("DirectIO") hRC, Vars, 3, nDIDirectIO, pRC ); } //=========================================================================== STDMETHODIMP COPOSGate::ResetStatistics( /*[in]*/ BSTR StatisticsBuffer, /*[out, retval]*/ long* pRC ) { OposVariant Var; HRESULT hRC = S_OK; Var.SetBSTR( StatisticsBuffer, hRC ); return DoInvoke( DEBUGPARAM("ResetStatistics") hRC, &Var, 1, nDIResetStatistics, pRC ); } //=========================================================================== STDMETHODIMP COPOSGate::RetrieveStatistics( /*[in, out]*/ BSTR* pStatisticsBuffer, /*[out, retval]*/ long* pRC ) { OposVariant Var; HRESULT hRC = S_OK; Var.SetBSTR_InOutPtr( pStatisticsBuffer, hRC ); return DoInvoke( DEBUGPARAM("RetrieveStatistics") hRC, &Var, 1, nDIRetrieveStatistics, pRC ); } //=========================================================================== STDMETHODIMP COPOSGate::UpdateStatistics( /*[in]*/ BSTR StatisticsBuffer, /*[out, retval]*/ long* pRC ) { OposVariant Var; HRESULT hRC = S_OK; Var.SetBSTR( StatisticsBuffer, hRC ); return DoInvoke( DEBUGPARAM("UpdateStatistics") hRC, &Var, 1, nDIUpdateStatistics, pRC ); } //=========================================================================== STDMETHODIMP COPOSGate::CompareFirmwareVersion( /*[in]*/ BSTR FirmwareFileName, /*[out]*/ LONG* pResult, /*[out, retval]*/ long* pRC ) { OposVariant Vars[2]; HRESULT hRC = S_OK; Vars[1].SetBSTR( FirmwareFileName, hRC ); Vars[0].SetLONG_Ptr( pResult, hRC ); return DoInvoke( DEBUGPARAM("CompareFirmwareVersion") hRC, Vars, 2, nDICompareFirmwareVersion, pRC ); } //=========================================================================== STDMETHODIMP COPOSGate::UpdateFirmware( /*[in]*/ BSTR FirmwareFileName, /*[out, retval]*/ long* pRC ) { OposVariant Var; HRESULT hRC = S_OK; Var.SetBSTR( FirmwareFileName, hRC ); return DoInvoke( DEBUGPARAM("UpdateFirmware") hRC, &Var, 1, nDIUpdateFirmware, pRC ); } //=========================================================================== STDMETHODIMP COPOSGate::OpenGate( /*[out, retval]*/ long* pRC ) { return DoInvoke( DEBUGPARAM("OpenGate") S_OK, NULL, 0, nDIOpenGate, pRC ); } //=========================================================================== STDMETHODIMP COPOSGate::WaitForGateClose( /*[in]*/ LONG Timeout, /*[out, retval]*/ long* pRC ) { OposVariant Var; Var.SetLONG( Timeout ); return DoInvoke( DEBUGPARAM("WaitForGateClose") S_OK, &Var, 1, nDIWaitForGateClose, pRC ); } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // // Properties // ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // FreezeEvents // ResultCode // State // ControlObjectDescription // ControlObjectVersion // OpenResult ///////////////////////////////////////////////////////////////////////////// STDMETHODIMP COPOSGate::get_FreezeEvents( VARIANT_BOOL *pFreezeEvents ) { return GetOposProp( DEBUGPARAM("FreezeEvents") PIDX_FreezeEvents, pFreezeEvents ); } //=========================================================================== STDMETHODIMP COPOSGate::put_FreezeEvents( VARIANT_BOOL FreezeEvents ) { SetRC(); // If not opened, do nothing. if ( ! _bOpened ) { DOTRACEV( ( _T("*FreezeEvents [Set] -- Closed") ) ); return S_OK; } if ( FreezeEvents ) { // Call down into the Service Object first to set the property value. SetOposProp( DEBUGPARAM("FreezeEvents") PIDX_FreezeEvents, FreezeEvents ); // First tell the SO the new state. _bFreezeState = true; // Then update ours. } else { // Update our state first, then tell the SO. // This avoids a lockup in the event firing object's DoEvent() routine // that would occur if the SO calls an event from its property update method. _bFreezeState = false; SetOposProp( DEBUGPARAM("FreezeEvents") PIDX_FreezeEvents, FreezeEvents ); } return S_OK; } //=========================================================================== STDMETHODIMP COPOSGate::get_ResultCode( long *pResultCode ) { if ( ! _bOpened ) // If not open, { *pResultCode = OPOS_E_CLOSED; // then return "closed". DOTRACEV( ( _T("*ResultCode [Get] -- Closed") ) ); } else if ( _nCOResultCode != -1 ) // If the control object has to report a status, { *pResultCode = _nCOResultCode; // then return it. DOTRACEV( ( _T("*ResultCode [Get]: %d -- from CO"), _nCOResultCode ) ); } else GetOposProp( DEBUGPARAM("ResultCode") PIDX_ResultCode, pResultCode );// Otherwise go to SO. return S_OK; } //=========================================================================== STDMETHODIMP COPOSGate::get_State( long *pState ) { if ( ! _bOpened ) // If not open, { *pState = OPOS_S_CLOSED; // then return "closed". DOTRACEV( ( _T("*State [Get] -- Closed") ) ); } else GetOposProp( DEBUGPARAM("State") PIDX_State, pState ); // Otherwise go to SO. return S_OK; } //=========================================================================== STDMETHODIMP COPOSGate::get_ControlObjectDescription( BSTR *pControlObjectDescription ) { *pControlObjectDescription = ::SysAllocString( _CW(g_ControlDescription) ); DOTRACEV( ( _T("*ControlObjectDescription [Get]: <%hs>"), g_ControlDescription ) ); return S_OK; } //=========================================================================== STDMETHODIMP COPOSGate::get_ControlObjectVersion( long *pControlObjectVersion ) { *pControlObjectVersion = g_ControlVersion; DOTRACEV( ( _T("*ControlObjectVersion [Get]: %d"), g_ControlVersion ) ); return S_OK; } //=========================================================================== STDMETHODIMP COPOSGate::get_OpenResult( long *pOpenResult ) { *pOpenResult = _nOpenResult; DOTRACEV( ( _T("*OpenResult [Get]: %d"), _nOpenResult ) ); return S_OK; } ///////////////////////////////////////////////////////////////////////////// // The other properties. ///////////////////////////////////////////////////////////////////////////// //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!!! Release 1.12 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! STDMETHODIMP COPOSGate::get_BinaryConversion( /*[out, retval]*/ LONG* pBinaryConversion ) { return GetOposProp( DEBUGPARAM("BinaryConversion") PIDX_BinaryConversion, pBinaryConversion, 12 /*MinorVersion*/ ); } //--------------------------------------------------------------------------- STDMETHODIMP COPOSGate::put_BinaryConversion( /*[in]*/ LONG BinaryConversion ) { IFDEBUG( _nBinaryConversion = BinaryConversion); return SetOposProp( DEBUGPARAM("BinaryConversion") PIDX_BinaryConversion, BinaryConversion, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_CapPowerReporting( /*[out, retval]*/ LONG* pCapPowerReporting ) { return GetOposProp( DEBUGPARAM("CapPowerReporting") PIDX_CapPowerReporting, pCapPowerReporting, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_CheckHealthText( /*[out, retval]*/ BSTR* pCheckHealthText ) { return GetOposProp( DEBUGPARAM("CheckHealthText") PIDX_CheckHealthText, pCheckHealthText, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_Claimed( /*[out, retval]*/ VARIANT_BOOL* pClaimed ) { return GetOposProp( DEBUGPARAM("Claimed") PIDX_Claimed, pClaimed, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_DeviceEnabled( /*[out, retval]*/ VARIANT_BOOL* pDeviceEnabled ) { return GetOposProp( DEBUGPARAM("DeviceEnabled") PIDX_DeviceEnabled, pDeviceEnabled, 12 /*MinorVersion*/ ); } //--------------------------------------------------------------------------- STDMETHODIMP COPOSGate::put_DeviceEnabled( /*[in]*/ VARIANT_BOOL DeviceEnabled ) { return SetOposProp( DEBUGPARAM("DeviceEnabled") PIDX_DeviceEnabled, DeviceEnabled, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_PowerNotify( /*[out, retval]*/ LONG* pPowerNotify ) { return GetOposProp( DEBUGPARAM("PowerNotify") PIDX_PowerNotify, pPowerNotify, 12 /*MinorVersion*/ ); } //--------------------------------------------------------------------------- STDMETHODIMP COPOSGate::put_PowerNotify( /*[in]*/ LONG PowerNotify ) { return SetOposProp( DEBUGPARAM("PowerNotify") PIDX_PowerNotify, PowerNotify, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_PowerState( /*[out, retval]*/ LONG* pPowerState ) { return GetOposProp( DEBUGPARAM("PowerState") PIDX_PowerState, pPowerState, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_ResultCodeExtended( /*[out, retval]*/ LONG* pResultCodeExtended ) { return GetOposProp( DEBUGPARAM("ResultCodeExtended") PIDX_ResultCodeExtended, pResultCodeExtended, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_ServiceObjectDescription( /*[out, retval]*/ BSTR* pServiceObjectDescription ) { return GetOposProp( DEBUGPARAM("ServiceObjectDescription") PIDX_ServiceObjectDescription, pServiceObjectDescription, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_ServiceObjectVersion( /*[out, retval]*/ LONG* pServiceObjectVersion ) { return GetOposProp( DEBUGPARAM("ServiceObjectVersion") PIDX_ServiceObjectVersion, pServiceObjectVersion, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_DeviceDescription( /*[out, retval]*/ BSTR* pDeviceDescription ) { return GetOposProp( DEBUGPARAM("DeviceDescription") PIDX_DeviceDescription, pDeviceDescription, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_DeviceName( /*[out, retval]*/ BSTR* pDeviceName ) { return GetOposProp( DEBUGPARAM("DeviceName") PIDX_DeviceName, pDeviceName, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_CapStatisticsReporting( /*[out, retval]*/ VARIANT_BOOL* pCapStatisticsReporting ) { return GetOposProp( DEBUGPARAM("CapStatisticsReporting") PIDX_CapStatisticsReporting, pCapStatisticsReporting, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_CapUpdateStatistics( /*[out, retval]*/ VARIANT_BOOL* pCapUpdateStatistics ) { return GetOposProp( DEBUGPARAM("CapUpdateStatistics") PIDX_CapUpdateStatistics, pCapUpdateStatistics, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_CapCompareFirmwareVersion( /*[out, retval]*/ VARIANT_BOOL* pCapCompareFirmwareVersion ) { return GetOposProp( DEBUGPARAM("CapCompareFirmwareVersion") PIDX_CapCompareFirmwareVersion, pCapCompareFirmwareVersion, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_CapUpdateFirmware( /*[out, retval]*/ VARIANT_BOOL* pCapUpdateFirmware ) { return GetOposProp( DEBUGPARAM("CapUpdateFirmware") PIDX_CapUpdateFirmware, pCapUpdateFirmware, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_CapGateStatus( /*[out, retval]*/ VARIANT_BOOL* pCapGateStatus ) { return GetOposProp( DEBUGPARAM("CapGateStatus") PIDXGate_CapGateStatus, pCapGateStatus, 12 /*MinorVersion*/ ); } //=========================================================================== STDMETHODIMP COPOSGate::get_GateStatus( /*[out, retval]*/ LONG* pGateStatus ) { return GetOposProp( DEBUGPARAM("GateStatus") PIDXGate_GateStatus, pGateStatus, 12 /*MinorVersion*/ ); } ///////////////////////////////////////////////////////////////////////////// // Debug build tracing support. ///////////////////////////////////////////////////////////////////////////// #ifdef _DEBUG #include <stdio.h> #include <tchar.h> #include <stdarg.h> //=========================================================================== // Simple built-in tracing to a file... #ifdef _FILETRACE void COPOSGate::WriteTrace( LPCTSTR pFormat, ... ) { static TCHAR s_TraceFile[] = _T("C:\\OposCCO_Gate.log"); static BOOL s_bFirst = TRUE; if (s_bFirst) { ::DeleteFile(s_TraceFile); s_bFirst = FALSE; } FILE* fTrace = _tfopen( s_TraceFile, _T("a") ); if (fTrace) { va_list marker; va_start(marker, pFormat); _vftprintf( fTrace, pFormat, marker ); putc( '\n', fTrace ); fclose(fTrace); } } //=========================================================================== // Higher performance tracing using RCS trace software... #else #define OPOSCCOCLASS COPOSGate #define RCSTRACENAME "OposCCO_Gate" #include "UseRCSTrace.h" #endif //=========================================================================== // Trace support functions... //## If error value is non-zero, convert to message and display. void COPOSGate::WriteTraceError( LPCTSTR pFormat, DWORD dwError ) { if ( dwError != 0 ) { // Convert HRESULT to message and display. LPTSTR pMsgBuf; DWORD dwChars = ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &pMsgBuf, 0, NULL ); if ( dwChars == 0 ) pMsgBuf = _T("[Unknown]"); else if ( pMsgBuf[dwChars-1] == '\n' ) pMsgBuf[dwChars-1] = '\0'; WriteTrace( pFormat, dwError, pMsgBuf ); if ( dwChars > 0 ) ::LocalFree(pMsgBuf); } } //## Output methods that are not implemented in Service Object. void COPOSGate::WriteTraceMethods( DISPID* pDispID, int nMethods ) { for ( int i = 0; i < nMethods; i++, pDispID++ ) if ( *pDispID == -123 ) WriteTrace( _T(" %hs"), s_SOMethodNames[i] ); } //## Output string. void COPOSGate::WriteTraceString( LPCTSTR pszPrefix, BSTR bstr ) { // Get string length. int nLen = ::SysStringLen(bstr); // If empty... if ( nLen == 0 ) DOTRACEV( ( _T("%s Length 0 <>"), pszPrefix ) ); // If not empty... else { // Check the BString for non-ascii characters, and output the string. int i; for ( i = 0; i < nLen; i++ ) if ( bstr[i] < 0x20 || 0x7F < bstr[i] ) break; WriteTraceString( bstr, nLen * 2, i == nLen, 2 /*wide string*/, _T("%s Length %u"), pszPrefix, nLen ); // If binary conversion in effect... if ( _nBinaryConversion != OPOS_BC_NONE ) { #define LONIBBLE(x) ((x) & 0x0F) #define HINIBBLE(x) ((x) & 0xF0) OLECHAR* pSource = bstr; // Get source pointer. LPBYTE pDest = new BYTE[ ( nLen + 1 ) / 2 + 1 ];// Create destination buffer. int nDestLen = nLen; i = 0; // If decimal binary conversion... if ( _nBinaryConversion == OPOS_BC_DECIMAL && nDestLen % 3 == 0 ) { nDestLen /= 3; // Bytes to create. for ( ; i < nDestLen; i++ ) // Loop through all data. { // if ( !isdigit(pSource[0]) || !isdigit(pSource[1]) || !isdigit(pSource[2]) ) break; pDest[i] = (BYTE) // - Set destination character to ( ( LONIBBLE(pSource[0]) * 10 + // Hundreds digit * 100 + LONIBBLE(pSource[1]) // Tens digit * 10 + ) * 10 + // LONIBBLE(pSource[2]) ); // Units digit. pSource += 3; // - Move on to next source pair. } } // If nibble binary conversion... else if ( nDestLen % 2 == 0 ) { nDestLen /= 2; // Bytes to create. for ( ; i < nDestLen; i++ ) // Loop through all data. { // if ( HINIBBLE(pSource[0]) != 0x30 || HINIBBLE(pSource[1]) != 0x30 ) break; pDest[i] = (BYTE) // - Set destination character to ( ( LONIBBLE(pSource[0]) << 4 ) | // first char's bits 3-0 as bits 7-4 ORed with LONIBBLE(pSource[1]) ); // second char's bits 3-0 as bits 3-0. pSource += 2; // - Move on to next source pair. } } // If was a valid binary converted string... if ( i == nDestLen ) { pDest[i] = '\0'; // End the string with a NUL. // Check the converted buffer for non-ascii characters, and output the string. for ( i = 0; i < nDestLen; i++ ) if ( pDest[i] < 0x20 || 0x7F < pDest[i] ) break; WriteTraceString( pDest, nDestLen, i == nDestLen, 1 /*narrow string*/, _T("%s Length %u [BinConv]"), pszPrefix, nLen ); } delete [] pDest; // Delete the destination buffer. } } } //## Output string helper. #define WTS_LINELEN_MAX 50 void COPOSGate::WriteTraceString( void* pString, int nLen, BOOL bAscii, int nCharSize, LPCTSTR pszFormat, ... ) { TCHAR szBuffer[100+10]; LPCTSTR pszPrintfString = ( nCharSize == 1 ? _T("hs") : _T("ls") ); // Use the "list of arguments" version of printf. va_list va; va_start( va, pszFormat ); _vsntprintf( szBuffer, 100, pszFormat, va ); va_end(va); NULTERMINATE(szBuffer); // If all ascii, then output. if (bAscii) { // If less or equal to the maximum length we put out per line, then output on single line. if ( nLen <= WTS_LINELEN_MAX * nCharSize ) { _tcscat( szBuffer, _T(" <%") ); _tcscat( szBuffer, pszPrintfString ); _tcscat( szBuffer, _T(">") ); DOTRACEV( ( szBuffer, pString ) ); } // If greater than maximum line length, then break into multiple lines. else { DOTRACEV( ( szBuffer, pString ) ); _sntprintf( szBuffer, TSIZEOF(szBuffer), _T(" <%%.%u%s>"), WTS_LINELEN_MAX, pszPrintfString ); NULTERMINATE(szBuffer); for ( int i = 0; i < nLen; i += WTS_LINELEN_MAX * nCharSize ) DOTRACEV( ( szBuffer, (LPBYTE) pString + i ) ); } } // If non-ascii data, then output. else { DOTRACEV( ( _T("%s [Contains non-ASCII]"), szBuffer ) ); DODUMPV( pString, nLen ); } } #endif // End GateImpl.cpp
#include <iostream> #include <vector> #include <unordered_set> using namespace std; // solution 1 class Solution{ public: int repeatedNTimes(vector<int>& A){ unordered_set<int> A_set; int N = 0; for (int i = 0; i < A.size(); ++i){ A_set.insert(A[i]); ++N; if (N > A_set.size()){ N = i; break; } } return A[N]; } }; // solution 2 class Solution{ public: int repeatedNTimes(vector<int>& A){ unordered_set<int> A_set; for (int i = 0; i < A.size(); ++i){ int N = A_set.size(); A_set.insert(A[i]); if (N == A_set.size()){ break; } } return A[A_set.size()]; } }; // solution 3 class Solution{ public: int repeatedNTimes(vector<int>& A){ unordered_set<int> A_set; for (int i = 0; i <= int(A.size()/2); ++i){ A_set.insert(A[i]); if (i == A_set.size()){ return A[i]; } } return A[int(A.size()/2)+1]; } }; int main(){ // vector<int> A = {1, 2, 3, 3}; // vector<int> A = {5,1,5,2,5,3,5,4}; vector<int> A = {8, 3, 2, 3}; Solution sol; auto rEle = sol.repeatedNTimes(A); cout << rEle << endl; cin.get(); }
/* Copyright 2021 Aristocratos (jakob@qvantnet.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. indent = tab tab-size = 4 */ #include <csignal> #include <clocale> #include <pthread.h> #ifdef __FreeBSD__ #include <pthread_np.h> #endif #include <thread> #include <numeric> #include <ranges> #include <unistd.h> #include <cmath> #include <iostream> #include <exception> #include <tuple> #include <regex> #include <chrono> #ifdef __APPLE__ #include <CoreFoundation/CoreFoundation.h> #endif #include <btop_shared.hpp> #include <btop_tools.hpp> #include <btop_config.hpp> #include <btop_input.hpp> #include <btop_theme.hpp> #include <btop_draw.hpp> #include <btop_menu.hpp> using std::string, std::string_view, std::vector, std::atomic, std::endl, std::cout, std::min, std::flush, std::endl; using std::string_literals::operator""s, std::to_string; namespace fs = std::filesystem; namespace rng = std::ranges; using namespace Tools; using namespace std::chrono_literals; namespace Global { const vector<array<string, 2>> Banner_src = { {"#E62525", "██████╗ ████████╗ ██████╗ ██████╗"}, {"#CD2121", "██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗ ██╗ ██╗"}, {"#B31D1D", "██████╔╝ ██║ ██║ ██║██████╔╝ ██████╗██████╗"}, {"#9A1919", "██╔══██╗ ██║ ██║ ██║██╔═══╝ ╚═██╔═╝╚═██╔═╝"}, {"#801414", "██████╔╝ ██║ ╚██████╔╝██║ ╚═╝ ╚═╝"}, {"#000000", "╚═════╝ ╚═╝ ╚═════╝ ╚═╝"}, }; const string Version = "1.2.7"; int coreCount; string overlay; string clock; string bg_black = "\x1b[0;40m"; string fg_white = "\x1b[1;97m"; string fg_green = "\x1b[1;92m"; string fg_red = "\x1b[0;91m"; uid_t real_uid, set_uid; fs::path self_path; string exit_error_msg; atomic<bool> thread_exception (false); bool debuginit = false; bool debug = false; bool utf_force = false; uint64_t start_time; atomic<bool> resized (false); atomic<bool> quitting (false); atomic<bool> should_quit (false); atomic<bool> should_sleep (false); atomic<bool> _runner_started (false); bool arg_tty = false; bool arg_low_color = false; int arg_preset = -1; } //* A simple argument parser void argumentParser(const int& argc, char **argv) { for(int i = 1; i < argc; i++) { const string argument = argv[i]; if (is_in(argument, "-h", "--help")) { cout << "usage: btop [-h] [-v] [-/+t] [-p <id>] [--utf-force] [--debug]\n\n" << "optional arguments:\n" << " -h, --help show this help message and exit\n" << " -v, --version show version info and exit\n" << " -lc, --low-color disable truecolor, converts 24-bit colors to 256-color\n" << " -t, --tty_on force (ON) tty mode, max 16 colors and tty friendly graph symbols\n" << " +t, --tty_off force (OFF) tty mode\n" << " -p, --preset <id> start with preset, integer value between 0-9\n" << " --utf-force force start even if no UTF-8 locale was detected\n" << " --debug start in DEBUG mode: shows microsecond timer for information collect\n" << " and screen draw functions and sets loglevel to DEBUG\n" << endl; exit(0); } else if (is_in(argument, "-v", "--version")) { cout << "btop version: " << Global::Version << endl; exit(0); } else if (is_in(argument, "-lc", "--low-color")) { Global::arg_low_color = true; } else if (is_in(argument, "-t", "--tty_on")) { Config::set("tty_mode", true); Global::arg_tty = true; } else if (is_in(argument, "+t", "--tty_off")) { Config::set("tty_mode", false); Global::arg_tty = true; } else if (is_in(argument, "-p", "--preset")) { if (++i >= argc) { cout << "ERROR: Preset option needs an argument." << endl; exit(1); } else if (const string val = argv[i]; isint(val) and val.size() == 1) { Global::arg_preset = std::clamp(stoi(val), 0, 9); } else { cout << "ERROR: Preset option only accepts an integer value between 0-9." << endl; exit(1); } } else if (argument == "--utf-force") Global::utf_force = true; else if (argument == "--debug") Global::debug = true; else { cout << " Unknown argument: " << argument << "\n" << " Use -h or --help for help." << endl; exit(1); } } } //* Handler for SIGWINCH and general resizing events, does nothing if terminal hasn't been resized unless force=true void term_resize(bool force) { static atomic<bool> resizing (false); if (Input::polling) { Global::resized = true; Input::interrupt = true; return; } atomic_lock lck(resizing, true); if (auto refreshed = Term::refresh(true); refreshed or force) { if (force and refreshed) force = false; } else return; static const array<string, 4> all_boxes = {"cpu", "mem", "net", "proc"}; Global::resized = true; if (Runner::active) Runner::stop(); Term::refresh(); Config::unlock(); auto boxes = Config::getS("shown_boxes"); auto min_size = Term::get_min_size(boxes); while (not force or (Term::width < min_size.at(0) or Term::height < min_size.at(1))) { sleep_ms(100); if (Term::width < min_size.at(0) or Term::height < min_size.at(1)) { cout << Term::clear << Global::bg_black << Global::fg_white << Mv::to((Term::height / 2) - 2, (Term::width / 2) - 11) << "Terminal size too small:" << Mv::to((Term::height / 2) - 1, (Term::width / 2) - 10) << " Width = " << (Term::width < min_size.at(1) ? Global::fg_red : Global::fg_green) << Term::width << Global::fg_white << " Height = " << (Term::height < min_size.at(0) ? Global::fg_red : Global::fg_green) << Term::height << Mv::to((Term::height / 2) + 1, (Term::width / 2) - 12) << Global::fg_white << "Needed for current config:" << Mv::to((Term::height / 2) + 2, (Term::width / 2) - 10) << "Width = " << min_size.at(0) << " Height = " << min_size.at(1) << flush; bool got_key = false; for (; not Term::refresh() and not got_key; got_key = Input::poll(10)); if (got_key) { auto key = Input::get(); if (key == "q") clean_quit(0); else if (is_in(key, "1", "2", "3", "4")) { Config::current_preset = -1; Config::toggle_box(all_boxes.at(std::stoi(key) - 1)); boxes = Config::getS("shown_boxes"); } } min_size = Term::get_min_size(boxes); } else if (not Term::refresh()) break; } Input::interrupt = true; } //* Exit handler; stops threads, restores terminal and saves config changes void clean_quit(int sig) { if (Global::quitting) return; Global::quitting = true; Runner::stop(); if (Global::_runner_started) { #ifdef __APPLE__ if (pthread_join(Runner::runner_id, NULL) != 0) { Logger::warning("Failed to join _runner thread on exit!"); pthread_cancel(Runner::runner_id); } #else struct timespec ts; ts.tv_sec = 5; if (pthread_timedjoin_np(Runner::runner_id, NULL, &ts) != 0) { Logger::warning("Failed to join _runner thread on exit!"); pthread_cancel(Runner::runner_id); } #endif } Config::write(); if (Term::initialized) { Input::clear(); Term::restore(); } if (not Global::exit_error_msg.empty()) { sig = 1; Logger::error(Global::exit_error_msg); std::cerr << Global::fg_red << "ERROR: " << Global::fg_white << Global::exit_error_msg << Fx::reset << endl; } Logger::info("Quitting! Runtime: " + sec_to_dhms(time_s() - Global::start_time)); const auto excode = (sig != -1 ? sig : 0); #ifdef __APPLE__ _Exit(excode); #else quick_exit(excode); #endif } //* Handler for SIGTSTP; stops threads, restores terminal and sends SIGSTOP void _sleep() { Runner::stop(); Term::restore(); std::raise(SIGSTOP); } //* Handler for SIGCONT; re-initialize terminal and force a resize event void _resume() { Term::init(); term_resize(true); } void _exit_handler() { clean_quit(-1); } void _signal_handler(const int sig) { switch (sig) { case SIGINT: if (Runner::active) { Global::should_quit = true; Runner::stopping = true; Input::interrupt = true; } else { clean_quit(0); } break; case SIGTSTP: if (Runner::active) { Global::should_sleep = true; Runner::stopping = true; Input::interrupt = true; } else { _sleep(); } break; case SIGCONT: _resume(); break; case SIGWINCH: term_resize(); break; } } //* Manages secondary thread for collection and drawing of boxes namespace Runner { atomic<bool> active (false); atomic<bool> stopping (false); atomic<bool> waiting (false); atomic<bool> redraw (false); //* Setup semaphore for triggering thread to do work #if __GNUC__ < 11 #include <semaphore.h> sem_t do_work; inline void thread_sem_init() { sem_init(&do_work, 0, 0); } inline void thread_wait() { sem_wait(&do_work); } inline void thread_trigger() { sem_post(&do_work); } #else #include <semaphore> std::binary_semaphore do_work(0); inline void thread_sem_init() { ; } inline void thread_wait() { do_work.acquire(); } inline void thread_trigger() { do_work.release(); } #endif //* RAII wrapper for pthread_mutex locking class thread_lock { pthread_mutex_t& pt_mutex; public: int status; thread_lock(pthread_mutex_t& mtx) : pt_mutex(mtx) { pthread_mutex_init(&pt_mutex, NULL); status = pthread_mutex_lock(&pt_mutex); } ~thread_lock() { if (status == 0) pthread_mutex_unlock(&pt_mutex); } }; //* Wrapper for raising priviliges when using SUID bit class gain_priv { int status = -1; public: gain_priv() { if (Global::real_uid != Global::set_uid) this->status = seteuid(Global::set_uid); } ~gain_priv() { if (status == 0) status = seteuid(Global::real_uid); } }; string output; string empty_bg; bool pause_output = false; sigset_t mask; pthread_t runner_id; pthread_mutex_t mtx; enum debug_actions { collect_begin, draw_begin, draw_done }; enum debug_array { collect, draw }; string debug_bg; unordered_flat_map<string, array<uint64_t, 2>> debug_times; struct runner_conf { vector<string> boxes; bool no_update; bool force_redraw; bool background_update; string overlay; string clock; }; struct runner_conf current_conf; void debug_timer(const char* name, const int action) { switch (action) { case collect_begin: debug_times[name].at(collect) = time_micros(); return; case draw_begin: debug_times[name].at(draw) = time_micros(); debug_times[name].at(collect) = debug_times[name].at(draw) - debug_times[name].at(collect); debug_times["total"].at(collect) += debug_times[name].at(collect); return; case draw_done: debug_times[name].at(draw) = time_micros() - debug_times[name].at(draw); debug_times["total"].at(draw) += debug_times[name].at(draw); return; } } //? ------------------------------- Secondary thread: async launcher and drawing ---------------------------------- void * _runner(void * _) { (void)_; //? Block some signals in this thread to avoid deadlock from any signal handlers trying to stop this thread sigemptyset(&mask); // sigaddset(&mask, SIGINT); // sigaddset(&mask, SIGTSTP); sigaddset(&mask, SIGWINCH); sigaddset(&mask, SIGTERM); pthread_sigmask(SIG_BLOCK, &mask, NULL); //? pthread_mutex_lock to lock thread and monitor health from main thread thread_lock pt_lck(mtx); if (pt_lck.status != 0) { Global::exit_error_msg = "Exception in runner thread -> pthread_mutex_lock error id: " + to_string(pt_lck.status); Global::thread_exception = true; Input::interrupt = true; stopping = true; } //* ----------------------------------------------- THREAD LOOP ----------------------------------------------- while (not Global::quitting) { thread_wait(); atomic_wait_for(active, true, 5000); if (active) { Global::exit_error_msg = "Runner thread failed to get active lock!"; Global::thread_exception = true; Input::interrupt = true; stopping = true; } if (stopping or Global::resized) { sleep_ms(1); continue; } //? Atomic lock used for blocking non thread-safe actions in main thread atomic_lock lck(active); //? Set effective user if SUID bit is set gain_priv powers{}; auto& conf = current_conf; //! DEBUG stats if (Global::debug) { if (debug_bg.empty() or redraw) Runner::debug_bg = Draw::createBox(2, 2, 32, 8, "", true, "debug"); debug_times.clear(); debug_times["total"] = {0, 0}; } output.clear(); //* Run collection and draw functions for all boxes try { //? CPU if (v_contains(conf.boxes, "cpu")) { try { if (Global::debug) debug_timer("cpu", collect_begin); //? Start collect auto cpu = Cpu::collect(conf.no_update); if (Global::debug) debug_timer("cpu", draw_begin); //? Draw box if (not pause_output) output += Cpu::draw(cpu, conf.force_redraw, conf.no_update); if (Global::debug) debug_timer("cpu", draw_done); } catch (const std::exception& e) { throw std::runtime_error("Cpu:: -> " + (string)e.what()); } } //? MEM if (v_contains(conf.boxes, "mem")) { try { if (Global::debug) debug_timer("mem", collect_begin); //? Start collect auto mem = Mem::collect(conf.no_update); if (Global::debug) debug_timer("mem", draw_begin); //? Draw box if (not pause_output) output += Mem::draw(mem, conf.force_redraw, conf.no_update); if (Global::debug) debug_timer("mem", draw_done); } catch (const std::exception& e) { throw std::runtime_error("Mem:: -> " + (string)e.what()); } } //? NET if (v_contains(conf.boxes, "net")) { try { if (Global::debug) debug_timer("net", collect_begin); //? Start collect auto net = Net::collect(conf.no_update); if (Global::debug) debug_timer("net", draw_begin); //? Draw box if (not pause_output) output += Net::draw(net, conf.force_redraw, conf.no_update); if (Global::debug) debug_timer("net", draw_done); } catch (const std::exception& e) { throw std::runtime_error("Net:: -> " + (string)e.what()); } } //? PROC if (v_contains(conf.boxes, "proc")) { try { if (Global::debug) debug_timer("proc", collect_begin); //? Start collect auto proc = Proc::collect(conf.no_update); if (Global::debug) debug_timer("proc", draw_begin); //? Draw box if (not pause_output) output += Proc::draw(proc, conf.force_redraw, conf.no_update); if (Global::debug) debug_timer("proc", draw_done); } catch (const std::exception& e) { throw std::runtime_error("Proc:: -> " + (string)e.what()); } } } catch (const std::exception& e) { Global::exit_error_msg = "Exception in runner thread -> " + (string)e.what(); Global::thread_exception = true; Input::interrupt = true; stopping = true; } if (stopping) { continue; } if (redraw or conf.force_redraw) { empty_bg.clear(); redraw = false; } if (not pause_output) output += conf.clock; if (not conf.overlay.empty() and not conf.background_update) pause_output = true; if (output.empty() and not pause_output) { if (empty_bg.empty()) { const int x = Term::width / 2 - 10, y = Term::height / 2 - 10; output += Term::clear; empty_bg += Draw::banner_gen(y, 0, true) + Mv::to(y+6, x) + Theme::c("title") + Fx::b + "No boxes shown!" + Mv::to(y+8, x) + Theme::c("hi_fg") + "1" + Theme::c("main_fg") + " | Show CPU box" + Mv::to(y+9, x) + Theme::c("hi_fg") + "2" + Theme::c("main_fg") + " | Show MEM box" + Mv::to(y+10, x) + Theme::c("hi_fg") + "3" + Theme::c("main_fg") + " | Show NET box" + Mv::to(y+11, x) + Theme::c("hi_fg") + "4" + Theme::c("main_fg") + " | Show PROC box" + Mv::to(y+12, x-2) + Theme::c("hi_fg") + "esc" + Theme::c("main_fg") + " | Show menu" + Mv::to(y+13, x) + Theme::c("hi_fg") + "q" + Theme::c("main_fg") + " | Quit"; } output += empty_bg; } //! DEBUG stats --> if (Global::debug and not Menu::active) { output += debug_bg + Theme::c("title") + Fx::b + ljust(" Box", 9) + ljust("Collect μs", 12, true) + ljust("Draw μs", 9, true) + Theme::c("main_fg") + Fx::ub; for (const string name : {"cpu", "mem", "net", "proc", "total"}) { if (not debug_times.contains(name)) debug_times[name] = {0,0}; const auto& [time_collect, time_draw] = debug_times.at(name); if (name == "total") output += Fx::b; output += Mv::l(29) + Mv::d(1) + ljust(name, 8) + ljust(to_string(time_collect), 12) + ljust(to_string(time_draw), 9); } } //? If overlay isn't empty, print output without color and then print overlay on top cout << Term::sync_start << (conf.overlay.empty() ? output : (output.empty() ? "" : Fx::ub + Theme::c("inactive_fg") + Fx::uncolor(output)) + conf.overlay) << Term::sync_end << flush; } //* ----------------------------------------------- THREAD LOOP ----------------------------------------------- pthread_exit(NULL); } //? ------------------------------------------ Secondary thread end ----------------------------------------------- //* Runs collect and draw in a secondary thread, unlocks and locks config to update cached values void run(const string& box, const bool no_update, const bool force_redraw) { atomic_wait_for(active, true, 5000); if (active) { Logger::error("Stall in Runner thread, restarting!"); active = false; // exit(1); pthread_cancel(Runner::runner_id); if (pthread_create(&Runner::runner_id, NULL, &Runner::_runner, NULL) != 0) { Global::exit_error_msg = "Failed to re-create _runner thread!"; clean_quit(1); } } if (stopping or Global::resized) return; if (box == "overlay") { cout << Term::sync_start << Global::overlay << Term::sync_end << flush; } else if (box == "clock") { cout << Term::sync_start << Global::clock << Term::sync_end << flush; } else { Config::unlock(); Config::lock(); current_conf = { (box == "all" ? Config::current_boxes : vector{box}), no_update, force_redraw, (not Config::getB("tty_mode") and Config::getB("background_update")), Global::overlay, Global::clock }; if (Menu::active and not current_conf.background_update) Global::overlay.clear(); thread_trigger(); atomic_wait_for(active, false, 10); } } //* Stops any work being done in runner thread and checks for thread errors void stop() { stopping = true; int ret = pthread_mutex_trylock(&mtx); if (ret != EBUSY and not Global::quitting) { if (active) active = false; Global::exit_error_msg = "Runner thread died unexpectedly!"; clean_quit(1); } else if (ret == EBUSY) { atomic_wait_for(active, true, 5000); if (active) { active = false; if (Global::quitting) { return; } else { Global::exit_error_msg = "No response from Runner thread, quitting!"; clean_quit(1); } } thread_trigger(); atomic_wait_for(active, false, 100); atomic_wait_for(active, true, 100); } stopping = false; } } //* --------------------------------------------- Main starts here! --------------------------------------------------- int main(int argc, char **argv) { //? ------------------------------------------------ INIT --------------------------------------------------------- Global::start_time = time_s(); //? Save real and effective userid's and drop priviliges until needed if running with SUID bit set Global::real_uid = getuid(); Global::set_uid = geteuid(); if (Global::real_uid != Global::set_uid) { if (seteuid(Global::real_uid) != 0) { Global::real_uid = Global::set_uid; Global::exit_error_msg = "Failed to change effective user ID. Unset btop SUID bit to ensure security on this system. Quitting!"; clean_quit(1); } } //? Call argument parser if launched with arguments if (argc > 1) argumentParser(argc, argv); //? Setup paths for config, log and user themes for (const auto& env : {"XDG_CONFIG_HOME", "HOME"}) { if (std::getenv(env) != NULL and access(std::getenv(env), W_OK) != -1) { Config::conf_dir = fs::path(std::getenv(env)) / (((string)env == "HOME") ? ".config/btop" : "btop"); break; } } if (Config::conf_dir.empty()) { cout << "WARNING: Could not get path user HOME folder.\n" << "Make sure $XDG_CONFIG_HOME or $HOME environment variables is correctly set to fix this." << endl; } else { if (std::error_code ec; not fs::is_directory(Config::conf_dir) and not fs::create_directories(Config::conf_dir, ec)) { cout << "WARNING: Could not create or access btop config directory. Logging and config saving disabled.\n" << "Make sure $XDG_CONFIG_HOME or $HOME environment variables is correctly set to fix this." << endl; } else { Config::conf_file = Config::conf_dir / "btop.conf"; Logger::logfile = Config::conf_dir / "btop.log"; Theme::user_theme_dir = Config::conf_dir / "themes"; if (not fs::exists(Theme::user_theme_dir) and not fs::create_directory(Theme::user_theme_dir, ec)) Theme::user_theme_dir.clear(); } } //? Try to find global btop theme path relative to binary path #if defined(__linux__) { std::error_code ec; Global::self_path = fs::read_symlink("/proc/self/exe", ec).remove_filename(); } #endif if (std::error_code ec; not Global::self_path.empty()) { Theme::theme_dir = fs::canonical(Global::self_path / "../share/btop/themes", ec); if (ec or not fs::is_directory(Theme::theme_dir) or access(Theme::theme_dir.c_str(), R_OK) == -1) Theme::theme_dir.clear(); } //? If relative path failed, check two most common absolute paths if (Theme::theme_dir.empty()) { for (auto theme_path : {"/usr/local/share/btop/themes", "/usr/share/btop/themes"}) { if (fs::is_directory(fs::path(theme_path)) and access(theme_path, R_OK) != -1) { Theme::theme_dir = fs::path(theme_path); break; } } } //? Config init { vector<string> load_warnings; Config::load(Config::conf_file, load_warnings); if (Config::current_boxes.empty()) Config::check_boxes(Config::getS("shown_boxes")); Config::set("lowcolor", (Global::arg_low_color ? true : not Config::getB("truecolor"))); if (Global::debug) { Logger::set("DEBUG"); Logger::debug("Starting in DEBUG mode!"); } else Logger::set(Config::getS("log_level")); Logger::info("Logger set to " + (Global::debug ? "DEBUG" : Config::getS("log_level"))); for (const auto& err_str : load_warnings) Logger::warning(err_str); } //? Try to find and set a UTF-8 locale if (std::setlocale(LC_ALL, "") != NULL and not s_contains((string)std::setlocale(LC_ALL, ""), ";") and str_to_upper(s_replace((string)std::setlocale(LC_ALL, ""), "-", "")).ends_with("UTF8")) { Logger::debug("Using locale " + (string)std::setlocale(LC_ALL, "")); } else { string found; bool set_failure = false; for (const auto loc_env : array{"LANG", "LC_ALL"}) { if (std::getenv(loc_env) != NULL and str_to_upper(s_replace((string)std::getenv(loc_env), "-", "")).ends_with("UTF8")) { found = std::getenv(loc_env); if (std::setlocale(LC_ALL, found.c_str()) == NULL) { set_failure = true; Logger::warning("Failed to set locale " + found + " continuing anyway."); } } } if (found.empty()) { if (setenv("LC_ALL", "", 1) == 0 and setenv("LANG", "", 1) == 0) { try { if (const auto loc = std::locale("").name(); not loc.empty() and loc != "*") { for (auto& l : ssplit(loc, ';')) { if (str_to_upper(s_replace(l, "-", "")).ends_with("UTF8")) { found = l.substr(l.find('=') + 1); if (std::setlocale(LC_ALL, found.c_str()) != NULL) { break; } } } } } catch (...) { found.clear(); } } } #ifdef __APPLE__ if (found.empty()) { CFLocaleRef cflocale = CFLocaleCopyCurrent(); CFStringRef id_value = (CFStringRef)CFLocaleGetValue(cflocale, kCFLocaleIdentifier); auto loc_id = CFStringGetCStringPtr(id_value, kCFStringEncodingUTF8); CFRelease(cflocale); std::string cur_locale = (loc_id != nullptr ? loc_id : ""); if (cur_locale.empty()) { Logger::warning("No UTF-8 locale detected! Some symbols might not display correctly."); } else if (std::setlocale(LC_ALL, string(cur_locale + ".UTF-8").c_str()) != NULL) { Logger::debug("Setting LC_ALL=" + cur_locale + ".UTF-8"); } else if(std::setlocale(LC_ALL, "en_US.UTF-8") != NULL) { Logger::debug("Setting LC_ALL=en_US.UTF-8"); } else { Logger::warning("Failed to set macos locale, continuing anyway."); } } #else if (found.empty() and Global::utf_force) Logger::warning("No UTF-8 locale detected! Forcing start with --utf-force argument."); else if (found.empty()) { Global::exit_error_msg = "No UTF-8 locale detected!\nUse --utf-force argument to force start if you're sure your terminal can handle it."; clean_quit(1); } #endif else if (not set_failure) Logger::debug("Setting LC_ALL=" + found); } //? Initialize terminal and set options if (not Term::init()) { Global::exit_error_msg = "No tty detected!\nbtop++ needs an interactive shell to run."; clean_quit(1); } if (Term::current_tty != "unknown") Logger::info("Running on " + Term::current_tty); if (not Global::arg_tty and Config::getB("force_tty")) { Config::set("tty_mode", true); Logger::info("Forcing tty mode: setting 16 color mode and using tty friendly graph symbols"); } #ifndef __APPLE__ else if (not Global::arg_tty and Term::current_tty.starts_with("/dev/tty")) { Config::set("tty_mode", true); Logger::info("Real tty detected: setting 16 color mode and using tty friendly graph symbols"); } #endif //? Check for valid terminal dimensions { int t_count = 0; while (Term::width <= 0 or Term::width > 10000 or Term::height <= 0 or Term::height > 10000) { sleep_ms(10); Term::refresh(); if (++t_count == 100) { Global::exit_error_msg = "Failed to get size of terminal!"; clean_quit(1); } } } //? Platform dependent init and error check try { Shared::init(); } catch (const std::exception& e) { Global::exit_error_msg = "Exception in Shared::init() -> " + (string)e.what(); clean_quit(1); } //? Update list of available themes and generate the selected theme Theme::updateThemes(); Theme::setTheme(); //? Setup signal handlers for CTRL-C, CTRL-Z, resume and terminal resize std::atexit(_exit_handler); std::signal(SIGINT, _signal_handler); std::signal(SIGTSTP, _signal_handler); std::signal(SIGCONT, _signal_handler); std::signal(SIGWINCH, _signal_handler); //? Start runner thread Runner::thread_sem_init(); if (pthread_create(&Runner::runner_id, NULL, &Runner::_runner, NULL) != 0) { Global::exit_error_msg = "Failed to create _runner thread!"; clean_quit(1); } else { Global::_runner_started = true; } //? Calculate sizes of all boxes Config::presetsValid(Config::getS("presets")); if (Global::arg_preset >= 0) { Config::current_preset = min(Global::arg_preset, (int)Config::preset_list.size() - 1); Config::apply_preset(Config::preset_list.at(Config::current_preset)); } { const auto [x, y] = Term::get_min_size(Config::getS("shown_boxes")); if (Term::height < y or Term::width < x) { term_resize(true); Global::resized = false; Input::interrupt = false; } } Draw::calcSizes(); //? Print out box outlines cout << Term::sync_start << Cpu::box << Mem::box << Net::box << Proc::box << Term::sync_end << flush; //? ------------------------------------------------ MAIN LOOP ---------------------------------------------------- uint64_t update_ms = Config::getI("update_ms"); auto future_time = time_ms(); try { while (not true not_eq not false) { //? Check for exceptions in secondary thread and exit with fail signal if true if (Global::thread_exception) clean_quit(1); else if (Global::should_quit) clean_quit(0); else if (Global::should_sleep) { Global::should_sleep = false; _sleep(); } //? Make sure terminal size hasn't changed (in case of SIGWINCH not working properly) term_resize(Global::resized); //? Trigger secondary thread to redraw if terminal has been resized if (Global::resized) { Draw::calcSizes(); Draw::update_clock(true); Global::resized = false; if (Menu::active) Menu::process(); else Runner::run("all", true, true); atomic_wait_for(Runner::active, true, 1000); } //? Update clock if needed if (Draw::update_clock() and not Menu::active) { Runner::run("clock"); } //? Start secondary collect & draw thread at the interval set by <update_ms> config value if (time_ms() >= future_time and not Global::resized) { Runner::run("all"); update_ms = Config::getI("update_ms"); future_time = time_ms() + update_ms; } //? Loop over input polling and input action processing for (auto current_time = time_ms(); current_time < future_time; current_time = time_ms()) { //? Check for external clock changes and for changes to the update timer if (std::cmp_not_equal(update_ms, Config::getI("update_ms"))) { update_ms = Config::getI("update_ms"); future_time = time_ms() + update_ms; } else if (future_time - current_time > update_ms) future_time = current_time; //? Poll for input and process any input detected else if (Input::poll(min((uint64_t)1000, future_time - current_time))) { if (not Runner::active) Config::unlock(); if (Menu::active) Menu::process(Input::get()); else Input::process(Input::get()); } //? Break the loop at 1000ms intervals or if input polling was interrupted else break; } } } catch (const std::exception& e) { Global::exit_error_msg = "Exception in main loop -> " + (string)e.what(); clean_quit(1); } }
// Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "leveldb/db.h" #include <errno.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include "leveldb/cache.h" #include "leveldb/env.h" #include "leveldb/table.h" #include "leveldb/write_batch.h" #include "db/db_impl.h" #include "db/filename.h" #include "db/log_format.h" #include "db/version_set.h" #include "util/logging.h" #include "util/testharness.h" #include "util/testutil.h" namespace leveldb { static const int kValueSize = 1000; class CorruptionTest { public: test::ErrorEnv env_; std::string dbname_; Cache* tiny_cache_; Options options_; DB* db_; CorruptionTest() { tiny_cache_ = NewLRUCache(100); options_.env = &env_; options_.block_cache = tiny_cache_; dbname_ = test::TmpDir() + "/db_test"; DestroyDB(dbname_, options_); db_ = NULL; options_.create_if_missing = true; Reopen(); options_.create_if_missing = false; } ~CorruptionTest() { delete db_; DestroyDB(dbname_, Options()); delete tiny_cache_; } Status TryReopen() { delete db_; db_ = NULL; return DB::Open(options_, dbname_, &db_); } void Reopen() { ASSERT_OK(TryReopen()); } void Close() { if (db_ != NULL) { delete db_; db_ = NULL; } } void RepairDB() { Close(); ASSERT_OK(::leveldb::RepairDB(dbname_, options_)); } void Build(int n) { std::string key_space, value_space; WriteBatch batch; for (int i = 0; i < n; i++) { //if ((i % 100) == 0) fprintf(stderr, "@ %d of %d\n", i, n); Slice key = Key(i, &key_space); batch.Clear(); batch.Put(key, Value(i, &value_space)); WriteOptions options; // Corrupt() doesn't work without this sync on windows; stat reports 0 for // the file size. if (i == n - 1) { options.sync = true; } ASSERT_OK(db_->Write(options, &batch)); } } void Check(int min_expected, int max_expected) { int next_expected = 0; int missed = 0; int bad_keys = 0; int bad_values = 0; int correct = 0; std::string value_space; Iterator* iter = db_->NewIterator(ReadOptions()); for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { uint64_t key; Slice in(iter->key()); if (in == "" || in == "~") { // Ignore boundary keys. continue; } if (!ConsumeDecimalNumber(&in, &key) || !in.empty() || key < next_expected) { bad_keys++; continue; } missed += (key - next_expected); next_expected = key + 1; if (iter->value() != Value(key, &value_space)) { bad_values++; } else { correct++; } } delete iter; fprintf(stderr, "expected=%d..%d; got=%d; bad_keys=%d; bad_values=%d; missed=%d\n", min_expected, max_expected, correct, bad_keys, bad_values, missed); ASSERT_LE(min_expected, correct); ASSERT_GE(max_expected, correct); } void Corrupt(FileType filetype, int offset, int bytes_to_corrupt) { // Pick file to corrupt std::vector<std::string> filenames; ASSERT_OK(env_.GetChildren(dbname_, &filenames)); uint64_t number; FileType type; std::string fname; int picked_number = -1; for (size_t i = 0; i < filenames.size(); i++) { if (ParseFileName(filenames[i], &number, &type) && type == filetype && int(number) > picked_number) { // Pick latest file fname = dbname_ + "/" + filenames[i]; picked_number = number; } } ASSERT_TRUE(!fname.empty()) << filetype; struct stat sbuf; if (stat(fname.c_str(), &sbuf) != 0) { const char* msg = strerror(errno); ASSERT_TRUE(false) << fname << ": " << msg; } if (offset < 0) { // Relative to end of file; make it absolute if (-offset > sbuf.st_size) { offset = 0; } else { offset = sbuf.st_size + offset; } } if (offset > sbuf.st_size) { offset = sbuf.st_size; } if (offset + bytes_to_corrupt > sbuf.st_size) { bytes_to_corrupt = sbuf.st_size - offset; } // Do it std::string contents; Status s = ReadFileToString(Env::Default(), fname, &contents); ASSERT_TRUE(s.ok()) << s.ToString(); for (int i = 0; i < bytes_to_corrupt; i++) { contents[i + offset] ^= 0x80; } s = WriteStringToFile(Env::Default(), contents, fname); ASSERT_TRUE(s.ok()) << s.ToString(); } int Property(const std::string& name) { std::string property; int result; if (db_->GetProperty(name, &property) && sscanf(property.c_str(), "%d", &result) == 1) { return result; } else { return -1; } } // Return the ith key Slice Key(int i, std::string* storage) { char buf[100]; snprintf(buf, sizeof(buf), "%016d", i); storage->assign(buf, strlen(buf)); return Slice(*storage); } // Return the value to associate with the specified key Slice Value(int k, std::string* storage) { Random r(k); return test::RandomString(&r, kValueSize, storage); } }; TEST(CorruptionTest, Recovery) { Build(100); Check(100, 100); Close(); Corrupt(kLogFile, 19, 1); // WriteBatch tag for first record Corrupt(kLogFile, log::kBlockSize + 1000, 1); // Somewhere in second block Reopen(); // The 64 records in the first two log blocks are completely lost. Check(36, 36); } TEST(CorruptionTest, RecoverWriteError) { env_.writable_file_error_ = true; Status s = TryReopen(); ASSERT_TRUE(!s.ok()); } TEST(CorruptionTest, NewFileErrorDuringWrite) { // Do enough writing to force minor compaction env_.writable_file_error_ = true; const int num = 3 + (Options().write_buffer_size / kValueSize); std::string value_storage; Status s; for (int i = 0; s.ok() && i < num; i++) { WriteBatch batch; batch.Put("a", Value(100, &value_storage)); s = db_->Write(WriteOptions(), &batch); } ASSERT_TRUE(!s.ok()); ASSERT_GE(env_.num_writable_file_errors_, 1); env_.writable_file_error_ = false; Reopen(); } TEST(CorruptionTest, TableFile) { Build(100); DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); dbi->TEST_CompactMemTable(); dbi->TEST_CompactRange(0, NULL, NULL); dbi->TEST_CompactRange(1, NULL, NULL); Corrupt(kTableFile, 100, 1); Check(90, 99); } TEST(CorruptionTest, TableFileRepair) { options_.block_size = 2 * kValueSize; // Limit scope of corruption options_.paranoid_checks = true; Reopen(); Build(100); DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); dbi->TEST_CompactMemTable(); dbi->TEST_CompactRange(0, NULL, NULL); dbi->TEST_CompactRange(1, NULL, NULL); Close(); Corrupt(kTableFile, 100, 1); RepairDB(); Reopen(); Check(95, 99); } TEST(CorruptionTest, TableFileIndexData) { Build(10000); // Enough to build multiple Tables DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); dbi->TEST_CompactMemTable(); Close(); Corrupt(kTableFile, -2000, 500); Reopen(); Check(5000, 9999); } TEST(CorruptionTest, MissingDescriptor) { Build(1000); RepairDB(); Reopen(); Check(1000, 1000); } TEST(CorruptionTest, SequenceNumberRecovery) { ASSERT_OK(db_->Put(WriteOptions(), "foo", "v1")); ASSERT_OK(db_->Put(WriteOptions(), "foo", "v2")); ASSERT_OK(db_->Put(WriteOptions(), "foo", "v3")); ASSERT_OK(db_->Put(WriteOptions(), "foo", "v4")); ASSERT_OK(db_->Put(WriteOptions(), "foo", "v5")); RepairDB(); Reopen(); std::string v; ASSERT_OK(db_->Get(ReadOptions(), "foo", &v)); ASSERT_EQ("v5", v); // Write something. If sequence number was not recovered properly, // it will be hidden by an earlier write. ASSERT_OK(db_->Put(WriteOptions(), "foo", "v6")); ASSERT_OK(db_->Get(ReadOptions(), "foo", &v)); ASSERT_EQ("v6", v); Reopen(); ASSERT_OK(db_->Get(ReadOptions(), "foo", &v)); ASSERT_EQ("v6", v); } TEST(CorruptionTest, CorruptedDescriptor) { ASSERT_OK(db_->Put(WriteOptions(), "foo", "hello")); DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); dbi->TEST_CompactMemTable(); dbi->TEST_CompactRange(0, NULL, NULL); Close(); Corrupt(kDescriptorFile, 0, 1000); Status s = TryReopen(); ASSERT_TRUE(!s.ok()); RepairDB(); Reopen(); std::string v; ASSERT_OK(db_->Get(ReadOptions(), "foo", &v)); ASSERT_EQ("hello", v); } TEST(CorruptionTest, CompactionInputError) { Build(10); DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); dbi->TEST_CompactMemTable(); const int last = config::kMaxMemCompactLevel; ASSERT_EQ(1, Property("leveldb.num-files-at-level" + NumberToString(last))); Corrupt(kTableFile, 100, 1); Check(5, 9); // Force compactions by writing lots of values Build(10000); Check(10000, 10000); } TEST(CorruptionTest, CompactionInputErrorParanoid) { options_.paranoid_checks = true; options_.write_buffer_size = 512 << 10; Reopen(); DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); // Make multiple inputs so we need to compact. for (int i = 0; i < 2; i++) { Build(10); dbi->TEST_CompactMemTable(); Corrupt(kTableFile, 100, 1); env_.SleepForMicroseconds(100000); } dbi->CompactRange(NULL, NULL); // Write must fail because of corrupted table std::string tmp1, tmp2; Status s = db_->Put(WriteOptions(), Key(5, &tmp1), Value(5, &tmp2)); ASSERT_TRUE(!s.ok()) << "write did not fail in corrupted paranoid db"; } TEST(CorruptionTest, UnrelatedKeys) { Build(10); DBImpl* dbi = reinterpret_cast<DBImpl*>(db_); dbi->TEST_CompactMemTable(); Corrupt(kTableFile, 100, 1); std::string tmp1, tmp2; ASSERT_OK(db_->Put(WriteOptions(), Key(1000, &tmp1), Value(1000, &tmp2))); std::string v; ASSERT_OK(db_->Get(ReadOptions(), Key(1000, &tmp1), &v)); ASSERT_EQ(Value(1000, &tmp2).ToString(), v); dbi->TEST_CompactMemTable(); ASSERT_OK(db_->Get(ReadOptions(), Key(1000, &tmp1), &v)); ASSERT_EQ(Value(1000, &tmp2).ToString(), v); } } // namespace leveldb int main(int argc, char** argv) { return leveldb::test::RunAllTests(); }
/** * Copyright 2020 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "host_kernels/concat_offset_kernel.h" #include <memory> #include "common/ge_inner_error_codes.h" #include "common/op/ge_op_utils.h" #include "common/types.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" namespace ge { namespace { const size_t kConcatOffsetInputIndexZero = 0; const size_t kConcatOffsetInputIndexOne = 1; const int kNumOne = 1; } // namespace Status ConcatOffsetKernel::Compute(const OpDescPtr op_desc_ptr, const vector<ConstGeTensorPtr> &input, vector<GeTensorPtr> &v_output) { GELOGI("ConcatOffsetKernel in."); if (op_desc_ptr == nullptr) { GELOGE(PARAM_INVALID, "input opdesc is nullptr."); return PARAM_INVALID; } // validate attrs int N = 0; if (!(AttrUtils::GetInt(op_desc_ptr, "N", N))) { GELOGW("Attr %s does not exist.", "N"); return NOT_CHANGED; } // follow IR def, the first input is concat_dim ConstGeTensorPtr input_0 = input[kConcatOffsetInputIndexZero]; GE_CHECK_NOTNULL(input_0); int32_t concat_dim = *(const_cast<int32_t *>(reinterpret_cast<const int32_t *>(input_0->GetData().data()))); // validate inputs if ((static_cast<int>(input.size()) != (N + kNumOne)) || (input.size() <= kConcatOffsetInputIndexOne)) { GELOGW("The number of input for concat offset must be equal to %d, and must be more than one.", (N + kNumOne)); return NOT_CHANGED; } // calculate ouput dim GeShape output_shape = input[kConcatOffsetInputIndexOne]->GetTensorDesc().GetShape(); int64_t output_size = output_shape.GetShapeSize(); if (concat_dim >= output_size) { GELOGW("Concat dim is bigger than the size of output_shape."); return NOT_CHANGED; } GELOGI("Output shape size is %ld", output_size); int32_t offset = 0; if (output_size < 0) { GELOGE(FAILED, "Index is negative."); return FAILED; } unique_ptr<int32_t[]> buf(new (std::nothrow) int32_t[output_size]()); if (buf == nullptr) { GELOGE(MEMALLOC_FAILED, "new buf failed"); return INTERNAL_ERROR; } for (size_t i = 0; i < static_cast<size_t>(N); i++) { buf[concat_dim] = offset; // generate output, index 0 can always gets a GeTensorDesc object from any OpDescPtr. auto output_tensor_desc = op_desc_ptr->GetOutputDesc(0); GeTensorPtr output_ptr = MakeShared<GeTensor>(output_tensor_desc); if (output_ptr == nullptr) { GELOGW("Failed to fold node %s, out of memeory", op_desc_ptr->GetName().c_str()); return NOT_CHANGED; } output_ptr->MutableTensorDesc().SetDataType(DT_INT32); output_ptr->MutableTensorDesc().SetShape(output_shape); GE_IF_BOOL_EXEC(output_ptr->SetData(reinterpret_cast<uint8_t *>(buf.get()), static_cast<size_t>(sizeof(DT_INT32) * output_size)) != GRAPH_SUCCESS, GELOGW("set data failed"); return NOT_CHANGED); v_output.push_back(output_ptr); // caculate offset const int32_t *input_shape = reinterpret_cast<const int32_t *>(input[i + kConcatOffsetInputIndexOne]->GetData().data()); int64_t input_dim = input_shape[concat_dim]; // this index is valid, checked before if (input_dim > (INT64_MAX - offset)) { GELOGE(PARAM_INVALID, " %d and %ld addition can result in overflow!.", offset, input_dim); return INTERNAL_ERROR; } offset += input_dim; } GELOGI("ConcatOffsetKernel success."); return SUCCESS; } REGISTER_KERNEL(CONCATOFFSET, ConcatOffsetKernel); } // namespace ge
#include "greendp.hpp" #include "test_common.hpp" // Execute the modern version of the first dynamic programming algorithm // presented at "On Equivalent Knapsack Problems" (H. Greenberg) over a // hardcoded set of instances. Used to check if it is still working after a // change. int main(int argc, char** argv) { std::cout << "hbm::benchmark_pyasukp<size_t, size_t, size_t>(&hbm::greendp1, argc, argv)" << std::endl; return hbm::benchmark_pyasukp<size_t, size_t, size_t>(&hbm::mgreendp1, argc, argv); }
/* The copyright in this software is being made available under the BSD * License, included below. This software may be subject to other third party * and contributor rights, including patent rights, and no such rights are * granted under this license. * * Copyright (c) 2010-2015, ITU/ISO/IEC * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ /** \file TEncBinCoderCABAC.cpp \brief binary entropy encoder of CABAC */ #include "TEncBinCoderCABACCounter.h" #include "TLibCommon/TComRom.h" #include "TLibCommon/Debug.h" #if FAST_BIT_EST //! \ingroup TLibEncoder //! \{ TEncBinCABACCounter::TEncBinCABACCounter() { } TEncBinCABACCounter::~TEncBinCABACCounter() { } Void TEncBinCABACCounter::finish() { m_pcTComBitIf->write(0, UInt(m_fracBits >> 15) ); m_fracBits &= 32767; #if NH_MV D_PRINT_INDENT( g_traceEncFracBits, "Finish " + n2s(m_fracBits) ); #endif } UInt TEncBinCABACCounter::getNumWrittenBits() { return m_pcTComBitIf->getNumberOfWrittenBits() + UInt( m_fracBits >> 15 ); } /** * \brief Encode bin * * \param binValue bin value * \param rcCtxModel context model */ Void TEncBinCABACCounter::encodeBin( UInt binValue, ContextModel &rcCtxModel ) { #if DEBUG_ENCODER_SEARCH_BINS const UInt64 startingFracBits = m_fracBits; #endif m_uiBinsCoded += m_binCountIncrement; m_fracBits += rcCtxModel.getEntropyBits( binValue ); #if NH_MV D_PRINT_INDENT( g_traceEncFracBits, "EncodeBin " + n2s(m_fracBits) ); #endif rcCtxModel.update( binValue ); #if DEBUG_ENCODER_SEARCH_BINS if ((g_debugCounter + debugEncoderSearchBinWindow) >= debugEncoderSearchBinTargetLine) { std::cout << g_debugCounter << ": coding bin value " << binValue << ", fracBits = [" << startingFracBits << "->" << m_fracBits << "]\n"; } if (g_debugCounter >= debugEncoderSearchBinTargetLine) { UChar breakPointThis; breakPointThis = 7; } if (g_debugCounter >= (debugEncoderSearchBinTargetLine + debugEncoderSearchBinWindow)) { exit(0); } g_debugCounter++; #endif } /** * \brief Encode equiprobable bin * * \param binValue bin value */ Void TEncBinCABACCounter::encodeBinEP( UInt /*binValue*/ ) { m_uiBinsCoded += m_binCountIncrement; m_fracBits += 32768; #if NH_MV D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinEP " + n2s(m_fracBits) ); #endif } /** * \brief Encode equiprobable bins * * \param binValues bin values * \param numBins number of bins */ Void TEncBinCABACCounter::encodeBinsEP( UInt /*binValues*/, Int numBins ) { m_uiBinsCoded += numBins & -m_binCountIncrement; m_fracBits += 32768 * numBins; #if NH_MV D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinsEP " + n2s(m_fracBits) ); #endif } /** * \brief Encode terminating bin * * \param binValue bin value */ Void TEncBinCABACCounter::encodeBinTrm( UInt binValue ) { m_uiBinsCoded += m_binCountIncrement; m_fracBits += ContextModel::getEntropyBitsTrm( binValue ); #if NH_MV D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinTrm " + n2s(m_fracBits) ); #endif } Void TEncBinCABACCounter::align() { m_fracBits = (m_fracBits + 32767) & (~32767); #if NH_MV D_PRINT_INDENT( g_traceEncFracBits, "Align " + n2s(m_fracBits) ); #endif } //! \} #endif
#include "dram_cache.h" #include "simulator.h" #include "config.hpp" #include "cache.h" #include "stats.h" #include "memory_manager_base.h" #include "pr_l1_cache_block_info.h" #include "queue_model.h" #include "shmem_perf.h" #include "prefetcher.h" DramCache::DramCache(MemoryManagerBase* memory_manager, ShmemPerfModel* shmem_perf_model, AddressHomeLookup* home_lookup, UInt32 cache_block_size, DramCntlrInterface *dram_cntlr) : DramCntlrInterface(memory_manager, shmem_perf_model, cache_block_size) , m_core_id(memory_manager->getCore()->getId()) , m_cache_block_size(cache_block_size) , m_data_access_time(SubsecondTime::NS(Sim()->getCfg()->getIntArray("perf_model/dram/cache/data_access_time", m_core_id))) , m_tags_access_time(SubsecondTime::NS(Sim()->getCfg()->getIntArray("perf_model/dram/cache/tags_access_time", m_core_id))) , m_data_array_bandwidth(8 * Sim()->getCfg()->getFloat("perf_model/dram/cache/bandwidth")) , m_home_lookup(home_lookup) , m_dram_cntlr(dram_cntlr) , m_queue_model(NULL) , m_prefetcher(NULL) , m_prefetch_mshr("dram-cache.prefetch-mshr", m_core_id, 16) , m_reads(0) , m_writes(0) , m_read_misses(0) , m_write_misses(0) , m_hits_prefetch(0) , m_prefetches(0) , m_prefetch_mshr_delay(SubsecondTime::Zero()) { UInt32 cache_size = Sim()->getCfg()->getIntArray("perf_model/dram/cache/cache_size", m_core_id); UInt32 associativity = Sim()->getCfg()->getIntArray("perf_model/dram/cache/associativity", m_core_id); UInt32 num_sets = k_KILO * cache_size / (associativity * m_cache_block_size); LOG_ASSERT_ERROR(k_KILO * cache_size == num_sets * associativity * m_cache_block_size, "Invalid cache configuration: size(%d Kb) != sets(%d) * associativity(%d) * block_size(%d)", cache_size, num_sets, associativity, m_cache_block_size); m_cache = new Cache("dram-cache", "perf_model/dram/cache", m_core_id, num_sets, associativity, m_cache_block_size, Sim()->getCfg()->getStringArray("perf_model/dram/cache/replacement_policy", m_core_id), CacheBase::PR_L1_CACHE, CacheBase::parseAddressHash(Sim()->getCfg()->getStringArray("perf_model/dram/cache/address_hash", m_core_id)), NULL, /* FaultinjectionManager */ home_lookup ); if (Sim()->getCfg()->getBool("perf_model/dram/cache/queue_model/enabled")) { String queue_model_type = Sim()->getCfg()->getString("perf_model/dram/queue_model/type"); m_queue_model = QueueModel::create("dram-cache-queue", m_core_id, queue_model_type, m_data_array_bandwidth.getRoundedLatency(8 * m_cache_block_size)); // bytes to bits } m_prefetcher = Prefetcher::createPrefetcher(Sim()->getCfg()->getString("perf_model/dram/cache/prefetcher"), "dram/cache", m_core_id, 1); m_prefetch_on_prefetch_hit = Sim()->getCfg()->getBool("perf_model/dram/cache/prefetcher/prefetch_on_prefetch_hit"); registerStatsMetric("dram-cache", m_core_id, "reads", &m_reads); registerStatsMetric("dram-cache", m_core_id, "writes", &m_writes); registerStatsMetric("dram-cache", m_core_id, "read-misses", &m_read_misses); registerStatsMetric("dram-cache", m_core_id, "write-misses", &m_write_misses); registerStatsMetric("dram-cache", m_core_id, "hits-prefetch", &m_hits_prefetch); registerStatsMetric("dram-cache", m_core_id, "prefetches", &m_prefetches); registerStatsMetric("dram-cache", m_core_id, "prefetch-mshr-delay", &m_prefetch_mshr_delay); } DramCache::~DramCache() { delete m_cache; if (m_queue_model) delete m_queue_model; } boost::tuple<SubsecondTime, HitWhere::where_t> DramCache::getDataFromDram(IntPtr address, core_id_t requester, Byte* data_buf, SubsecondTime now, ShmemPerf *perf) { std::pair<bool, SubsecondTime> res = doAccess(Cache::LOAD, address, requester, data_buf, now, perf); if (!res.first) ++m_read_misses; ++m_reads; return boost::tuple<SubsecondTime, HitWhere::where_t>(res.second, res.first ? HitWhere::DRAM_CACHE : HitWhere::DRAM); } boost::tuple<SubsecondTime, HitWhere::where_t> DramCache::putDataToDram(IntPtr address, core_id_t requester, Byte* data_buf, SubsecondTime now) { // printf("[dram_cache.cc | putDataToDram]: [%s]\n", m_cache->getName().c_str()); // Added by Kleber Kruger std::pair<bool, SubsecondTime> res = doAccess(Cache::STORE, address, requester, data_buf, now, NULL); if (!res.first) ++m_write_misses; ++m_writes; return boost::tuple<SubsecondTime, HitWhere::where_t>(res.second, res.first ? HitWhere::DRAM_CACHE : HitWhere::DRAM); } std::pair<bool, SubsecondTime> DramCache::doAccess(Cache::access_t access, IntPtr address, core_id_t requester, Byte* data_buf, SubsecondTime now, ShmemPerf *perf) { PrL1CacheBlockInfo* block_info = (PrL1CacheBlockInfo*)m_cache->peekSingleLine(address); SubsecondTime latency = m_tags_access_time; perf->updateTime(now); perf->updateTime(now + latency, ShmemPerf::DRAM_CACHE_TAGS); bool cache_hit = false, prefetch_hit = false; if (block_info) { cache_hit = true; if (block_info->hasOption(CacheBlockInfo::PREFETCH)) { // This line was fetched by the prefetcher and has proven useful m_hits_prefetch++; prefetch_hit = true; block_info->clearOption(CacheBlockInfo::PREFETCH); // If prefetch is still in progress: delay SubsecondTime t_completed = m_prefetch_mshr.getTagCompletionTime(address); if (t_completed != SubsecondTime::MaxTime() && t_completed > now + latency) { m_prefetch_mshr_delay += t_completed - (now + latency); latency = t_completed - now; } } // printf("[dram_cache.cc | doAccess]: [%s]\n", m_cache->getName().c_str()); // Added by Kleber Kruger m_cache->accessSingleLine(address, access, data_buf, m_cache_block_size, now + latency, true); latency += accessDataArray(access, requester, now + latency, perf); if (access == Cache::STORE) block_info->setCState(CacheState::MODIFIED); } else { if (access == Cache::LOAD) { // For LOADs, get data from DRAM SubsecondTime dram_latency; HitWhere::where_t hit_where; boost::tie(dram_latency, hit_where) = m_dram_cntlr->getDataFromDram(address, requester, data_buf, now + latency, perf); latency += dram_latency; } // For STOREs, we only do complete cache lines so we don't need to read from DRAM insertLine(access, address, requester, data_buf, now + latency); } if (m_prefetcher) callPrefetcher(address, cache_hit, prefetch_hit, now + latency); return std::pair<bool, SubsecondTime>(block_info ? true : false, latency); } void DramCache::insertLine(Cache::access_t access, IntPtr address, core_id_t requester, Byte* data_buf, SubsecondTime now) { bool eviction; IntPtr evict_address; PrL1CacheBlockInfo evict_block_info; Byte evict_buf[m_cache_block_size]; m_cache->insertSingleLine(address, data_buf, &eviction, &evict_address, &evict_block_info, evict_buf, now); m_cache->peekSingleLine(address)->setCState(access == Cache::STORE ? CacheState::MODIFIED : CacheState::SHARED); // Write to data array off-line, so don't affect return latency accessDataArray(Cache::STORE, requester, now, NULL); // Writeback to DRAM done off-line, so don't affect return latency if (eviction && evict_block_info.getCState() == CacheState::MODIFIED) { // printf("[dram_cache.cc | insertLine]: [%s]\n", m_cache->getName().c_str()); // Added by Kleber Kruger m_dram_cntlr->putDataToDram(evict_address, requester, data_buf, now); } } SubsecondTime DramCache::accessDataArray(Cache::access_t access, core_id_t requester, SubsecondTime t_start, ShmemPerf *perf) { SubsecondTime processing_time = m_data_array_bandwidth.getRoundedLatency(8 * m_cache_block_size); // bytes to bits // Compute Queue Delay SubsecondTime queue_delay; if (m_queue_model) { queue_delay = m_queue_model->computeQueueDelay(t_start, processing_time, requester); } else { queue_delay = SubsecondTime::Zero(); } perf->updateTime(t_start); perf->updateTime(t_start + queue_delay, ShmemPerf::DRAM_CACHE_QUEUE); perf->updateTime(t_start + queue_delay + processing_time, ShmemPerf::DRAM_CACHE_BUS); perf->updateTime(t_start + queue_delay + processing_time + m_data_access_time, ShmemPerf::DRAM_CACHE_DATA); return queue_delay + processing_time + m_data_access_time; } void DramCache::callPrefetcher(IntPtr train_address, bool cache_hit, bool prefetch_hit, SubsecondTime t_issue) { // Always train the prefetcher std::vector<IntPtr> prefetchList = m_prefetcher->getNextAddress(train_address, INVALID_CORE_ID); // Only do prefetches on misses, or on hits to lines previously brought in by the prefetcher (if enabled) if (!cache_hit || (m_prefetch_on_prefetch_hit && prefetch_hit)) { for(std::vector<IntPtr>::iterator it = prefetchList.begin(); it != prefetchList.end(); ++it) { IntPtr prefetch_address = *it; if (!m_cache->peekSingleLine(prefetch_address)) { // Get data from DRAM SubsecondTime dram_latency; HitWhere::where_t hit_where; Byte data_buf[m_cache_block_size]; boost::tie(dram_latency, hit_where) = m_dram_cntlr->getDataFromDram(prefetch_address, m_core_id, data_buf, t_issue, NULL); // Insert into data array insertLine(Cache::LOAD, prefetch_address, m_core_id, data_buf, t_issue + dram_latency); // Set prefetched bit PrL1CacheBlockInfo* block_info = (PrL1CacheBlockInfo*)m_cache->peekSingleLine(prefetch_address); block_info->setOption(CacheBlockInfo::PREFETCH); // Update completion time m_prefetch_mshr.getCompletionTime(t_issue, dram_latency, prefetch_address); ++m_prefetches; } } } }
#pragma once #include "window/window.hpp" #include "fps_counter/fps_counter.hpp"
/* Copyright 2016 Adam Smith - P12218319 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. email : p12218319@myemail.dmu.ac.uk */ #include "P12218319\core\Files.hpp" #if P12218319_OS == P12218319_WINDOWS #include <Windows.h> #undef CreateFile #undef CreateDirectory #undef DeleteFile #undef GetCurrentDirectory #undef GetFileAttributes namespace P12218319 { namespace files { uint32_t P12218319_CALL GetFileSize(const std::string& aPath) throw() { const HANDLE handle = CreateFileA( aPath.c_str(), 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if(handle == INVALID_HANDLE_VALUE) return 0; const DWORD size = ::GetFileSize(handle, NULL); CloseHandle(handle); return size; } uint32_t P12218319_CALL GetFileAttributes(const std::string& aPath) throw() { const DWORD winAttributes = GetFileAttributesA(aPath.c_str()); if(winAttributes == INVALID_FILE_ATTRIBUTES) return 0; if(winAttributes & FILE_ATTRIBUTE_DIRECTORY) { return EXISTS | IS_DIRECTORY; }else { return EXISTS | IS_DIRECTORY | (winAttributes & FILE_ATTRIBUTE_READONLY ? IS_READABLE : IS_READ_WRITEABLE); } } bool P12218319_CALL CreateFile(const std::string& aPath, const uint32_t aAttributes) throw() { const HANDLE handle = CreateFileA( aPath.c_str(), (aAttributes & IS_READABLE ? GENERIC_READ : 0) | (aAttributes & IS_READABLE ? GENERIC_WRITE : 0), 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL ); if(handle == INVALID_HANDLE_VALUE) return false; CloseHandle(handle); return true; } bool P12218319_CALL CreateDirectory(const std::string& aPath) throw() { const HANDLE handle = CreateFileA( aPath.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL ); if(handle == INVALID_HANDLE_VALUE) return false; CloseHandle(handle); return true; } bool P12218319_CALL DeleteFile(const std::string& aPath) throw() { return DeleteFileA(aPath.c_str()) != 0; } bool P12218319_CALL DeleteDirectory(const std::string& aPath) throw() { return RemoveDirectoryA(aPath.c_str()) != 0; } bool P12218319_CALL DeleteDirectoryRecursive(const std::string& aPath) throw() { const std::vector<std::string> children = ListChildren(aPath); for(const std::string& i : children) { const uint32_t attributes = GetFileAttributes(i); if(attributes & IS_FILE) { if(! DeleteFile(i)) return false; }else if (attributes & IS_DIRECTORY) { if(! DeleteDirectoryRecursive(i)) return false; }else { return false; } } return DeleteDirectory(aPath); } void P12218319_CALL Move(const std::string& aOldPath, const std::string& aNewPath) { if(MoveFileA(aOldPath.c_str(), aNewPath.c_str()) == 0) throw std::runtime_error(std::string("Could not move file ") + aOldPath + std::string(" to ") + aNewPath); } void P12218319_CALL Copy(const std::string& aOldPath, const std::string& aNewPath) { if(CopyFileA(aOldPath.c_str(), aNewPath.c_str(), TRUE) == 0) throw std::runtime_error(std::string("Could not copy file ") + aOldPath + std::string(" to ") + aNewPath); } void P12218319_CALL Rename(const std::string& aOldPath, const std::string& aNewPath) { Copy(aOldPath, aNewPath); DeleteFile(aOldPath); } std::vector<std::string> P12218319_CALL ListChildren(const std::string&aPath) { std::vector<std::string> children; WIN32_FIND_DATAA findData; char pathBufffer[MAX_PATH]; HANDLE handle = INVALID_HANDLE_VALUE; handle = FindFirstFileA(pathBufffer, &findData); if(INVALID_HANDLE_VALUE == handle) return children; do{ children.push_back(std::string(findData.cFileName)); }while(FindNextFileA(handle, &findData) != 0); FindClose(handle); return children; } std::string P12218319_CALL GetCurrentDirectory() throw() { char pathBufffer[MAX_PATH]; GetCurrentDirectoryA(MAX_PATH, pathBufffer); return std::string(pathBufffer); } std::string P12218319_CALL GetTemporaryDirectory() throw() { char pathBufffer[MAX_PATH]; GetTempPathA(MAX_PATH, pathBufffer); return std::string(pathBufffer); } std::string P12218319_CALL GetFileExtension(const std::string& aPath) throw() { return aPath.substr(aPath.find_last_of('.')); } std::string P12218319_CALL GetFileName(const std::string& aPath) throw() { const size_t begin = aPath.find_last_of('\\'); return aPath.substr(begin == std::string::npos ? 0 : begin, aPath.find_last_of('.')); } std::string P12218319_CALL GetDirectoryName(const std::string& aPath) throw() { std::string tmp; const size_t end = aPath.find_last_of('\\'); for(size_t i = end - 1; end != 0; --i) { const char c = aPath[i]; if(c == '\\') break; tmp += c; } std::reverse(tmp.begin(), tmp.end()); return tmp; } std::string P12218319_CALL GetParentDirectory(const std::string& aPath) throw() { size_t i = 0; size_t j = i; size_t k = j; while(true) { i = aPath.find_first_of('\\', i + 1); if(i == std::string::npos) break; k = j; j = i; } return aPath.substr(0, k +1); } }} #endif
version https://git-lfs.github.com/spec/v1 oid sha256:4a1beec27c8680b8176fc914d6d6632e7a56e9f3b759790e37f255d1954b0b16 size 25757
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/safe_browsing/incident_reporting/blacklist_load_incident.h" #include <memory> #include <utility> #include "base/memory/ptr_util.h" #include "chrome/common/safe_browsing/csd.pb.h" #include "testing/gtest/include/gtest/gtest.h" namespace safe_browsing { namespace { std::unique_ptr<Incident> MakeIncident(const char* path) { std::unique_ptr<ClientIncidentReport_IncidentData_BlacklistLoadIncident> incident(new ClientIncidentReport_IncidentData_BlacklistLoadIncident); incident->set_path(path); return base::MakeUnique<BlacklistLoadIncident>(std::move(incident)); } } // namespace TEST(BlacklistLoadIncident, GetType) { ASSERT_EQ(IncidentType::BLACKLIST_LOAD, MakeIncident("foo")->GetType()); } // Tests that GetKey returns the dll path. TEST(BlacklistLoadIncident, KeyIsPath) { ASSERT_EQ(std::string("foo"), MakeIncident("foo")->GetKey()); } // Tests that GetDigest returns the same value for the same incident. TEST(BlacklistLoadIncident, SameIncidentSameDigest) { ASSERT_EQ(MakeIncident("foo")->ComputeDigest(), MakeIncident("foo")->ComputeDigest()); } // Tests that GetDigest returns different values for different incidents. TEST(BlacklistLoadIncident, DifferentIncidentDifferentDigest) { ASSERT_NE(MakeIncident("foo")->ComputeDigest(), MakeIncident("bar")->ComputeDigest()); } } // namespace safe_browsing
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <cstddef> #include <memory> #include <set> #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" #include "base/logging.h" #include "base/macros.h" #include "base/nix/mime_util_xdg.h" #include "base/nix/xdg_util.h" #include "base/process/launch.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" #include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "base/threading/thread_restrictions.h" #include "base/version.h" #include "ui/aura/window_tree_host.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gtk/select_file_dialog_impl.h" #include "ui/strings/grit/ui_strings.h" namespace { std::string GetTitle(const std::string& title, int message_id) { return title.empty() ? l10n_util::GetStringUTF8(message_id) : title; } const char kKdialogBinary[] = "kdialog"; } // namespace namespace gtk { // Implementation of SelectFileDialog that shows a KDE common dialog for // choosing a file or folder. This acts as a modal dialog. class SelectFileDialogImplKDE : public SelectFileDialogImpl { public: SelectFileDialogImplKDE(Listener* listener, std::unique_ptr<ui::SelectFilePolicy> policy, base::nix::DesktopEnvironment desktop, const std::string& kdialog_version); SelectFileDialogImplKDE(const SelectFileDialogImplKDE&) = delete; SelectFileDialogImplKDE& operator=(const SelectFileDialogImplKDE&) = delete; protected: ~SelectFileDialogImplKDE() override; // BaseShellDialog implementation: bool IsRunning(gfx::NativeWindow parent_window) const override; // SelectFileDialog implementation. // |params| is user data we pass back via the Listener interface. void SelectFileImpl(Type type, const std::u16string& title, const base::FilePath& default_path, const FileTypeInfo* file_types, int file_type_index, const base::FilePath::StringType& default_extension, gfx::NativeWindow owning_window, void* params) override; private: bool HasMultipleFileTypeChoicesImpl() override; struct KDialogParams { KDialogParams(const std::string& type, const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, bool file_operation, bool multiple_selection) : type(type), title(title), default_path(default_path), parent(parent), file_operation(file_operation), multiple_selection(multiple_selection) {} std::string type; std::string title; base::FilePath default_path; gfx::AcceleratedWidget parent; bool file_operation; bool multiple_selection; }; struct KDialogOutputParams { std::string output; int exit_code; }; // Get the filters from |file_types_| and concatenate them into // |filter_string|. std::string GetMimeTypeFilterString(); // Get KDialog command line representing the Argv array for KDialog. void GetKDialogCommandLine(const std::string& type, const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, bool file_operation, bool multiple_selection, base::CommandLine* command_line); // Call KDialog on the FILE thread and return the results. std::unique_ptr<KDialogOutputParams> CallKDialogOutput( const KDialogParams& params); // Notifies the listener that a single file was chosen. void FileSelected(const base::FilePath& path, void* params); // Notifies the listener that multiple files were chosen. void MultiFilesSelected(const std::vector<base::FilePath>& files, void* params); // Notifies the listener that no file was chosen (the action was canceled). // Dialog is passed so we can find that |params| pointer that was passed to // us when we were told to show the dialog. void FileNotSelected(void* params); void CreateSelectFolderDialog(Type type, const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, void* params); void CreateFileOpenDialog(const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, void* params); void CreateMultiFileOpenDialog(const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, void* params); void CreateSaveAsDialog(const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, void* params); // Common function for OnSelectSingleFileDialogResponse and // OnSelectSingleFolderDialogResponse. void SelectSingleFileHelper(void* params, bool allow_folder, std::unique_ptr<KDialogOutputParams> results); void OnSelectSingleFileDialogResponse( gfx::AcceleratedWidget parent, void* params, std::unique_ptr<KDialogOutputParams> results); void OnSelectMultiFileDialogResponse( gfx::AcceleratedWidget parent, void* params, std::unique_ptr<KDialogOutputParams> results); void OnSelectSingleFolderDialogResponse( gfx::AcceleratedWidget parent, void* params, std::unique_ptr<KDialogOutputParams> results); // Should be either DESKTOP_ENVIRONMENT_KDE3, KDE4, or KDE5. base::nix::DesktopEnvironment desktop_; // The set of all parent windows for which we are currently running // dialogs. This should only be accessed on the UI thread. std::set<gfx::AcceleratedWidget> parents_; // Set to true if the kdialog version is new enough to support passing // multiple extensions with descriptions, eliminating the need for the lossy // conversion of extensions to mime-types. bool kdialog_supports_multiple_extensions_ = false; // A task runner for blocking pipe reads. scoped_refptr<base::SequencedTaskRunner> pipe_task_runner_; SEQUENCE_CHECKER(sequence_checker_); }; // static bool SelectFileDialogImpl::CheckKDEDialogWorksOnUIThread( std::string& kdialog_version) { // No choice. UI thread can't continue without an answer here. Fortunately we // only do this once, the first time a file dialog is displayed. base::ThreadRestrictions::ScopedAllowIO allow_io; base::CommandLine::StringVector cmd_vector; cmd_vector.push_back(kKdialogBinary); cmd_vector.push_back("--version"); base::CommandLine command_line(cmd_vector); return base::GetAppOutput(command_line, &kdialog_version); } // static SelectFileDialogImpl* SelectFileDialogImpl::NewSelectFileDialogImplKDE( Listener* listener, std::unique_ptr<ui::SelectFilePolicy> policy, base::nix::DesktopEnvironment desktop, const std::string& kdialog_version) { return new SelectFileDialogImplKDE(listener, std::move(policy), desktop, kdialog_version); } SelectFileDialogImplKDE::SelectFileDialogImplKDE( Listener* listener, std::unique_ptr<ui::SelectFilePolicy> policy, base::nix::DesktopEnvironment desktop, const std::string& kdialog_version) : SelectFileDialogImpl(listener, std::move(policy)), desktop_(desktop), pipe_task_runner_(base::ThreadPool::CreateSequencedTaskRunner( {base::MayBlock(), base::TaskPriority::USER_BLOCKING, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})) { DCHECK(desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE3 || desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE4 || desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE5); // |kdialog_version| should be of the form "kdialog 1.2.3", so split on // whitespace and then try to parse a version from the second piece. If // parsing fails for whatever reason, we fall back to the behavior that works // with all currently known versions of kdialog. std::vector<base::StringPiece> version_pieces = base::SplitStringPiece( kdialog_version, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); if (version_pieces.size() >= 2) { base::Version parsed_version(version_pieces[1]); if (parsed_version.IsValid()) { kdialog_supports_multiple_extensions_ = parsed_version >= base::Version("19.12"); } } } SelectFileDialogImplKDE::~SelectFileDialogImplKDE() = default; bool SelectFileDialogImplKDE::IsRunning(gfx::NativeWindow parent_window) const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (parent_window && parent_window->GetHost()) { auto window = parent_window->GetHost()->GetAcceleratedWidget(); return parents_.find(window) != parents_.end(); } return false; } // We ignore |default_extension|. void SelectFileDialogImplKDE::SelectFileImpl( Type type, const std::u16string& title, const base::FilePath& default_path, const FileTypeInfo* file_types, int file_type_index, const base::FilePath::StringType& default_extension, gfx::NativeWindow owning_window, void* params) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); type_ = type; gfx::AcceleratedWidget window = gfx::kNullAcceleratedWidget; if (owning_window && owning_window->GetHost()) { // |owning_window| can be null when user right-clicks on a downloadable item // and chooses 'Open Link in New Tab' when 'Ask where to save each file // before downloading.' preference is turned on. (http://crbug.com/29213) window = owning_window->GetHost()->GetAcceleratedWidget(); parents_.insert(window); } std::string title_string = base::UTF16ToUTF8(title); file_type_index_ = file_type_index; if (file_types) file_types_ = *file_types; else file_types_.include_all_files = true; switch (type) { case SELECT_FOLDER: case SELECT_UPLOAD_FOLDER: case SELECT_EXISTING_FOLDER: CreateSelectFolderDialog(type, title_string, default_path, window, params); return; case SELECT_OPEN_FILE: CreateFileOpenDialog(title_string, default_path, window, params); return; case SELECT_OPEN_MULTI_FILE: CreateMultiFileOpenDialog(title_string, default_path, window, params); return; case SELECT_SAVEAS_FILE: CreateSaveAsDialog(title_string, default_path, window, params); return; case SELECT_NONE: NOTREACHED(); return; } } bool SelectFileDialogImplKDE::HasMultipleFileTypeChoicesImpl() { return file_types_.extensions.size() > 1; } std::string SelectFileDialogImplKDE::GetMimeTypeFilterString() { DCHECK(pipe_task_runner_->RunsTasksInCurrentSequence()); if (!kdialog_supports_multiple_extensions_) { // We need a filter set because the same mime type can appear multiple // times. std::set<std::string> filter_set; for (auto& extensions : file_types_.extensions) { for (auto& extension : extensions) { if (!extension.empty()) { std::string mime_type = base::nix::GetFileMimeType( base::FilePath("name").ReplaceExtension(extension)); filter_set.insert(mime_type); } } } std::vector<std::string> filter_vector(filter_set.cbegin(), filter_set.cend()); // Add the *.* filter, but only if we have added other filters (otherwise it // is implied). It needs to be added last to avoid being picked as the // default filter. if (file_types_.include_all_files && !file_types_.extensions.empty()) { DCHECK(filter_set.find("application/octet-stream") == filter_set.end()); filter_vector.push_back("application/octet-stream"); } return base::JoinString(filter_vector, " "); } std::vector<std::string> filters; for (size_t i = 0; i < file_types_.extensions.size(); ++i) { std::set<std::string> extension_filters; for (const auto& extension : file_types_.extensions[i]) { if (extension.empty()) continue; extension_filters.insert(std::string("*.") + extension); } // We didn't find any non-empty extensions to filter on. if (extension_filters.empty()) continue; std::vector<std::string> extension_filters_vector(extension_filters.begin(), extension_filters.end()); std::string description; // The description vector may be blank, in which case we are supposed to // use some sort of default description based on the filter. if (i < file_types_.extension_description_overrides.size()) { description = base::UTF16ToUTF8(file_types_.extension_description_overrides[i]); // Filter out any characters that would mess up kdialog's parsing. base::ReplaceChars(description, "|()", "", &description); } else { // There is no system default filter description so we use // the extensions themselves if the description is blank. description = base::JoinString(extension_filters_vector, ","); } filters.push_back(description + " (" + base::JoinString(extension_filters_vector, " ") + ")"); } if (file_types_.include_all_files && !file_types_.extensions.empty()) filters.push_back(l10n_util::GetStringUTF8(IDS_SAVEAS_ALL_FILES) + " (*)"); return base::JoinString(filters, "|"); } std::unique_ptr<SelectFileDialogImplKDE::KDialogOutputParams> SelectFileDialogImplKDE::CallKDialogOutput(const KDialogParams& params) { DCHECK(pipe_task_runner_->RunsTasksInCurrentSequence()); base::CommandLine::StringVector cmd_vector; cmd_vector.push_back(kKdialogBinary); base::CommandLine command_line(cmd_vector); GetKDialogCommandLine(params.type, params.title, params.default_path, params.parent, params.file_operation, params.multiple_selection, &command_line); auto results = std::make_unique<KDialogOutputParams>(); // Get output from KDialog base::GetAppOutputWithExitCode(command_line, &results->output, &results->exit_code); if (!results->output.empty()) results->output.erase(results->output.size() - 1); return results; } void SelectFileDialogImplKDE::GetKDialogCommandLine( const std::string& type, const std::string& title, const base::FilePath& path, gfx::AcceleratedWidget parent, bool file_operation, bool multiple_selection, base::CommandLine* command_line) { CHECK(command_line); // Attach to the current Chrome window. if (parent != gfx::kNullAcceleratedWidget) { command_line->AppendSwitchNative( desktop_ == base::nix::DESKTOP_ENVIRONMENT_KDE3 ? "--embed" : "--attach", base::NumberToString(static_cast<uint32_t>(parent))); } // Set the correct title for the dialog. if (!title.empty()) command_line->AppendSwitchNative("--title", title); // Enable multiple file selection if we need to. if (multiple_selection) { command_line->AppendSwitch("--multiple"); command_line->AppendSwitch("--separate-output"); } command_line->AppendSwitch(type); // The path should never be empty. If it is, set it to PWD. if (path.empty()) command_line->AppendArgPath(base::FilePath(".")); else command_line->AppendArgPath(path); // Depending on the type of the operation we need, get the path to the // file/folder and set up mime type filters. if (file_operation) command_line->AppendArg(GetMimeTypeFilterString()); VLOG(1) << "KDialog command line: " << command_line->GetCommandLineString(); } void SelectFileDialogImplKDE::FileSelected(const base::FilePath& path, void* params) { if (type_ == SELECT_SAVEAS_FILE) *last_saved_path_ = path.DirName(); else if (type_ == SELECT_OPEN_FILE) *last_opened_path_ = path.DirName(); else if (type_ == SELECT_FOLDER || type_ == SELECT_UPLOAD_FOLDER || type_ == SELECT_EXISTING_FOLDER) *last_opened_path_ = path; else NOTREACHED(); if (listener_) { // What does the filter index actually do? // TODO(dfilimon): Get a reasonable index value from somewhere. listener_->FileSelected(path, 1, params); } } void SelectFileDialogImplKDE::MultiFilesSelected( const std::vector<base::FilePath>& files, void* params) { *last_opened_path_ = files[0].DirName(); if (listener_) listener_->MultiFilesSelected(files, params); } void SelectFileDialogImplKDE::FileNotSelected(void* params) { if (listener_) listener_->FileSelectionCanceled(params); } void SelectFileDialogImplKDE::CreateSelectFolderDialog( Type type, const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, void* params) { int title_message_id = (type == SELECT_UPLOAD_FOLDER) ? IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE : IDS_SELECT_FOLDER_DIALOG_TITLE; pipe_task_runner_->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce( &SelectFileDialogImplKDE::CallKDialogOutput, this, KDialogParams( "--getexistingdirectory", GetTitle(title, title_message_id), default_path.empty() ? *last_opened_path_ : default_path, parent, false, false)), base::BindOnce( &SelectFileDialogImplKDE::OnSelectSingleFolderDialogResponse, this, parent, params)); } void SelectFileDialogImplKDE::CreateFileOpenDialog( const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, void* params) { pipe_task_runner_->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce( &SelectFileDialogImplKDE::CallKDialogOutput, this, KDialogParams( "--getopenfilename", GetTitle(title, IDS_OPEN_FILE_DIALOG_TITLE), default_path.empty() ? *last_opened_path_ : default_path, parent, true, false)), base::BindOnce(&SelectFileDialogImplKDE::OnSelectSingleFileDialogResponse, this, parent, params)); } void SelectFileDialogImplKDE::CreateMultiFileOpenDialog( const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, void* params) { pipe_task_runner_->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce( &SelectFileDialogImplKDE::CallKDialogOutput, this, KDialogParams( "--getopenfilename", GetTitle(title, IDS_OPEN_FILES_DIALOG_TITLE), default_path.empty() ? *last_opened_path_ : default_path, parent, true, true)), base::BindOnce(&SelectFileDialogImplKDE::OnSelectMultiFileDialogResponse, this, parent, params)); } void SelectFileDialogImplKDE::CreateSaveAsDialog( const std::string& title, const base::FilePath& default_path, gfx::AcceleratedWidget parent, void* params) { pipe_task_runner_->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce( &SelectFileDialogImplKDE::CallKDialogOutput, this, KDialogParams("--getsavefilename", GetTitle(title, IDS_SAVE_AS_DIALOG_TITLE), default_path.empty() ? *last_saved_path_ : default_path, parent, true, false)), base::BindOnce(&SelectFileDialogImplKDE::OnSelectSingleFileDialogResponse, this, parent, params)); } void SelectFileDialogImplKDE::SelectSingleFileHelper( void* params, bool allow_folder, std::unique_ptr<KDialogOutputParams> results) { VLOG(1) << "[kdialog] SingleFileResponse: " << results->output; if (results->exit_code || results->output.empty()) { FileNotSelected(params); return; } base::FilePath path(results->output); if (allow_folder) { FileSelected(path, params); return; } if (CallDirectoryExistsOnUIThread(path)) FileNotSelected(params); else FileSelected(path, params); } void SelectFileDialogImplKDE::OnSelectSingleFileDialogResponse( gfx::AcceleratedWidget parent, void* params, std::unique_ptr<KDialogOutputParams> results) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); parents_.erase(parent); SelectSingleFileHelper(params, false, std::move(results)); } void SelectFileDialogImplKDE::OnSelectSingleFolderDialogResponse( gfx::AcceleratedWidget parent, void* params, std::unique_ptr<KDialogOutputParams> results) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); parents_.erase(parent); SelectSingleFileHelper(params, true, std::move(results)); } void SelectFileDialogImplKDE::OnSelectMultiFileDialogResponse( gfx::AcceleratedWidget parent, void* params, std::unique_ptr<KDialogOutputParams> results) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); VLOG(1) << "[kdialog] MultiFileResponse: " << results->output; parents_.erase(parent); if (results->exit_code || results->output.empty()) { FileNotSelected(params); return; } std::vector<base::FilePath> filenames_fp; for (const base::StringPiece& line : base::SplitStringPiece(results->output, "\n", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { base::FilePath path(line); if (CallDirectoryExistsOnUIThread(path)) continue; filenames_fp.push_back(path); } if (filenames_fp.empty()) { FileNotSelected(params); return; } MultiFilesSelected(filenames_fp, params); } } // namespace gtk
// Copyright (c) 2016, Baidu.com, Inc. All Rights Reserved // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "unit_test.h" #include "protocol/galaxy.pb.h" #include "agent/volum/tmpfs_volum.h" #include "agent/volum/volum.h" #include "agent/util/path_tree.h" #ifdef TEST_TMPFS_VOLUM_ON class TestTmpfsVolum : public testing::Test { protected: static void SetUpTestCase() { baidu::galaxy::path::SetRootPath("/home/galaxy"); } static void TearDownTestCase() { } }; TEST_F(TestTmpfsVolum, Construct) { baidu::galaxy::volum::TmpfsVolum volum; volum.SetContainerId("container_id"); boost::shared_ptr<baidu::galaxy::proto::VolumRequired> vr(new baidu::galaxy::proto::VolumRequired); vr->set_dest_path("/home/tmpfs"); vr->set_exclusive(false); vr->set_medium(baidu::galaxy::proto::kTmpfs); vr->set_use_symlink(false); vr->set_size(1024 * 1024 * 1024); vr->set_type(baidu::galaxy::proto::kEmptyDir); volum.SetDescription(vr); EXPECT_EQ(0, volum.Construct().Code()); } #endif
/* file: low_order_moments_csr_sum_batch_fpt_dispatcher.cpp */ /******************************************************************************* * Copyright 2014-2018 Intel Corporation * All Rights Reserved. * * If this software was obtained under the Intel Simplified Software License, * the following terms apply: * * The source code, information and material ("Material") contained herein is * owned by Intel Corporation or its suppliers or licensors, and title to such * Material remains with Intel Corporation or its suppliers or licensors. The * Material contains proprietary information of Intel or its suppliers and * licensors. The Material is protected by worldwide copyright laws and treaty * provisions. No part of the Material may be used, copied, reproduced, * modified, published, uploaded, posted, transmitted, distributed or disclosed * in any way without Intel's prior express written permission. No license under * any patent, copyright or other intellectual property rights in the Material * is granted to or conferred upon you, either expressly, by implication, * inducement, estoppel or otherwise. Any license under such intellectual * property rights must be express and approved by Intel in writing. * * Unless otherwise agreed by Intel in writing, you may not remove or alter this * notice or any other notice embedded in Materials by Intel or Intel's * suppliers or licensors in any way. * * * If this software was obtained under the Apache License, Version 2.0 (the * "License"), the following terms apply: * * You may not use this file except in compliance with the License. You may * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ /* //++ // Instantiation of batch low order moments algorithm container. //-- */ #include "low_order_moments_container.h" namespace daal { namespace algorithms { namespace interface1 { __DAAL_INSTANTIATE_DISPATCH_CONTAINER(low_order_moments::BatchContainer, batch, DAAL_FPTYPE, low_order_moments::sumCSR) } } }
/* See LICENSE file in root folder */ #include "PrecompiledHeader.h" #include "ConfigFile.h" #include "MuseFile.h" #include "ScriptNode.h" //#include "ElypseController.h" #include "DownloadManager.h" #include "ElypseLogs.h" namespace Elypse::Data { void ConfigFileDeleter::operator()( ConfigFile * ptr )const noexcept { delete ptr; } ConfigFile::ConfigFile( MuseFile & p_owner ) : ConfigFile( String(), p_owner ) { } ConfigFile::ConfigFile( String const & p_name, MuseFile & p_owner ) : named( p_name ) , owned_by( p_owner ) , m_useCount( 0 ) , m_downloaded( false ) { } ConfigFile::~ConfigFile() { } void ConfigFile::Use() { if ( !m_useCount ) { DoLoad(); } m_useCount++; } void ConfigFile::Release() { m_useCount--; } void ConfigFile::DownloadFinished() { auto l_lock = make_unique_lock( m_mutex ); m_downloaded = true; } String ConfigFile::GetDescriptiveName()const { return GetOwner()->GetName() + " > " + m_name; } void ConfigFile::DoLoad() { auto l_lock = make_unique_lock( m_mutex ); EMUSE_CONSOLE_MESSAGE_DEBUG( "ConfigFile::Load - " + m_name + "\n" ); if ( !m_downloaded ) { m_mutex.unlock(); GetOwner()->WaitForFile( m_name, true ); m_mutex.lock(); } EMUSE_CONSOLE_MESSAGE_DEBUG( "ConfigFile::Loaded - " + m_name + "\n" ); } }
#include <cmath> #include "VoxelWrapper.h" namespace Mn = Magnum; namespace Cr = Corrade; namespace esp { namespace geo { #ifdef ESP_BUILD_WITH_VHACD VoxelWrapper::VoxelWrapper(const std::string& renderAssetHandle, esp::scene::SceneNode* sceneNode, esp::assets::ResourceManager& resourceManager_, int resolution = 1000000) : SceneNode(sceneNode) { std::string voxelGridHandle = renderAssetHandle + "_" + std::to_string(resolution); // check for existence of specified VoxelGrid if (resourceManager_.voxelGridExists( voxelGridHandle)) { // if it exists, simply point the wrapper to it. voxelGrid = resourceManager_.getVoxelGrid(voxelGridHandle); } else { // if not, create a new voxel std::unique_ptr<esp::assets::MeshData> objMesh = esp::assets::MeshData::create_unique(); objMesh = resourceManager_.createJoinedCollisionMesh(renderAssetHandle); voxelGrid = std::make_shared<VoxelGrid>(*objMesh.get(), renderAssetHandle, resolution); assert(resourceManager_.registerVoxelGrid(voxelGridHandle, voxelGrid)); } } #endif VoxelWrapper::VoxelWrapper(const std::string& handle, esp::scene::SceneNode* sceneNode, esp::assets::ResourceManager& resourceManager_, Mn::Vector3& voxelSize, Mn::Vector3i& voxelDimensions) : SceneNode(sceneNode) { int resolution = voxelDimensions[0] * voxelDimensions[1] * voxelDimensions[2]; std::string voxelGridHandle = handle + "_" + std::to_string(resolution); // check for existence of specified VoxelGrid if (resourceManager_.voxelGridExists( voxelGridHandle)) { // if it exists, simply point the wrapper to it. voxelGrid = resourceManager_.getVoxelGrid(voxelGridHandle); } else { // if not, create a new voxel voxelGrid = std::make_shared<VoxelGrid>(voxelSize, voxelDimensions); assert(resourceManager_.registerVoxelGrid(voxelGridHandle, voxelGrid)); } } Mn::Vector3i VoxelWrapper::getVoxelIndexFromGlobalCoords( const Mn::Vector3& coords) { // get absolute transform of Rigid Body. Mn::Matrix4 absTransform = SceneNode->Magnum::SceneGraph::AbstractObject< 3, float>::absoluteTransformationMatrix(); Mn::Vector3 transformedCoords = (absTransform.inverted().transformPoint(coords) - voxelGrid->getOffset()) / voxelGrid->getVoxelSize(); // return the coords as Vector3i return Mn::Vector3i(transformedCoords + Mn::Vector3(0.5, 0.5, 0.5)); } Mn::Vector3 VoxelWrapper::getGlobalCoordsFromVoxelIndex( const Mn::Vector3i& index) { Mn::Vector3 globalCoords = voxelGrid->getGlobalCoords(index); Mn::Matrix4 absTransform = SceneNode->Magnum::SceneGraph::AbstractObject< 3, float>::absoluteTransformationMatrix(); return absTransform.transformPoint(globalCoords); } } // namespace geo } // namespace esp
/********************************************************************** Audacity: A Digital Audio Editor MixerToolBar.cpp Dominic Mazzoni *******************************************************************//*! \class MixerToolBar \brief A ToolBar that provides the record and playback volume settings. *//*******************************************************************/ #include "../Audacity.h" // For compilers that support precompilation, includes "wx/wx.h". #include <wx/wxprec.h> #ifndef WX_PRECOMP #include <wx/choice.h> #include <wx/event.h> #include <wx/intl.h> #include <wx/settings.h> #include <wx/sizer.h> #include <wx/statbmp.h> #include <wx/tooltip.h> #endif #include "MixerToolBar.h" #include "../AudacityApp.h" #include "../AColor.h" #include "../AllThemeResources.h" #include "../AudioIO.h" #include "../ImageManipulation.h" #include "../Prefs.h" #include "../Project.h" #include "../Theme.h" #include "../widgets/ASlider.h" IMPLEMENT_CLASS(MixerToolBar, ToolBar); //////////////////////////////////////////////////////////// /// Methods for MixerToolBar //////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE(MixerToolBar, ToolBar) EVT_PAINT(MixerToolBar::OnPaint) EVT_SLIDER(wxID_ANY, MixerToolBar::SetMixer) EVT_CHOICE(wxID_ANY, MixerToolBar::SetMixer) EVT_COMMAND(wxID_ANY, EVT_CAPTURE_KEY, MixerToolBar::OnCaptureKey) END_EVENT_TABLE() //Standard contructor MixerToolBar::MixerToolBar() : ToolBar(MixerBarID, _("Mixer"), wxT("Mixer")) { mInputSliderVolume = 0.0; mOutputSliderVolume = 0.0; } MixerToolBar::~MixerToolBar() { delete mPlayBitmap; delete mRecordBitmap; } void MixerToolBar::Create(wxWindow *parent) { ToolBar::Create(parent); } void MixerToolBar::RecreateTipWindows() { // Hack to make sure they appear on top of other windows mInputSlider->RecreateTipWin(); mOutputSlider->RecreateTipWin(); } void MixerToolBar::Populate() { mPlayBitmap = new wxBitmap(theTheme.Bitmap(bmpSpeaker)); Add(new wxStaticBitmap(this, wxID_ANY, *mPlayBitmap), 0, wxALIGN_CENTER); mOutputSlider = new ASlider(this, wxID_ANY, _("Output Volume"), wxDefaultPosition, wxSize(130, 25)); mOutputSlider->SetScroll(0.1f, 2.0f); mOutputSlider->SetName(_("Slider Output")); Add(mOutputSlider, 0, wxALIGN_CENTER); mRecordBitmap = new wxBitmap(theTheme.Bitmap(bmpMic)); Add(new wxStaticBitmap(this, wxID_ANY, *mRecordBitmap), 0, wxALIGN_CENTER); mInputSlider = new ASlider(this, wxID_ANY, _("Input Volume"), wxDefaultPosition, wxSize(130, 25)); mInputSlider->SetScroll(0.1f, 2.0f); mInputSlider->SetName(_("Slider Input")); Add(mInputSlider, 0, wxALIGN_CENTER); // this bit taken from SelectionBar::Populate() mOutputSlider->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(MixerToolBar::OnFocus), NULL, this); mOutputSlider->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(MixerToolBar::OnFocus), NULL, this); mInputSlider->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(MixerToolBar::OnFocus), NULL, this); mInputSlider->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(MixerToolBar::OnFocus), NULL, this); // Show or hide the input slider based on whether it works mInputSlider->Enable(gAudioIO->InputMixerWorks()); UpdateControls(); // Add a little space Add(2, -1); } //Also from SelectionBar; void MixerToolBar::OnFocus(wxFocusEvent &event) { wxCommandEvent e(EVT_CAPTURE_KEYBOARD); if (event.GetEventType() == wxEVT_KILL_FOCUS) { e.SetEventType(EVT_RELEASE_KEYBOARD); } e.SetEventObject(this); GetParent()->GetEventHandler()->ProcessEvent(e); Refresh(false); event.Skip(); } void MixerToolBar::OnCaptureKey(wxCommandEvent &event) { wxKeyEvent *kevent = (wxKeyEvent *)event.GetEventObject(); int keyCode = kevent->GetKeyCode(); // Pass LEFT/RIGHT/UP/DOWN/PAGEUP/PAGEDOWN through for input/output sliders if (FindFocus() == mOutputSlider && (keyCode == WXK_LEFT || keyCode == WXK_RIGHT || keyCode == WXK_UP || keyCode == WXK_DOWN || keyCode == WXK_PAGEUP || keyCode == WXK_PAGEDOWN)) { return; } if (FindFocus() == mInputSlider && (keyCode == WXK_LEFT || keyCode == WXK_RIGHT || keyCode == WXK_UP || keyCode == WXK_DOWN || keyCode == WXK_PAGEUP || keyCode == WXK_PAGEDOWN)) { return; } event.Skip(); return; } void MixerToolBar::UpdatePrefs() { #if USE_PORTMIXER float inputVolume; float playbackVolume; int inputSource; // Reset the selected source gAudioIO->GetMixer(&inputSource, &inputVolume, &playbackVolume); // Show or hide the input slider based on whether it works mInputSlider->Enable(gAudioIO->InputMixerWorks()); // Layout the toolbar Layout(); // Resize the toolbar to fit the contents Fit(); // And make that size the minimum SetMinSize( wxWindow::GetSizer()->GetMinSize() ); SetSize( GetMinSize() ); // Notify someone that we've changed our size Updated(); #endif // Set label to pull in language change SetLabel(_("Mixer")); // Give base class a chance ToolBar::UpdatePrefs(); } void MixerToolBar::UpdateControls() { #if USE_PORTMIXER float inputVolume; float playbackVolume; int inputSource; // Show or hide the input slider based on whether it works mInputSlider->Enable(gAudioIO->InputMixerWorks()); gAudioIO->GetMixer(&inputSource, &inputVolume, &playbackVolume); if (mOutputSlider->Get() != playbackVolume) { mOutputSlider->Set(playbackVolume); mOutputSliderVolume = playbackVolume; SetToolTips(); } if (mInputSlider->Get() != inputVolume) { mInputSlider->Set(inputVolume); mInputSliderVolume = inputVolume; SetToolTips(); } #endif // USE_PORTMIXER } void MixerToolBar::SetMixer(wxCommandEvent & WXUNUSED(event)) { #if USE_PORTMIXER float inputVolume = mInputSlider->Get(); float outputVolume = mOutputSlider->Get(); float oldIn, oldOut; int inputSource; gAudioIO->GetMixer(&inputSource, &oldIn, &oldOut); gAudioIO->SetMixer(inputSource, inputVolume, outputVolume); mOutputSliderVolume = outputVolume; mInputSliderVolume = inputVolume; SetToolTips(); #endif // USE_PORTMIXER } void MixerToolBar::ShowOutputGainDialog() { mOutputSlider->ShowDialog(); wxCommandEvent e; SetMixer(e); UpdateControls(); } void MixerToolBar::ShowInputGainDialog() { mInputSlider->ShowDialog(); wxCommandEvent e; SetMixer(e); UpdateControls(); } void MixerToolBar::AdjustOutputGain(int adj) { if (adj < 0) { mOutputSlider->Decrease(-adj); } else { mOutputSlider->Increase(adj); } wxCommandEvent e; SetMixer(e); UpdateControls(); } void MixerToolBar::AdjustInputGain(int adj) { if (adj < 0) { mInputSlider->Decrease(-adj); } else { mInputSlider->Increase(adj); } wxCommandEvent e; SetMixer(e); UpdateControls(); } void MixerToolBar::SetToolTips() { #if wxUSE_TOOLTIPS if (mInputSlider->IsEnabled()) { mInputSlider->SetToolTip(wxString::Format( _("Input Volume: %.2f"), mInputSliderVolume)); } else { mInputSlider->SetToolTip( _("Input Volume (Unavailable; use system mixer.)")); } if (mOutputSlider->IsEnabled()) { mOutputSlider->SetToolTip(wxString::Format( _("Output Volume: %.2f%s"), mOutputSliderVolume, gAudioIO->OutputMixerEmulated() ? _(" (emulated)") : wxT(""))); } else { mOutputSlider->SetToolTip( _("Output Volume (Unavailable; use system mixer.)")); } #endif }
/* * Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES) * * This file is part of Orfeo Toolbox * * https://www.orfeo-toolbox.org/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "itkMacro.h" #include "otbProlateInterpolateImageFunction.h" #include "otbImageFileReader.h" #include <fstream> #include "otbImageFileWriter.h" #include "itkResampleImageFilter.h" #include "otbImageFileWriter.h" #include "otbStreamingResampleImageFilter.h" #include "otbWindowedSincInterpolateImageGaussianFunction.h" #include "otbWindowedSincInterpolateImageHammingFunction.h" #include "otbWindowedSincInterpolateImageCosineFunction.h" #include "itkWindowedSincInterpolateImageFunction.h" int otbProlateInterpolateImageFunction(int argc, char* argv[]) { const char* infname = argv[1]; const char* outfname = argv[2]; const char* cosfname = argv[3]; const char* itkcosfname = argv[4]; const char* profname = argv[5]; typedef otb::Image<double, 2> ImageType; typedef otb::ProlateInterpolateImageFunction<ImageType> InterpolatorType; typedef InterpolatorType::ContinuousIndexType ContinuousIndexType; typedef otb::ImageFileReader<ImageType> ReaderType; unsigned int i = 7; std::vector<ContinuousIndexType> indicesList; while (i < static_cast<unsigned int>(argc) && (i + 1) < static_cast<unsigned int>(argc)) { ContinuousIndexType idx; idx[0] = atof(argv[i]); idx[1] = atof(argv[i + 1]); indicesList.push_back(idx); i += 2; } // Instantiating object InterpolatorType::Pointer prolate = InterpolatorType::New(); ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(infname); reader->Update(); prolate->SetInputImage(reader->GetOutput()); prolate->SetRadius(atoi(argv[6])); prolate->Initialize(); std::ofstream file; file.open(outfname); for (std::vector<ContinuousIndexType>::iterator it = indicesList.begin(); it != indicesList.end(); ++it) { file << (*it) << " -> " << prolate->EvaluateAtContinuousIndex((*it)) << std::endl; } file.close(); /**********************************************************/ // typedef otb::ImageFileWriter<ImageType> WriterType; // typedef otb::StreamingResampleImageFilter<ImageType, ImageType, double> StreamingResampleImageFilterType; typedef otb::ImageFileWriter<ImageType> WriterType; typedef itk::ResampleImageFilter<ImageType, ImageType, double> StreamingResampleImageFilterType; WriterType::Pointer prowriter = WriterType::New(); StreamingResampleImageFilterType::Pointer proresampler = StreamingResampleImageFilterType::New(); InterpolatorType::Pointer pro = InterpolatorType::New(); // Resampler connected to input image proresampler->SetInput(reader->GetOutput()); pro->SetInputImage(reader->GetOutput()); pro->SetRadius(atoi(argv[6])); pro->Initialize(); proresampler->SetInterpolator(pro); StreamingResampleImageFilterType::SizeType size; size[0] = 512; size[1] = 512; double tutu = 1; proresampler->SetSize(size); proresampler->SetOutputSpacing(tutu); // Result of resampler is written prowriter->SetInput(proresampler->GetOutput()); // prowriter->SetNumberOfDivisionsStrippedStreaming(1); prowriter->SetFileName(profname); prowriter->Update(); typedef otb::WindowedSincInterpolateImageCosineFunction<ImageType> CosInterpolatorType; typedef itk::Function::CosineWindowFunction<1, double, double> itkCosType; typedef itk::WindowedSincInterpolateImageFunction<ImageType, 1, itkCosType> itkCosInterpolatorType; WriterType::Pointer itkcoswriter = WriterType::New(); WriterType::Pointer coswriter = WriterType::New(); StreamingResampleImageFilterType::Pointer cosresampler = StreamingResampleImageFilterType::New(); StreamingResampleImageFilterType::Pointer itkcosresampler = StreamingResampleImageFilterType::New(); CosInterpolatorType::Pointer cos = CosInterpolatorType::New(); itkCosInterpolatorType::Pointer itkcos = itkCosInterpolatorType::New(); cosresampler->SetSize(size); cosresampler->SetOutputSpacing(tutu); itkcosresampler->SetSize(size); itkcosresampler->SetOutputSpacing(tutu); cosresampler->SetInput(reader->GetOutput()); cos->SetInputImage(reader->GetOutput()); cos->SetRadius(atoi(argv[6])); cos->Initialize(); cosresampler->SetInterpolator(cos); itkcosresampler->SetInput(reader->GetOutput()); itkcosresampler->SetInterpolator(itkcos); coswriter->SetInput(cosresampler->GetOutput()); coswriter->SetFileName(cosfname); itkcoswriter->SetInput(itkcosresampler->GetOutput()); itkcoswriter->SetFileName(itkcosfname); coswriter->Update(); itkcoswriter->Update(); return EXIT_SUCCESS; }
#include "Tweaks/HideClassesOnCharList.hpp" #include "Services/Hooks/Hooks.hpp" #include "API/CAppManager.hpp" #include "API/CNWSCreature.hpp" #include "API/CNWSMessage.hpp" #include "API/CServerExoApp.hpp" #include "API/Functions.hpp" #include "API/Globals.hpp" namespace Tweaks { using namespace NWNXLib; using namespace NWNXLib::API; HideClassesOnCharList::HideClassesOnCharList(ViewPtr<Services::HooksProxy> hooker) { hooker->RequestExclusiveHook<API::Functions::_ZN11CNWSMessage49SendServerToPlayerPlayModuleCharacterListResponseEjji> (&SendServerToPlayerPlayModuleCharacterListResponseHook); } int32_t HideClassesOnCharList::SendServerToPlayerPlayModuleCharacterListResponseHook( CNWSMessage* thisPtr, Types::PlayerID playerId, Types::ObjectID charId, int32_t add) { thisPtr->CreateWriteMessage(sizeof(playerId), playerId, true); thisPtr->WriteBOOL(add); thisPtr->WriteDWORD(charId, 32); if (add) { CNWSCreature* creature = Globals::AppManager()->m_pServerExoApp->GetCreatureByGameObjectID(charId); if (creature) { thisPtr->WriteCExoLocStringServer(creature->GetFirstName(), creature->GetGender()); thisPtr->WriteCExoLocStringServer(creature->GetLastName(), creature->GetGender()); uint16_t portraitId = creature->GetPortraitId(); thisPtr->WriteWORD(portraitId, 16); if (portraitId >= 0xFFFE) { thisPtr->WriteCResRef(creature->GetPortrait(), 16); } thisPtr->WriteBYTE(0, 8); } else { return 0; } } uint8_t* message; uint32_t size; if (!thisPtr->GetWriteMessage(&message, &size)) { return 0; } return thisPtr->SendServerToPlayerMessage(playerId, 0x31, 0x03, message, size); } }
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ #include "hphp/runtime/vm/jit/irgen-types.h" #include "hphp/runtime/base/type-structure.h" #include "hphp/runtime/base/type-structure-helpers.h" #include "hphp/runtime/base/type-structure-helpers-defs.h" #include "hphp/runtime/vm/repo-global-data.h" #include "hphp/runtime/vm/runtime.h" #include "hphp/runtime/vm/super-inlining-bros.h" #include "hphp/runtime/vm/jit/is-type-struct-profile.h" #include "hphp/runtime/vm/jit/guard-constraint.h" #include "hphp/runtime/vm/jit/target-profile.h" #include "hphp/runtime/vm/jit/type.h" #include "hphp/runtime/vm/jit/ir-opcode.h" #include "hphp/runtime/vm/jit/irgen-exit.h" #include "hphp/runtime/vm/jit/irgen-interpone.h" #include "hphp/runtime/vm/jit/irgen-builtin.h" #include "hphp/runtime/vm/jit/irgen-internal.h" namespace HPHP::jit::irgen { namespace { ////////////////////////////////////////////////////////////////////// const StaticString s_StringishObject("StringishObject"), s_Awaitable("HH\\Awaitable"), s_CLASS_TO_STRING_IMPLICIT(Strings::CLASS_TO_STRING_IMPLICIT), s_CLASS_TO_CLASSNAME(Strings::CLASS_TO_CLASSNAME); ////////////////////////////////////////////////////////////////////// /* * Returns a {Cls|Nullptr} suitable for use in instance checks. If knownCls is * not null and is safe to use, that will be returned. Otherwise, className * will be used to look up a class. */ SSATmp* ldClassSafe(IRGS& env, const StringData* className, const Class* knownCls = nullptr) { if (!knownCls) { knownCls = lookupUniqueClass(env, className); } if (knownCls) { return cns(env, knownCls); } return cond( env, [&] (Block* taken) { return gen(env, LdClsCachedSafe, taken, cns(env, className)); }, [&] (SSATmp* cls) { // next return cls; }, [&] { // taken hint(env, Block::Hint::Unlikely); return cns(env, nullptr); } ); } /* * Returns a Bool value indicating if src (which must be <= TObj) is an * instance of the class given in className, or nullptr if we don't have an * efficient translation of the required check. checkCls must be the TCls for * className (but it doesn't have to be constant). */ SSATmp* implInstanceCheck(IRGS& env, SSATmp* src, const StringData* className, SSATmp* checkCls) { assertx(src->isA(TObj)); if (s_Awaitable.get()->isame(className)) { return gen(env, IsWaitHandle, src); } if (s_StringishObject.get()->isame(className)) { return gen(env, HasToString, src); } auto knownCls = checkCls->hasConstVal(TCls) ? checkCls->clsVal() : nullptr; assertx(IMPLIES(knownCls, classIsUniqueOrCtxParent(env, knownCls))); assertx(IMPLIES(knownCls, knownCls->name()->isame(className))); auto const srcType = src->type(); /* * If the value is a specialized object type and we don't have to constrain a * guard to get it, we can avoid emitting runtime checks if we know the * result is true. If we don't know, we still have to emit a runtime check * because src might be a subtype of the specialized type. */ if (srcType < TObj && srcType.clsSpec()) { auto const cls = srcType.clsSpec().cls(); if (!env.irb->constrainValue(src, GuardConstraint(cls).setWeak()) && ((knownCls && cls->classof(knownCls)) || cls->name()->isame(className))) { return cns(env, true); } } // Every case after this point requires knowing things about knownCls. if (knownCls == nullptr) return nullptr; auto const ssaClassName = cns(env, className); auto const objClass = gen(env, LdObjClass, src); if (env.context.kind == TransKind::Profile && !InstanceBits::initted()) { gen(env, ProfileInstanceCheck, cns(env, className)); } else if (env.context.kind == TransKind::Optimize || InstanceBits::initted()) { InstanceBits::init(); if (InstanceBits::lookup(className) != 0) { return gen(env, InstanceOfBitmask, objClass, ssaClassName); } } // If the class is an interface, we can just hit the class's vtable or // interface map and call it a day. if (isInterface(knownCls)) { auto const slot = knownCls->preClass()->ifaceVtableSlot(); if (slot != kInvalidSlot) { assertx(RO::RepoAuthoritative); return gen(env, InstanceOfIfaceVtable, InstanceOfIfaceVtableData{knownCls, true}, objClass); } return gen(env, InstanceOfIface, objClass, ssaClassName); } // If knownCls isn't a normal class, our caller may want to do something // different. return isNormalClass(knownCls) ? gen(env, ExtendsClass, ExtendsClassData{ knownCls }, objClass) : nullptr; } constexpr size_t kNumDataTypes = 17; constexpr std::array<DataType, kNumDataTypes> computeDataTypes() { std::array<DataType, kNumDataTypes> result = {}; size_t index = 0; #define DT(name, value) { \ auto constexpr dt = KindOf##name; \ if (dt == dt_modulo_persistence(dt)) result[index++] = dt; \ } DATATYPES #undef DT #ifdef __clang__ always_assert(index == kNumDataTypes); #endif return result; } constexpr std::array<DataType, kNumDataTypes> kDataTypes = computeDataTypes(); /* * Emit a type-check for the given type-constraint. Since the details can vary * quite a bit depending on what the type-constraint represents, this function * is heavily templatized. * * The lambda parameters are as follows: * * - GetVal: Return the SSATmp of the value to test * - FuncToStr: Emit code to deal with any func to string conversions. * - ClsMethToVec: Emit code to deal with any ClsMeth to array conversions * - Fail: Emit code to deal with the type check failing. * - Callable: Emit code to verify that the given value is callable. * - VerifyCls: Emit code to verify that the given value is an instance of the * given Class. * - Giveup: Called when the type check cannot be resolved statically. Either * PUNT or call a runtime helper to do the check. * * `propCls' should only be non-null for property type-hints, and represents the * runtime class of the object the property belongs to. */ template <typename GetVal, typename GetCtx, typename ClassToStr, typename LazyClassToStr, typename Fail, typename Callable, typename VerifyCls, typename Giveup> void verifyTypeImpl(IRGS& env, const TypeConstraint& tc, bool onlyCheckNullability, SSATmp* propCls, GetVal getVal, GetCtx getCtx, ClassToStr classToStr, LazyClassToStr lazyClassToStr, Fail fail, Callable callable, VerifyCls verifyCls, Giveup giveup) { if (!tc.isCheckable()) return; assertx(!tc.isUpperBound() || RuntimeOption::EvalEnforceGenericsUB != 0); auto const genFail = [&](SSATmp* val, SSATmp* ctx = nullptr) { if (ctx == nullptr) { ctx = tc.isThis() ? propCls ? propCls : getCtx() : cns(env, nullptr); } auto const failHard = RuntimeOption::RepoAuthoritative && !tc.isSoft() && (!tc.isThis() || !tc.couldSeeMockObject()) && (!tc.isUpperBound() || RuntimeOption::EvalEnforceGenericsUB >= 2); return fail(val, ctx, failHard); }; auto const checkOneType = [&](SSATmp* val, AnnotAction result) { auto const valType = val->type(); assertx(valType.isKnownDataType()); auto const valDataType = valType.toDataType(); switch (result) { case AnnotAction::Pass: return; case AnnotAction::Fail: return genFail(val); case AnnotAction::CallableCheck: return callable(val); case AnnotAction::ObjectCheck: break; case AnnotAction::WarnClass: case AnnotAction::ConvertClass: assertx(valType <= TCls); if (!classToStr(val)) return genFail(val); if (result == AnnotAction::WarnClass) { gen(env, RaiseNotice, cns(env, s_CLASS_TO_STRING_IMPLICIT.get())); } return; case AnnotAction::WarnLazyClass: case AnnotAction::ConvertLazyClass: assertx(valType <= TLazyCls); if (!lazyClassToStr(val)) return genFail(val); if (result == AnnotAction::WarnLazyClass) { gen(env, RaiseNotice, cns(env, s_CLASS_TO_STRING_IMPLICIT.get())); } return; case AnnotAction::WarnClassname: assertx(valType <= TCls || valType <= TLazyCls); gen(env, RaiseNotice, cns(env, s_CLASS_TO_CLASSNAME.get())); return; } assertx(result == AnnotAction::ObjectCheck); if (onlyCheckNullability) return; if (!(valType <= TObj)) { if (tc.isResolved()) return genFail(val); // In RepoAuth mode, we can optimize some type aliases and enum types. if (tc.isObject() && RuntimeOption::RepoAuthoritative) { auto const pass = [&]{ auto const ne = tc.namedEntity(); auto const td = ne->getCachedTypeAlias(); if (ne->isPersistentTypeAlias() && td) { if (td->nullable && valType <= TNull) return true; auto const cls = td->klass ? td->klass->name() : nullptr; return annotCompat(valDataType, td->type, cls) == AnnotAction::Pass; } auto const cls = ne->getCachedClass(); if (cls && classHasPersistentRDS(cls) && cls->enumBaseTy()) { auto const type = enumDataTypeToAnnotType(*cls->enumBaseTy()); return annotCompat(valDataType, type, nullptr) == AnnotAction::Pass; } return false; }(); if (pass) { env.irb->constrainValue(val, DataTypeSpecific); return; } } return giveup(); } // At this point, we know that val is a TObj. if (tc.isThis()) { // For this type checks, the class needs to be an exact match. auto const ctxCls = propCls ? propCls : getCtx(); auto const objClass = gen(env, LdObjClass, val); ifThen( env, [&] (Block* taken) { gen(env, JmpZero, taken, gen(env, EqCls, ctxCls, objClass)); }, [&] { hint(env, Block::Hint::Unlikely); genFail(val, ctxCls); } ); return; } // At this point, we know that val is a TObj and that tc is an Object. assertx(tc.isObject()); const StringData* clsName = nullptr; const Class* knownConstraint = nullptr; auto const ne = tc.namedEntity(); auto const td = ne->getCachedTypeAlias(); if (RO::RepoAuthoritative && ne->isPersistentTypeAlias() && td && td->klass) { assertx(classHasPersistentRDS(td->klass)); clsName = td->klass->name(); knownConstraint = td->klass; } else { clsName = tc.typeName(); } auto const checkCls = ldClassSafe(env, clsName, knownConstraint); auto const fastIsInstance = implInstanceCheck(env, val, clsName, checkCls); if (fastIsInstance) { ifThen( env, [&] (Block* taken) { gen(env, JmpZero, taken, fastIsInstance); }, [&] { hint(env, Block::Hint::Unlikely); genFail(val); } ); return; } verifyCls(val, gen(env, LdObjClass, val), checkCls); }; auto const genericVal = getVal(); assertx(genericVal->type() <= TCell); auto const genericValType = genericVal->type(); auto const computeAction = [&](DataType dt) { if (dt == KindOfNull && tc.isNullable()) return AnnotAction::Pass; return annotCompat(dt, tc.type(), tc.typeName()); }; if (genericValType.isKnownDataType()) { auto const dt = genericValType.toDataType(); return checkOneType(genericVal, computeAction(dt)); } auto const options = [&]{ TinyVector<std::pair<DataType, AnnotAction>, kNumDataTypes> result; for (auto const dt : kDataTypes) { auto const type = Type(dt); if (!genericValType.maybe(type)) continue; auto const action = computeAction(dt); if (action == AnnotAction::Fail) continue; result.emplace_back(dt, action); } return result; }(); // TODO(kshaunak): If we were a bit more sophisticated here, we could // merge the cases for certain types, like TVec|TDict, or TArrLike. MultiCond mc{env}; for (auto const& pair : options) { mc.ifTypeThen(genericVal, Type(pair.first), [&](SSATmp* val) { checkOneType(val, pair.second); return cns(env, TBottom); }); } mc.elseDo([&]{ genFail(genericVal); return cns(env, TBottom); }); } Type typeOpToType(IsTypeOp op) { switch (op) { case IsTypeOp::Null: return TInitNull; case IsTypeOp::Int: return TInt; case IsTypeOp::Dbl: return TDbl; case IsTypeOp::Bool: return TBool; case IsTypeOp::Str: return TStr; case IsTypeOp::Keyset: return TKeyset; case IsTypeOp::Obj: return TObj; case IsTypeOp::Res: return TRes; case IsTypeOp::ClsMeth: case IsTypeOp::Func: case IsTypeOp::Class: case IsTypeOp::Vec: case IsTypeOp::Dict: case IsTypeOp::ArrLike: case IsTypeOp::LegacyArrLike: case IsTypeOp::Scalar: not_reached(); } not_reached(); } SSATmp* isScalarImpl(IRGS& env, SSATmp* val) { // The simplifier works fine when val has a known DataType, but do some // checks first in case val has a type like {Int|Str}. auto const scalar = TBool | TInt | TDbl | TStr | TCls | TLazyCls; if (val->isA(scalar)) return cns(env, true); if (!val->type().maybe(scalar)) return cns(env, false); SSATmp* result = nullptr; for (auto t : {TBool, TInt, TDbl, TStr, TCls, TLazyCls}) { auto const is_t = gen(env, ConvBoolToInt, gen(env, IsType, t, val)); result = result ? gen(env, OrInt, result, is_t) : is_t; } return gen(env, ConvIntToBool, result); } const StaticString s_FUNC_CONVERSION(Strings::FUNC_TO_STRING); const StaticString s_FUNC_IS_STRING("Func used in is_string"); const StaticString s_CLASS_CONVERSION(Strings::CLASS_TO_STRING); const StaticString s_CLASS_IS_STRING("Class used in is_string"); const StaticString s_TYPE_STRUCT_NOT_DARR("Type-structure is not a darray"); SSATmp* isStrImpl(IRGS& env, SSATmp* src) { MultiCond mc{env}; mc.ifTypeThen(src, TStr, [&](SSATmp*) { return cns(env, true); }); mc.ifTypeThen(src, TLazyCls, [&](SSATmp*) { if (RuntimeOption::EvalClassIsStringNotices) { gen(env, RaiseNotice, cns(env, s_CLASS_IS_STRING.get())); } return cns(env, true); }); mc.ifTypeThen(src, TCls, [&](SSATmp*) { if (RuntimeOption::EvalClassIsStringNotices) { gen(env, RaiseNotice, cns(env, s_CLASS_IS_STRING.get())); } return cns(env, true); }); return mc.elseDo([&]{ return cns(env, false); }); } SSATmp* isClassImpl(IRGS& env, SSATmp* src) { MultiCond mc{env}; mc.ifTypeThen(src, TLazyCls, [&](SSATmp*) { return cns(env, true); }); mc.ifTypeThen(src, TCls, [&](SSATmp*) { return cns(env, true); }); return mc.elseDo([&]{ return cns(env, false); }); } SSATmp* isFuncImpl(IRGS& env, SSATmp* src) { MultiCond mc{env}; mc.ifTypeThen(src, TFunc, [&](SSATmp* func) { auto const attr = AttrData { AttrIsMethCaller }; auto const isMC = gen(env, FuncHasAttr, attr, func); return gen(env, EqBool, isMC, cns(env, false)); }); mc.ifTypeThen(src, TRFunc, [&](SSATmp*) { return cns(env, true); }); return mc.elseDo([&]{ return cns(env, false); }); } SSATmp* isClsMethImpl(IRGS& env, SSATmp* src) { MultiCond mc{env}; mc.ifTypeThen(src, TClsMeth, [&](SSATmp*) { return cns(env, true); }); mc.ifTypeThen(src, TRClsMeth, [&](SSATmp*) { return cns(env, true); }); return mc.elseDo([&]{ return cns(env, false); }); } SSATmp* isVecImpl(IRGS& env, SSATmp* src) { MultiCond mc{env}; mc.ifTypeThen(src, TVec, [&](SSATmp* src) { return cns(env, true); }); return mc.elseDo([&]{ return cns(env, false); }); } SSATmp* isDictImpl(IRGS& env, SSATmp* src) { MultiCond mc{env}; mc.ifTypeThen(src, TDict, [&](SSATmp* src) { return cns(env, true); }); return mc.elseDo([&]{ return cns(env, false); }); } SSATmp* isArrLikeImpl(IRGS& env, SSATmp* src) { MultiCond mc{env}; return mc.elseDo([&]{ return gen(env, IsType, TArrLike, src); }); } SSATmp* isLegacyArrLikeImpl(IRGS& env, SSATmp* src) { MultiCond mc{env}; mc.ifTypeThen(src, TVec|TDict, [&](SSATmp* src) { return gen(env, IsLegacyArrLike, src); }); return mc.elseDo([&]{ return cns(env, false); }); } ////////////////////////////////////////////////////////////////////// } SSATmp* implInstanceOfD(IRGS& env, SSATmp* src, const StringData* className) { /* * InstanceOfD is always false if it's not an object. * * We're prepared to generate translations for known non-object types, but if * it's Gen/Cell we're going to PUNT because it's natural to translate that * case with control flow TODO(#16781576) */ if (TObj < src->type()) { PUNT(InstanceOfD_MaybeObj); } if (!src->isA(TObj)) { if (src->isA(TCls | TLazyCls)) { if (!interface_supports_string(className)) return cns(env, false); if (RuntimeOption::EvalClassIsStringNotices && src->isA(TCls)) { gen( env, RaiseNotice, cns(env, s_CLASS_IS_STRING.get()) ); } return cns(env, true); } auto const res = (src->isA(TArrLike) && interface_supports_arrlike(className)) || (src->isA(TStr) && interface_supports_string(className)) || (src->isA(TInt) && interface_supports_int(className)) || (src->isA(TDbl) && interface_supports_double(className)); return cns(env, res); } auto const checkCls = ldClassSafe(env, className); if (auto isInstance = implInstanceCheck(env, src, className, checkCls)) { return isInstance; } return gen(env, InstanceOf, gen(env, LdObjClass, src), checkCls); } ////////////////////////////////////////////////////////////////////// void emitInstanceOfD(IRGS& env, const StringData* className) { auto const src = popC(env); push(env, implInstanceOfD(env, src, className)); decRef(env, src); } void emitInstanceOf(IRGS& env) { auto const t1 = popC(env); auto const t2 = popC(env); // t2 instanceof t1 if (t1->isA(TObj) && t2->isA(TObj)) { auto const c2 = gen(env, LdObjClass, t2); auto const c1 = gen(env, LdObjClass, t1); push(env, gen(env, InstanceOf, c2, c1)); decRef(env, t2); decRef(env, t1); return; } if (!t1->isA(TStr)) PUNT(InstanceOf-NotStr); if (t2->isA(TObj)) { auto const c1 = gen(env, LookupClsRDS, t1); auto const c2 = gen(env, LdObjClass, t2); push(env, gen(env, InstanceOf, c2, c1)); decRef(env, t2); decRef(env, t1); return; } auto const res = [&]() -> SSATmp* { if (t2->isA(TArrLike)) return gen(env, InterfaceSupportsArrLike, t1); if (t2->isA(TInt)) return gen(env, InterfaceSupportsInt, t1); if (t2->isA(TStr)) return gen(env, InterfaceSupportsStr, t1); if (t2->isA(TDbl)) return gen(env, InterfaceSupportsDbl, t1); if (t2->isA(TCls)) { if (!RO::EvalRaiseClassConversionWarning) { return gen(env, InterfaceSupportsStr, t1); } return cond( env, [&] (Block* taken) { gen(env, JmpZero, taken, gen(env, InterfaceSupportsStr, t1)); }, [&] { gen(env, RaiseNotice, cns(env, s_CLASS_CONVERSION.get())); return cns(env, true); }, [&] { return cns(env, false); } ); } if (!t2->type().maybe(TObj|TArrLike|TInt|TStr|TDbl)) return cns(env, false); return nullptr; }(); if (!res) PUNT(InstanceOf-Unknown); push(env, res); decRef(env, t2); decRef(env, t1); } void emitIsLateBoundCls(IRGS& env) { auto const cls = curClass(env); if (!cls) PUNT(IsLateBoundCls-NoClassContext); if (isTrait(cls)) PUNT(IsLateBoundCls-Trait); auto const obj = popC(env); if (obj->isA(TObj)) { auto const rhs = ldCtxCls(env); auto const lhs = gen(env, LdObjClass, obj); push(env, gen(env, InstanceOf, lhs, rhs)); } else if (!obj->type().maybe(TObj)) { push(env, cns(env, false)); } else { PUNT(IsLateBoundCls-MaybeObject); } decRef(env, obj); } namespace { template<typename F> SSATmp* resolveTypeStructureAndCacheInRDS( IRGS& env, F resolveTypeStruct, bool typeStructureCouldBeNonStatic ) { if (typeStructureCouldBeNonStatic) return resolveTypeStruct(); auto const handle = rds::alloc<TypedValue>().handle(); auto const data = RDSHandleAndType { handle, TDict }; auto const addr = gen(env, LdRDSAddr, data, TPtrToOther); ifThen( env, [&] (Block* taken) { gen(env, CheckRDSInitialized, taken, RDSHandleData { handle }); }, [&] { hint(env, Block::Hint::Unlikely); gen(env, StMem, addr, resolveTypeStruct()); gen(env, MarkRDSInitialized, RDSHandleData { handle }); } ); return gen(env, LdMem, TDict, addr); } SSATmp* resolveTypeStructImpl( IRGS& env, bool typeStructureCouldBeNonStatic, bool suppress, uint32_t n, bool isOrAsOp ) { auto const declaringCls = curFunc(env) ? curClass(env) : nullptr; auto const calledCls = declaringCls && typeStructureCouldBeNonStatic ? ldCtxCls(env) : cns(env, nullptr); auto const result = resolveTypeStructureAndCacheInRDS( env, [&] { return gen( env, ResolveTypeStruct, ResolveTypeStructData { declaringCls, suppress, spOffBCFromIRSP(env), static_cast<uint32_t>(n), isOrAsOp }, sp(env), calledCls ); }, typeStructureCouldBeNonStatic ); popC(env); discard(env, n - 1); return result; } const ArrayData* staticallyResolveTypeStructure( IRGS& env, const ArrayData* ts, bool& partial, bool& invalidType ) { auto const declaringCls = curFunc(env) ? curClass(env) : nullptr; bool persistent = false; // This shouldn't do a difference, but does on GCC 8.3 on Ubuntu 19.04; // if we take the catch then return `ts`, it's a bogus value and we // segfault... sometimes... const ArrayData* ts_copy = ts; try { auto newTS = TypeStructure::resolvePartial( ArrNR(ts), nullptr, declaringCls, persistent, partial, invalidType); if (persistent) return ArrayData::GetScalarArray(std::move(newTS)); } catch (Exception& e) {} // We are here because either we threw in the resolution or it wasn't // persistent resolution which means we didn't really resolve it partial = true; return ts_copy; } SSATmp* check_nullable(IRGS& env, SSATmp* res, SSATmp* var) { return cond( env, [&] (Block* taken) { gen(env, JmpNZero, taken, res); }, [&] { return gen(env, IsType, TNull, var); }, [&] { return cns(env, true); } ); }; void chain_is_type(IRGS& env, SSATmp* c, bool nullable, Type ty) { always_assert(false); } template<typename... Types> void chain_is_type(IRGS& env, SSATmp* c, bool nullable, Type ty1, Type ty2, Types&&... rest) { ifThenElse( env, [&](Block* taken) { auto const res = gen(env, IsType, ty1, c); gen(env, JmpNZero, taken, res); }, [&] { if (sizeof...(rest) == 0) { auto const res = gen(env, IsType, ty2, c); push(env, nullable ? check_nullable(env, res, c) : res); } else { chain_is_type(env, c, nullable, ty2, rest...); } }, [&] { // taken block push(env, cns(env, true)); } ); }; /* * This function tries to emit is type struct operations without resolving * the type structure when that's possible. * When it returns true, it has popped two values from the stack, namely the * type structure and the cell, and pushed one value back to stack, namely * true/false if it is an is-operation or the cell if it is an as operation. * This function does not modify the reference counts of these stack values, * leaving that responsibility to the caller. * When it returns false, it does not modify anything. */ bool emitIsTypeStructWithoutResolvingIfPossible( IRGS& env, const ArrayData* ts ) { // Top of the stack is the type structure, so the thing we are checking is // the next element auto const t = topC(env, BCSPRelOffset { 1 }); auto const is_nullable_ts = is_ts_nullable(ts); auto const cnsResult = [&] (bool value) { popC(env); // pop the ts that's on the stack popC(env); // pop the cell push(env, cns(env, value)); return true; }; auto const success = [&] { return cnsResult(true); }; auto const fail = [&] { return cnsResult(false); }; auto const primitive = [&] (Type ty, bool should_negate = false) { auto const nty = is_nullable_ts ? ty|TNull : ty; if (t->isA(nty)) return should_negate ? fail() : success(); if (!t->type().maybe(nty)) return should_negate ? success() : fail(); popC(env); // pop the ts that's on the stack auto const c = popC(env); auto const res = gen(env, should_negate ? IsNType : IsType, ty, c); push(env, is_nullable_ts ? check_nullable(env, res, c) : res); return true; }; // We explicitly bind is_nullable_ts because failing to do so causes a // spurious compiler error on some g++ versions. auto const unionOf = [&,is_nullable_ts] (Type ty1, Type ty2, auto&&... rest) { auto const ty = Type::unionAll(ty1, ty2, rest...) | (is_nullable_ts ? TNull : TBottom); if (t->isA(ty)) return success(); if (!t->type().maybe(ty)) return fail(); popC(env); // pop the ts that's on the stack auto const c = popC(env); chain_is_type(env, c, is_nullable_ts, ty1, ty2, rest...); return true; }; if (t->isA(TNull) && is_nullable_ts) return success(); auto kind = get_ts_kind(ts); switch (kind) { case TypeStructure::Kind::T_int: return primitive(TInt); case TypeStructure::Kind::T_bool: return primitive(TBool); case TypeStructure::Kind::T_float: return primitive(TDbl); case TypeStructure::Kind::T_string: { if (t->type().maybe(TLazyCls) && RuntimeOption::EvalClassIsStringNotices) { ifElse(env, [&] (Block* taken) { gen(env, CheckType, TLazyCls, taken, t); }, [&] { gen(env, RaiseNotice, cns(env, s_CLASS_IS_STRING.get())); } ); } if (t->type().maybe(TCls) && RuntimeOption::EvalClassIsStringNotices) { ifElse(env, [&] (Block* taken) { gen(env, CheckType, TCls, taken, t); }, [&] { gen(env, RaiseNotice, cns(env, s_CLASS_IS_STRING.get())); } ); } return unionOf(TStr, TLazyCls, TCls); } case TypeStructure::Kind::T_null: return primitive(TNull); case TypeStructure::Kind::T_void: return primitive(TNull); case TypeStructure::Kind::T_keyset: return primitive(TKeyset); case TypeStructure::Kind::T_nonnull: return primitive(TNull, true); case TypeStructure::Kind::T_mixed: case TypeStructure::Kind::T_dynamic: return success(); case TypeStructure::Kind::T_num: return unionOf(TInt, TDbl); case TypeStructure::Kind::T_arraykey: { if (t->type().maybe(TLazyCls) && RuntimeOption::EvalClassIsStringNotices) { ifElse(env, [&] (Block* taken) { gen(env, CheckType, TLazyCls, taken, t); }, [&] { gen(env, RaiseNotice, cns(env, s_CLASS_IS_STRING.get())); } ); } if (t->type().maybe(TCls) && RuntimeOption::EvalClassIsStringNotices) { ifElse(env, [&] (Block* taken) { gen(env, CheckType, TCls, taken, t); }, [&] { gen(env, RaiseNotice, cns(env, s_CLASS_IS_STRING.get())); } ); } return unionOf(TInt, TStr, TLazyCls, TCls); } case TypeStructure::Kind::T_any_array: return unionOf(TVec, TDict, TKeyset); case TypeStructure::Kind::T_vec_or_dict: case TypeStructure::Kind::T_varray_or_darray: case TypeStructure::Kind::T_dict: case TypeStructure::Kind::T_vec: case TypeStructure::Kind::T_darray: case TypeStructure::Kind::T_varray: { popC(env); // pop the ts that's on the stack auto const c = popC(env); auto const res = [&]{ if (kind == TypeStructure::Kind::T_dict || kind == TypeStructure::Kind::T_darray) { return isDictImpl(env, c); } else if (kind == TypeStructure::Kind::T_vec || kind == TypeStructure::Kind::T_varray) { return isVecImpl(env, c); } else { assertx(kind == TypeStructure::Kind::T_vec_or_dict || kind == TypeStructure::Kind::T_varray_or_darray); return cond( env, [&](Block* taken) { gen(env, JmpZero, taken, isVecImpl(env, c)); }, [&] { return cns(env, true); }, [&] { return isDictImpl(env, c); } ); } }(); push(env, is_nullable_ts ? check_nullable(env, res, c) : res); return true; } case TypeStructure::Kind::T_class: case TypeStructure::Kind::T_interface: case TypeStructure::Kind::T_xhp: { auto const clsname = get_ts_classname(ts); auto cls = lookupUniqueClass(env, clsname); if (ts->exists(s_generic_types) && ((classIsPersistentOrCtxParent(env, cls) && cls->hasReifiedGenerics()) || !isTSAllWildcards(ts))) { // If it is a reified class or has non wildcard generics, // we need to bail return false; } popC(env); // pop the ts that's on the stack auto const c = popC(env); auto const res = implInstanceOfD(env, c, clsname); push(env, is_nullable_ts ? check_nullable(env, res, c) : res); return true; } case TypeStructure::Kind::T_nothing: case TypeStructure::Kind::T_noreturn: return fail(); case TypeStructure::Kind::T_typevar: case TypeStructure::Kind::T_fun: case TypeStructure::Kind::T_trait: // Not supported, will throw an error on these at the resolution phase return false; case TypeStructure::Kind::T_enum: case TypeStructure::Kind::T_tuple: case TypeStructure::Kind::T_shape: case TypeStructure::Kind::T_typeaccess: case TypeStructure::Kind::T_unresolved: case TypeStructure::Kind::T_resource: case TypeStructure::Kind::T_reifiedtype: // TODO(T28423611): Implement these return false; } not_reached(); } /* * shouldDefRef is set iff the resulting SSATmp is a newly allocated type * structure * This function does not modify the reference count of its inputs, leaving that * to the caller */ SSATmp* handleIsResolutionAndCommonOpts( IRGS& env, TypeStructResolveOp op, bool& done, bool& shouldDecRef, bool& checkValid ) { auto const a = topC(env); if (!a->isA(TDict)) PUNT(IsTypeStructC-NotArrayTypeStruct); if (!a->hasConstVal(TDict)) { if (op == TypeStructResolveOp::Resolve) { return resolveTypeStructImpl(env, true, true, 1, true); } shouldDecRef = false; checkValid = true; return popC(env); } auto const ts = a->arrLikeVal(); auto maybe_resolved = ts; bool partial = true; bool invalidType = true; if (op == TypeStructResolveOp::Resolve) { maybe_resolved = staticallyResolveTypeStructure(env, ts, partial, invalidType); shouldDecRef = maybe_resolved != ts; } if (emitIsTypeStructWithoutResolvingIfPossible(env, maybe_resolved)) { done = true; return nullptr; } if (op == TypeStructResolveOp::Resolve && (partial || invalidType)) { shouldDecRef = true; return resolveTypeStructImpl( env, typeStructureCouldBeNonStatic(ts), true, 1, true); } popC(env); if (op == TypeStructResolveOp::DontResolve) checkValid = true; return cns(env, maybe_resolved); } } // namespace void emitIsTypeStructC(IRGS& env, TypeStructResolveOp op) { auto const a = topC(env); auto const c = topC(env, BCSPRelOffset { 1 }); bool done = false, shouldDecRef = true, checkValid = false; SSATmp* tc = handleIsResolutionAndCommonOpts(env, op, done, shouldDecRef, checkValid); if (done) { decRef(env, c); decRef(env, a); return; } popC(env); auto block = opcodeMayRaise(IsTypeStruct) && shouldDecRef ? create_catch_block(env, [&]{ decRef(env, tc); }) : nullptr; auto const data = RDSHandleData { rds::bindTSCache(curFunc(env)).handle() }; static const StaticString s_IsTypeStruct{"IsTypeStruct"}; auto const profile = TargetProfile<IsTypeStructProfile> { env.context, env.irb->curMarker(), s_IsTypeStruct.get() }; auto const generic = [&] { if (checkValid) gen(env, RaiseErrorOnInvalidIsAsExpressionType, tc); return gen(env, IsTypeStruct, block, data, tc, c); }; auto const finish = [&] (SSATmp* result) { push(env, result); decRef(env, c); decRef(env, a); }; if (profile.profiling()) { gen(env, ProfileIsTypeStruct, RDSHandleData { profile.handle() }, a); finish(generic()); return; } if (!profile.optimizing() || !profile.data().shouldOptimize()) { finish(generic()); return; } finish(cond( env, [&] (Block* taken) { return gen(env, IsTypeStructCached, taken, a, c); }, [&] (SSATmp* result) { // next return result; }, [&] { // taken hint(env, Block::Hint::Unlikely); return generic(); } )); } void emitThrowAsTypeStructException(IRGS& env) { auto const arr = topC(env); auto const c = topC(env, BCSPRelOffset { 1 }); auto const tsAndBlock = [&]() -> std::pair<SSATmp*, Block*> { if (arr->hasConstVal(TDict)) { auto const ts = arr->arrLikeVal(); auto maybe_resolved = ts; bool partial = true, invalidType = true; maybe_resolved = staticallyResolveTypeStructure(env, ts, partial, invalidType); if (!ts->same(maybe_resolved)) { auto const inputTS = cns(env, maybe_resolved); return {inputTS, create_catch_block(env, [&]{ decRef(env, inputTS); })}; } } auto const ts = resolveTypeStructImpl(env, true, false, 1, true); return {ts, nullptr}; }(); // No need to decref inputs as this instruction will throw gen(env, ThrowAsTypeStructException, tsAndBlock.second, tsAndBlock.first, c); } void emitRecordReifiedGeneric(IRGS& env) { auto const ts = popC(env); if (!ts->isA(TVec)) { PUNT(RecordReifiedGeneric-InvalidTS); } // RecordReifiedGenericsAndGetTSList decrefs the ts auto const result = gen(env, RecordReifiedGenericsAndGetTSList, ts); push(env, result); } void emitCombineAndResolveTypeStruct(IRGS& env, uint32_t n) { push(env, resolveTypeStructImpl(env, true, false, n, false)); } void raiseClsmethCompatTypeHint( IRGS& env, int32_t id, const Func* func, const TypeConstraint& tc) { auto name = tc.displayName(func->cls()); if (id == TypeConstraint::ReturnId) { gen(env, RaiseNotice, cns(env, makeStaticString( folly::sformat("class_meth Compat: Value returned from function {}() " "must be of type {}, clsmeth given", func->fullName(), name)))); } else { gen(env, RaiseNotice, cns(env, makeStaticString( folly::sformat("class_meth Compat: Argument {} passed to {}() " "must be of type {}, clsmeth given", id + 1, func->fullName(), name)))); } } namespace { void verifyRetTypeImpl(IRGS& env, int32_t id, int32_t ind, bool onlyCheckNullability) { auto const func = curFunc(env); auto const verifyFunc = [&] (const TypeConstraint& tc) { verifyTypeImpl( env, tc, onlyCheckNullability, nullptr, [&] { // Get value to test return topC(env, BCSPRelOffset { ind }); }, [&] { // Get the context class return ldCtxCls(env); }, [&] (SSATmp* val) { // class to string conversions auto const str = gen(env, LdClsName, val); auto const offset = offsetFromIRSP(env, BCSPRelOffset { ind }); gen(env, StStk, IRSPRelOffsetData{offset}, sp(env), str); env.irb->exceptionStackBoundary(); return true; }, [&] (SSATmp* val) { // lazy class to string conversions auto const str = gen(env, LdLazyClsName, val); auto const offset = offsetFromIRSP(env, BCSPRelOffset { ind }); gen(env, StStk, IRSPRelOffsetData{offset}, sp(env), str); env.irb->exceptionStackBoundary(); return true; }, [&] (SSATmp* val, SSATmp* ctx, bool hard) { // Check failure updateMarker(env); env.irb->exceptionStackBoundary(); auto const updated = gen( env, hard ? VerifyRetFailHard : VerifyRetFail, FuncParamWithTCData { func, id, &tc }, val, ctx ); if (!hard) { auto const offset = offsetFromIRSP(env, BCSPRelOffset { ind }); gen(env, StStk, IRSPRelOffsetData{offset}, sp(env), updated); env.irb->exceptionStackBoundary(); } }, [&] (SSATmp* val) { // Callable check gen( env, VerifyRetCallable, FuncParamData { func, id }, val ); }, [&] (SSATmp* val, SSATmp* objClass, SSATmp* checkCls) { // Class/type-alias check gen( env, VerifyRetCls, FuncParamWithTCData { func, id, &tc }, val, objClass, checkCls ); }, [] { // Giveup PUNT(VerifyReturnType); } ); }; auto const& tc = (id == TypeConstraint::ReturnId) ? func->returnTypeConstraint() : func->params()[id].typeConstraint; assertx(ind >= 0); verifyFunc(tc); if (id == TypeConstraint::ReturnId && func->hasReturnWithMultiUBs()) { auto& ubs = const_cast<Func::UpperBoundVec&>(func->returnUBs()); for (auto& ub : ubs) { applyFlagsToUB(ub, tc); verifyFunc(ub); } } else if (func->hasParamsWithMultiUBs()) { auto& ubs = const_cast<Func::ParamUBMap&>(func->paramUBs()); auto it = ubs.find(id); if (it != ubs.end()) { for (auto& ub : it->second) { applyFlagsToUB(ub, tc); verifyFunc(ub); } } } } void verifyParamTypeImpl(IRGS& env, int32_t id) { auto const func = curFunc(env); auto const verifyFunc = [&](const TypeConstraint& tc) { verifyTypeImpl( env, tc, false, nullptr, [&] { // Get value to test return ldLoc(env, id, DataTypeSpecific); }, [&] { // Get the context class return ldCtxCls(env); }, [&] (SSATmp* val) { // class to string conversions auto const str = gen(env, LdClsName, val); stLocRaw(env, id, fp(env), str); return true; }, [&] (SSATmp* val) { // lazy class to string conversions auto const str = gen(env, LdLazyClsName, val); stLocRaw(env, id, fp(env), str); return true; }, [&] (SSATmp* val, SSATmp* ctx, bool hard) { // Check failure auto const updated = gen( env, hard ? VerifyParamFailHard : VerifyParamFail, FuncParamWithTCData { func, id, &tc }, val, ctx ); if (!hard) { stLocRaw(env, id, fp(env), updated); } }, [&] (SSATmp* val) { // Callable check gen( env, VerifyParamCallable, FuncParamData { func, id }, val ); }, [&] (SSATmp* val, SSATmp* objClass, SSATmp* checkCls) { // Class/type-alias check gen( env, VerifyParamCls, FuncParamWithTCData { func, id, &tc }, val, objClass, checkCls ); }, [] { // Giveup PUNT(VerifyParamType); } ); }; auto const& tc = func->params()[id].typeConstraint; verifyFunc(tc); if (func->hasParamsWithMultiUBs()) { auto& ubs = const_cast<Func::ParamUBMap&>(func->paramUBs()); auto it = ubs.find(id); if (it != ubs.end()) { for (auto& ub : it->second) { applyFlagsToUB(ub, tc); verifyFunc(ub); } } } } } void verifyPropType(IRGS& env, SSATmp* cls, const HPHP::TypeConstraint* tc, const Class::UpperBoundVec* ubs, Slot slot, SSATmp* val, SSATmp* name, bool isSProp, SSATmp** coerce /* = nullptr */) { assertx(cls->isA(TCls)); assertx(val->isA(TCell)); if (coerce) *coerce = val; if (RuntimeOption::EvalCheckPropTypeHints <= 0) return; auto const verifyFunc = [&](const TypeConstraint* tc) { if (!tc || !tc->isCheckable()) return; assertx(tc->validForProp()); auto const giveup = [&] { // Unlike the other type-hint checks, we don't punt here. We instead do // the check using a runtime helper. This gives us the freedom to call // verifyPropType without us worrying about it punting the whole set op. // This check is fragile - which type constraints coerce? auto const data = TypeConstraintData{tc}; auto const sprop = cns(env, isSProp); if (coerce && (tc->isString() || (tc->isObject() && !tc->isResolved()))) { *coerce = gen(env, VerifyPropCoerce, data, cls, cns(env, slot), val, sprop); } else { gen(env, VerifyProp, data, cls, cns(env, slot), val, sprop); } }; // For non-DataTypeSpecific values, verifyTypeImpl handles the different // cases separately. However, our callers want a single coerced value, // which we don't track, so we punt if we're going to split it up. if (!val->type().isKnownDataType()) { return giveup(); } verifyTypeImpl( env, *tc, false, cls, [&] { // Get value to check env.irb->constrainValue(val, DataTypeSpecific); return val; }, [&] { // Get the context class return ldCtxCls(env); }, [&] (SSATmp*) { // class to string automatic conversions if (!coerce) return false; if (RO::EvalCheckPropTypeHints < 3) return false; *coerce = gen(env, LdClsName, val); return true; }, [&] (SSATmp*) { // lazy class to string automatic conversions if (!coerce) return false; if (RO::EvalCheckPropTypeHints < 3) return false; *coerce = gen(env, LdLazyClsName, val); return true; }, [&] (SSATmp*, SSATmp*, bool hard) { // Check failure auto const failHard = hard && RuntimeOption::EvalCheckPropTypeHints >= 3 && (!tc->isUpperBound() || RuntimeOption::EvalEnforceGenericsUB >= 2); gen( env, failHard ? VerifyPropFailHard : VerifyPropFail, TypeConstraintData{ tc }, cls, cns(env, slot), val, cns(env, isSProp) ); }, // We don't allow callable as a property type-hint, so we should never need // to check callability. [&] (SSATmp*) { always_assert(false); }, [&] (SSATmp* v, SSATmp*, SSATmp* checkCls) { // Class/type-alias check gen( env, VerifyPropCls, TypeConstraintData{ tc }, cls, cns(env, slot), checkCls, v, cns(env, isSProp) ); }, giveup ); }; verifyFunc(tc); if (RuntimeOption::EvalEnforceGenericsUB > 0) { for (auto const& ub : *ubs) { verifyFunc(&ub); } } } void verifyMysteryBoxConstraint(IRGS& env, const MysteryBoxConstraint& c, SSATmp* val, Block* fail) { auto const genFail = [&] { gen(env, Jmp, fail); }; UNUSED auto const& valType = val->type(); FTRACE_MOD(Trace::sib, 3, "Verifying constraint {} {}\n", valType.toString(), c.tc.fullName()); verifyTypeImpl( env, c.tc, false, c.propDecl ? cns(env, c.propDecl) : nullptr, [&] { // Get value to test return val; }, [&] { // Get the context class return c.ctx ? cns(env, c.ctx) : cns(env, nullptr); }, [&] (SSATmp*) { // class to string conversions return false; }, [&] (SSATmp*) { // lazy class to string conversions return false; }, [&] (SSATmp*, SSATmp*, bool) { // Check failure genFail(); }, [&] (SSATmp*) { // Callable check genFail(); }, [&] (SSATmp*, SSATmp*, SSATmp*) { genFail(); }, [&] { // Giveup genFail(); } ); } void emitVerifyRetTypeC(IRGS& env) { verifyRetTypeImpl(env, TypeConstraint::ReturnId, 0, false); } void emitVerifyRetTypeTS(IRGS& env) { verifyRetTypeImpl(env, TypeConstraint::ReturnId, 1, false); auto const ts = popC(env); auto const cell = topC(env); auto const reified = tcCouldBeReified(curFunc(env), TypeConstraint::ReturnId); if (reified || cell->isA(TObj)) { auto const funcData = FuncData { curFunc(env) }; gen(env, VerifyReifiedReturnType, funcData, cell, ts, ldCtxCls(env)); } else if (cell->type().maybe(TObj) && !reified) { // Meaning we did not not guard on the stack input correctly PUNT(VerifyRetTypeTS-UnguardedObj); } } void emitVerifyRetNonNullC(IRGS& env) { auto const func = curFunc(env); auto const& tc = func->returnTypeConstraint(); always_assert(!tc.isNullable()); verifyRetTypeImpl(env, TypeConstraint::ReturnId, 0, true); } void emitVerifyOutType(IRGS& env, uint32_t paramId) { verifyRetTypeImpl(env, paramId, 0, false); } void emitVerifyParamType(IRGS& env, int32_t paramId) { verifyParamTypeImpl(env, paramId); } void emitVerifyParamTypeTS(IRGS& env, int32_t paramId) { verifyParamTypeImpl(env, paramId); auto const ts = popC(env); auto const cell = ldLoc(env, paramId, DataTypeSpecific); auto const reified = tcCouldBeReified(curFunc(env), paramId); if (cell->isA(TObj) || reified) { cond( env, [&] (Block* taken) { return gen(env, CheckType, TDict, taken, ts); }, [&] (SSATmp* dts) { auto const fpData = FuncParamData { curFunc(env), paramId }; gen(env, VerifyReifiedLocalType, fpData, cell, dts, ldCtxCls(env)); return nullptr; }, [&] { gen(env, RaiseError, cns(env, s_TYPE_STRUCT_NOT_DARR.get())); return nullptr; } ); } else if (cell->type().maybe(TObj)) { // Meaning we did not not guard on the stack input correctly PUNT(VerifyReifiedLocalType-UnguardedObj); } } void emitOODeclExists(IRGS& env, OODeclExistsOp subop) { auto const tAutoload = topC(env); auto const tCls = topC(env, BCSPRelOffset{1}); if (!tCls->isA(TStr) || !tAutoload->isA(TBool)){ // result of Cast PUNT(OODeclExists-BadTypes); } ClassKind kind; switch (subop) { case OODeclExistsOp::Class: kind = ClassKind::Class; break; case OODeclExistsOp::Trait: kind = ClassKind::Trait; break; case OODeclExistsOp::Interface: kind = ClassKind::Interface; break; } auto const val = gen( env, OODeclExists, ClassKindData { kind }, tCls, tAutoload ); discard(env, 2); push(env, val); decRef(env, tCls); } void emitIssetL(IRGS& env, int32_t id) { auto const ld = ldLoc(env, id, DataTypeSpecific); push(env, gen(env, IsNType, TNull, ld)); } void emitIsUnsetL(IRGS& env, int32_t id) { auto const ld = ldLoc(env, id, DataTypeSpecific); push(env, gen(env, IsType, TUninit, ld)); } SSATmp* isTypeHelper(IRGS& env, IsTypeOp subop, SSATmp* val) { switch (subop) { case IsTypeOp::Vec: return isVecImpl(env, val); case IsTypeOp::Dict: return isDictImpl(env, val); case IsTypeOp::Scalar: return isScalarImpl(env, val); case IsTypeOp::Str: return isStrImpl(env, val); case IsTypeOp::ArrLike: return isArrLikeImpl(env, val); case IsTypeOp::LegacyArrLike: return isLegacyArrLikeImpl(env, val); case IsTypeOp::Class: return isClassImpl(env, val); case IsTypeOp::Func: return isFuncImpl(env, val); case IsTypeOp::ClsMeth: return isClsMethImpl(env, val); default: break; } auto const t = typeOpToType(subop); return t <= TObj ? optimizedCallIsObject(env, val) : gen(env, IsType, t, val); } void emitIsTypeC(IRGS& env, IsTypeOp subop) { auto const val = popC(env, DataTypeSpecific); push(env, isTypeHelper(env, subop, val)); decRef(env, val); } void emitIsTypeL(IRGS& env, NamedLocal loc, IsTypeOp subop) { auto const val = ldLocWarn(env, loc, DataTypeSpecific); push(env, isTypeHelper(env, subop, val)); } ////////////////////////////////////////////////////////////////////// void emitAssertRATL(IRGS& env, int32_t loc, RepoAuthType rat) { assertTypeLocal(env, loc, typeFromRAT(rat, curClass(env))); } void emitAssertRATStk(IRGS& env, uint32_t offset, RepoAuthType rat) { assertTypeStack( env, BCSPRelOffset{safe_cast<int32_t>(offset)}, typeFromRAT(rat, curClass(env)) ); } ////////////////////////////////////////////////////////////////////// }
/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #ifndef SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX #define SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX #include "svtools/table/tableinputhandler.hxx" #include "svtools/table/tabletypes.hxx" #include <boost/scoped_ptr.hpp> //...................................................................................................................... namespace svt { namespace table { //...................................................................................................................... struct DefaultInputHandler_Impl; //================================================================================================================== //= DefaultInputHandler //================================================================================================================== class DefaultInputHandler : public ITableInputHandler { private: ::boost::scoped_ptr< DefaultInputHandler_Impl > m_pImpl; public: DefaultInputHandler(); ~DefaultInputHandler(); virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ); virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ); virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ); virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ); virtual bool GetFocus ( ITableControl& _rControl ); virtual bool LoseFocus ( ITableControl& _rControl ); virtual bool RequestHelp ( ITableControl& _rControl, const HelpEvent& rHEvt ); virtual bool Command ( ITableControl& _rControl, const CommandEvent& rCEvt ); virtual bool PreNotify ( ITableControl& _rControl, NotifyEvent& rNEvt ); virtual bool Notify ( ITableControl& _rControl, NotifyEvent& rNEvt ); }; //...................................................................................................................... } } // namespace svt::table //...................................................................................................................... #endif // SVTOOLS_INC_TABLE_DEFAULTINPUTHANDLER_HXX
/** * \file * \author Karsten Rink * \date no date * \brief Implementation of the DiagramView class. * * \copyright * Copyright (c) 2012-2020, OpenGeoSys Community (http://www.opengeosys.org) * Distributed under a Modified BSD License. * See accompanying file LICENSE.txt or * http://www.opengeosys.org/project/license * */ #include "DiagramView.h" #include <QGraphicsTextItem> #include <math.h> DiagramView::DiagramView(QWidget* parent) : QGraphicsView(parent) { _scene = new DiagramScene(); setScene(_scene); initialize(); } DiagramView::DiagramView(DiagramList* list, QWidget* parent) : QGraphicsView(parent) { _scene = new DiagramScene(list); setScene(_scene); initialize(); } DiagramView::~DiagramView() { delete _scene; } void DiagramView::addGraph(DiagramList* list) { _scene->addGraph(list); update(); } int DiagramView::getHeight() { return static_cast<int>((_scene->itemsBoundingRect()).height()); } int DiagramView::getWidth() { return static_cast<int>((_scene->itemsBoundingRect()).width()); } /** * Initialises the view. */ void DiagramView::initialize() { //QMatrix currentMatrix = matrix(); //setMatrix(currentMatrix * scene->getTransformationMatrix()); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); update(); } /* * Keeps the aspect ration of the labels when the view is resized. * It is only necessary to call this if * Qt::AspectRatioMode == Qt::IgnoreAspectRatio. * Also, this method is kind of annoying because you have to set the * appropriate transform for every single QGraphicsTextItem separately. */ /* void DiagramView::keepItemAspectRatio() { double xFactor = transform().mapRect(QRectF(0, 0, 1, 1)).width(); double yFactor = transform().mapRect(QRectF(0, 0, 1, 1)).height(); QMatrix invertedScaling; invertedScaling.scale(1.0 , xFactor / yFactor); scene->xLabel->setTransform(QTransform(invertedScaling)); scene->yLabel->setTransform(QTransform(invertedScaling)); scene->yLabel->rotate(-90); } */ QSize DiagramView::minimumSizeHint() const { return QSize(3 * DiagramScene::MARGIN, 2 * DiagramScene::MARGIN); } QSize DiagramView::sizeHint() const { return QSize(6 * DiagramScene::MARGIN, 4 * DiagramScene::MARGIN); } void DiagramView::resizeEvent(QResizeEvent* event) { Q_UNUSED (event) update(); //keepItemAspectRatio(); } /** * Updates the view automatically when a new list is added or when * the window containing the view is resized or changes its state. * Basically, the methods makes sure that everything keeps looking * as it is supposed to. */ void DiagramView::update() { //setResizeAnchor(QGraphicsView::AnchorViewCenter); QRectF viewRect = _scene->itemsBoundingRect(); _scene->setSceneRect(viewRect); QRectF sceneInView(0 /*_scene->MARGIN*/, DiagramScene::MARGIN / 2, viewRect.width() /*+_scene->MARGIN*/, viewRect.height() + DiagramScene::MARGIN); fitInView(sceneInView, Qt::IgnoreAspectRatio); }
#pragma once #include "linear_algebra_type_traits.hpp" NAMESPACE_LINEAR_ALGEBRA_BEGIN //specializable struct used for overloading commonly used functions for non-standard types template<class T> struct functions_implementation { static void sqrt(T v); static void abs(T v); static constexpr void epsilon(); }; template<> struct functions_implementation<float> { static inline float sqrt(float v) { return std::sqrt(v); } static inline float abs(float v) { return std::abs(v); } static constexpr inline float epsilon() { return std::numeric_limits<float>::epsilon(); } }; template<> struct functions_implementation<double> { static inline double sqrt(double v) { return std::sqrt(v); } static inline double abs(double v) { return std::abs(v); } static constexpr inline double epsilon() { return std::numeric_limits<double>::epsilon(); } }; template<> struct functions_implementation<long double> { static inline long double sqrt(long double v) { return std::sqrt(v); } static inline long double abs(long double v) { return std::abs(v); } static constexpr inline long double epsilon() { return std::numeric_limits<long double>::epsilon(); } }; template<class T> constexpr bool has_sqrt_implementation_v = std::is_same_v<decltype(functions_implementation<T>::sqrt(std::declval<T>())), T>; template<class T> constexpr bool has_abs_implementation_v = std::is_same_v<decltype(functions_implementation<T>::sqrt(std::declval<T>())), T>; template<class T> constexpr bool has_epsilon_implementation_v = std::is_same_v<decltype(functions_implementation<T>::epsilon()), T>; //flag used for indicating if equality comparisons should be performed accurately (i.e abs(a-b)<=epsilon) constexpr bool use_high_quality_equality_comparison = false; template<class T1, class T2> constexpr bool high_quality_equality_comparable_v = can_be_subtracted_v<T1, T2> && has_epsilon_implementation_v<subtraction_result_t<T1, T2>> && has_abs_implementation_v<subtraction_result_t<T1, T2>> && less_equal_comparable_v<subtraction_result_t<T1, T2>, subtraction_result_t<T1, T2>>; template<class T1, class T2> constexpr bool high_quality_inequality_comparable_v = can_be_subtracted_v<T1, T2> && has_epsilon_implementation_v<subtraction_result_t<T1, T2>> && has_abs_implementation_v<subtraction_result_t<T1, T2>> && greater_comparable_v<subtraction_result_t<T1, T2>, subtraction_result_t<T1, T2>>; template<class T1, class T2, typename = typename std::enable_if_t<use_high_quality_equality_comparison ? high_quality_equality_comparable_v<T1,T2> || equality_comparable_v<T1, T2 > : equality_comparable_v<T1, T2>>> inline bool equal(const T1& a, const T2& b) { if constexpr (use_high_quality_equality_comparison && high_quality_equality_comparable_v<T1, T2>) { return functions_implementation<subtraction_result_t<T1, T2>>::abs(a - b) <= functions_implementation<subtraction_result_t<T1, T2>>::epsilon(); } else { return a == b; } } template<class T1, class T2, typename = typename std::enable_if_t<use_high_quality_equality_comparison ? high_quality_inequality_comparable_v<T1, T2> || inequality_comparable_v<T1, T2 > : inequality_comparable_v<T1, T2>>> inline bool inequal(const T1& a, const T2& b) { if constexpr (use_high_quality_equality_comparison && high_quality_inequality_comparable_v<T1, T2>) { return functions_implementation<subtraction_result_t<T1, T2>>::abs(a - b) > functions_implementation<subtraction_result_t<T1, T2>>::epsilon(); } else { return a != b; } } NAMESPACE_LINEAR_ALGEBRA_END
#pragma once // ddpoly.hpp: Evaluate a polynomial of degree N at point x as well as its ND derivatives // // Copyright (C) 2017-2020 Stillwater Supercomputing, Inc. // // This file is part of the universal numbers project, which is released under an MIT Open Source license. namespace sw { namespace universal { #if defined(__clang__) /* Clang/LLVM. ---------------------------------------------- */ #elif defined(__ICC) || defined(__INTEL_COMPILER) /* Intel ICC/ICPC. ------------------------------------------ */ #elif defined(__GNUC__) || defined(__GNUG__) /* GNU GCC/G++. --------------------------------------------- */ template<typename Scalar> inline size_t size(const std::vector<Scalar>& v) { return v.size(); } #elif defined(__HP_cc) || defined(__HP_aCC) /* Hewlett-Packard C/aC++. ---------------------------------- */ #elif defined(__IBMC__) || defined(__IBMCPP__) /* IBM XL C/C++. -------------------------------------------- */ #elif defined(_MSC_VER) /* Microsoft Visual Studio. --------------------------------- */ #elif defined(__PGI) /* Portland Group PGCC/PGCPP. ------------------------------- */ #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio. ----------------------------------- */ #endif /* pd[0] = c0 + c1*x + c2*x^2 + c3*x^3 pd[1] = c1 + 2*c2*x + 3*c3*x^2 pd[2] = 2*c2 + 3*2*c3*x pd[3] = 3*2*c3 p = c0 + (c1 + c2*x + c3*x^2)*x = c0 + (c1 + (c2 + c3*x)*x)*x p' = c1 + 2*c2*x + 3*c3*x^2 = c1 + (2*c2 + 3*c3*x)*x p'' = 2*c2 + 3*2*c3*x p''' = 3*2*c3 */ // ddpoly evaluate a polynomial of degree N at point x as well as its ND derivatives template<typename Vector, typename Scalar> void ddpoly(const Scalar& x, const Vector& c, Vector& pd) { int N = int(c.size())-1; // c0 + c1*x + c2*x^2, etc., so we have N+1 coefficients for a polynomial of degree N int ND = int(pd.size())-1; // pd[0] is the value of the polynomial at x, and pd[1..ND] are the derivatives at x for (auto&& v : pd) v = Scalar(0); pd[0] = c[N]; for (int i = N-1; i >= 0; --i) { int nnd = (ND < (N - i) ? ND : N - i); for (int j = nnd; j >= 1; --j) { pd[j] = pd[j] * x + pd[j - 1]; //std::cout << "pd[" << j << "] = " << pd[j] << std::endl; } pd[0] = pd[0] * x + c[i]; } // after the first derivative, factorial constants come in Scalar cnst(1); for (int i = 2; i <= ND; ++i) { cnst *= i; pd[i] *= cnst; //std::cout << "pd[" << i << "] = " << pd[i] << std::endl; } } }} // namespace sw::universal
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2017-2018 The MOKEN developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "script.h" #include "tinyformat.h" #include "utilstrencodings.h" namespace { inline std::string ValueString(const std::vector<unsigned char>& vch) { if (vch.size() <= 4) return strprintf("%d", CScriptNum(vch, false).getint()); else return HexStr(vch); } } // anon namespace using namespace std; const char* GetOpName(opcodetype opcode) { switch (opcode) { // push value case OP_0 : return "0"; case OP_PUSHDATA1 : return "OP_PUSHDATA1"; case OP_PUSHDATA2 : return "OP_PUSHDATA2"; case OP_PUSHDATA4 : return "OP_PUSHDATA4"; case OP_1NEGATE : return "-1"; case OP_RESERVED : return "OP_RESERVED"; case OP_1 : return "1"; case OP_2 : return "2"; case OP_3 : return "3"; case OP_4 : return "4"; case OP_5 : return "5"; case OP_6 : return "6"; case OP_7 : return "7"; case OP_8 : return "8"; case OP_9 : return "9"; case OP_10 : return "10"; case OP_11 : return "11"; case OP_12 : return "12"; case OP_13 : return "13"; case OP_14 : return "14"; case OP_15 : return "15"; case OP_16 : return "16"; // control case OP_NOP : return "OP_NOP"; case OP_VER : return "OP_VER"; case OP_IF : return "OP_IF"; case OP_NOTIF : return "OP_NOTIF"; case OP_VERIF : return "OP_VERIF"; case OP_VERNOTIF : return "OP_VERNOTIF"; case OP_ELSE : return "OP_ELSE"; case OP_ENDIF : return "OP_ENDIF"; case OP_VERIFY : return "OP_VERIFY"; case OP_RETURN : return "OP_RETURN"; // stack ops case OP_TOALTSTACK : return "OP_TOALTSTACK"; case OP_FROMALTSTACK : return "OP_FROMALTSTACK"; case OP_2DROP : return "OP_2DROP"; case OP_2DUP : return "OP_2DUP"; case OP_3DUP : return "OP_3DUP"; case OP_2OVER : return "OP_2OVER"; case OP_2ROT : return "OP_2ROT"; case OP_2SWAP : return "OP_2SWAP"; case OP_IFDUP : return "OP_IFDUP"; case OP_DEPTH : return "OP_DEPTH"; case OP_DROP : return "OP_DROP"; case OP_DUP : return "OP_DUP"; case OP_NIP : return "OP_NIP"; case OP_OVER : return "OP_OVER"; case OP_PICK : return "OP_PICK"; case OP_ROLL : return "OP_ROLL"; case OP_ROT : return "OP_ROT"; case OP_SWAP : return "OP_SWAP"; case OP_TUCK : return "OP_TUCK"; // splice ops case OP_CAT : return "OP_CAT"; case OP_SUBSTR : return "OP_SUBSTR"; case OP_LEFT : return "OP_LEFT"; case OP_RIGHT : return "OP_RIGHT"; case OP_SIZE : return "OP_SIZE"; // bit logic case OP_INVERT : return "OP_INVERT"; case OP_AND : return "OP_AND"; case OP_OR : return "OP_OR"; case OP_XOR : return "OP_XOR"; case OP_EQUAL : return "OP_EQUAL"; case OP_EQUALVERIFY : return "OP_EQUALVERIFY"; case OP_RESERVED1 : return "OP_RESERVED1"; case OP_RESERVED2 : return "OP_RESERVED2"; // numeric case OP_1ADD : return "OP_1ADD"; case OP_1SUB : return "OP_1SUB"; case OP_2MUL : return "OP_2MUL"; case OP_2DIV : return "OP_2DIV"; case OP_NEGATE : return "OP_NEGATE"; case OP_ABS : return "OP_ABS"; case OP_NOT : return "OP_NOT"; case OP_0NOTEQUAL : return "OP_0NOTEQUAL"; case OP_ADD : return "OP_ADD"; case OP_SUB : return "OP_SUB"; case OP_MUL : return "OP_MUL"; case OP_DIV : return "OP_DIV"; case OP_MOD : return "OP_MOD"; case OP_LSHIFT : return "OP_LSHIFT"; case OP_RSHIFT : return "OP_RSHIFT"; case OP_BOOLAND : return "OP_BOOLAND"; case OP_BOOLOR : return "OP_BOOLOR"; case OP_NUMEQUAL : return "OP_NUMEQUAL"; case OP_NUMEQUALVERIFY : return "OP_NUMEQUALVERIFY"; case OP_NUMNOTEQUAL : return "OP_NUMNOTEQUAL"; case OP_LESSTHAN : return "OP_LESSTHAN"; case OP_GREATERTHAN : return "OP_GREATERTHAN"; case OP_LESSTHANOREQUAL : return "OP_LESSTHANOREQUAL"; case OP_GREATERTHANOREQUAL : return "OP_GREATERTHANOREQUAL"; case OP_MIN : return "OP_MIN"; case OP_MAX : return "OP_MAX"; case OP_WITHIN : return "OP_WITHIN"; // crypto case OP_RIPEMD160 : return "OP_RIPEMD160"; case OP_SHA1 : return "OP_SHA1"; case OP_SHA256 : return "OP_SHA256"; case OP_HASH160 : return "OP_HASH160"; case OP_HASH256 : return "OP_HASH256"; case OP_CODESEPARATOR : return "OP_CODESEPARATOR"; case OP_CHECKSIG : return "OP_CHECKSIG"; case OP_CHECKSIGVERIFY : return "OP_CHECKSIGVERIFY"; case OP_CHECKMULTISIG : return "OP_CHECKMULTISIG"; case OP_CHECKMULTISIGVERIFY : return "OP_CHECKMULTISIGVERIFY"; // expanson case OP_NOP1 : return "OP_NOP1"; case OP_NOP2 : return "OP_NOP2"; case OP_NOP3 : return "OP_NOP3"; case OP_NOP4 : return "OP_NOP4"; case OP_NOP5 : return "OP_NOP5"; case OP_NOP6 : return "OP_NOP6"; case OP_NOP7 : return "OP_NOP7"; case OP_NOP8 : return "OP_NOP8"; case OP_NOP9 : return "OP_NOP9"; case OP_NOP10 : return "OP_NOP10"; // zerocoin case OP_ZEROCOINMINT : return "OP_ZEROCOINMINT"; case OP_ZEROCOINSPEND : return "OP_ZEROCOINSPEND"; case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE"; // Note: // The template matching params OP_SMALLINTEGER/etc are defined in opcodetype enum // as kind of implementation hack, they are *NOT* real opcodes. If found in real // Script, just let the default: case deal with them. default: return "OP_UNKNOWN"; } } unsigned int CScript::GetSigOpCount(bool fAccurate) const { unsigned int n = 0; const_iterator pc = begin(); opcodetype lastOpcode = OP_INVALIDOPCODE; while (pc < end()) { opcodetype opcode; if (!GetOp(pc, opcode)) break; if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY) n++; else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY) { if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16) n += DecodeOP_N(lastOpcode); else n += 20; } lastOpcode = opcode; } return n; } unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const { if (!IsPayToScriptHash()) return GetSigOpCount(true); // This is a pay-to-script-hash scriptPubKey; // get the last item that the scriptSig // pushes onto the stack: const_iterator pc = scriptSig.begin(); vector<unsigned char> data; while (pc < scriptSig.end()) { opcodetype opcode; if (!scriptSig.GetOp(pc, opcode, data)) return 0; if (opcode > OP_16) return 0; } /// ... and return its opcount: CScript subscript(data.begin(), data.end()); return subscript.GetSigOpCount(true); } bool CScript::IsNormalPaymentScript() const { if(this->size() != 25) return false; std::string str; opcodetype opcode; const_iterator pc = begin(); int i = 0; while (pc < end()) { GetOp(pc, opcode); if( i == 0 && opcode != OP_DUP) return false; else if(i == 1 && opcode != OP_HASH160) return false; else if(i == 3 && opcode != OP_EQUALVERIFY) return false; else if(i == 4 && opcode != OP_CHECKSIG) return false; else if(i == 5) return false; i++; } return true; } bool CScript::IsPayToScriptHash() const { // Extra-fast test for pay-to-script-hash CScripts: return (this->size() == 23 && this->at(0) == OP_HASH160 && this->at(1) == 0x14 && this->at(22) == OP_EQUAL); } bool CScript::IsZerocoinMint() const { //fast test for Zerocoin Mint CScripts return (this->size() > 0 && this->at(0) == OP_ZEROCOINMINT); } bool CScript::IsZerocoinSpend() const { if (this->empty()) return false; return (this->at(0) == OP_ZEROCOINSPEND); } bool CScript::IsPushOnly(const_iterator pc) const { while (pc < end()) { opcodetype opcode; if (!GetOp(pc, opcode)) return false; // Note that IsPushOnly() *does* consider OP_RESERVED to be a // push-type opcode, however execution of OP_RESERVED fails, so // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to // the P2SH special validation code being executed. if (opcode > OP_16) return false; } return true; } bool CScript::IsPushOnly() const { return this->IsPushOnly(begin()); } std::string CScript::ToString() const { std::string str; opcodetype opcode; std::vector<unsigned char> vch; const_iterator pc = begin(); while (pc < end()) { if (!str.empty()) str += " "; if (!GetOp(pc, opcode, vch)) { str += "[error]"; return str; } if (0 <= opcode && opcode <= OP_PUSHDATA4) { str += ValueString(vch); } else { str += GetOpName(opcode); if (opcode == OP_ZEROCOINSPEND) { //Zerocoinspend has no further op codes. break; } } } return str; }
/** Copyright 2013 BlackBerry Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Original file from GamePlay3D: http://gameplay3d.org This file was modified to fit the cocos2d-x project */ #include "math/Mat4.h" #include "math/Quaternion.h" #include "math/MathUtil.h" #include "base/ccMacros.h" NS_CC_MATH_BEGIN Mat4::Mat4() { *this = IDENTITY; } Mat4::Mat4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44) { set(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44); } Mat4::Mat4(const float* mat) { set(mat); } Mat4::Mat4(const Mat4& copy) { memcpy(m, copy.m, MATRIX_SIZE); } Mat4::~Mat4() { } void Mat4::createLookAt(const Vec3& eyePosition, const Vec3& targetPosition, const Vec3& up, Mat4* dst) { createLookAt(eyePosition.x, eyePosition.y, eyePosition.z, targetPosition.x, targetPosition.y, targetPosition.z, up.x, up.y, up.z, dst); } void Mat4::createLookAt(float eyePositionX, float eyePositionY, float eyePositionZ, float targetPositionX, float targetPositionY, float targetPositionZ, float upX, float upY, float upZ, Mat4* dst) { GP_ASSERT(dst); Vec3 eye(eyePositionX, eyePositionY, eyePositionZ); Vec3 target(targetPositionX, targetPositionY, targetPositionZ); Vec3 up(upX, upY, upZ); up.normalize(); Vec3 zaxis; Vec3::subtract(eye, target, &zaxis); zaxis.normalize(); Vec3 xaxis; Vec3::cross(up, zaxis, &xaxis); xaxis.normalize(); Vec3 yaxis; Vec3::cross(zaxis, xaxis, &yaxis); yaxis.normalize(); dst->m[0] = xaxis.x; dst->m[1] = yaxis.x; dst->m[2] = zaxis.x; dst->m[3] = 0.0f; dst->m[4] = xaxis.y; dst->m[5] = yaxis.y; dst->m[6] = zaxis.y; dst->m[7] = 0.0f; dst->m[8] = xaxis.z; dst->m[9] = yaxis.z; dst->m[10] = zaxis.z; dst->m[11] = 0.0f; dst->m[12] = -Vec3::dot(xaxis, eye); dst->m[13] = -Vec3::dot(yaxis, eye); dst->m[14] = -Vec3::dot(zaxis, eye); dst->m[15] = 1.0f; } void Mat4::createPerspective(float fieldOfView, float aspectRatio, float zNearPlane, float zFarPlane, Mat4* dst) { GP_ASSERT(dst); GP_ASSERT(zFarPlane != zNearPlane); float f_n = 1.0f / (zFarPlane - zNearPlane); float theta = MATH_DEG_TO_RAD(fieldOfView) * 0.5f; if (fabs(fmod(theta, MATH_PIOVER2)) < MATH_EPSILON) { CCLOGERROR("Invalid field of view value (%f) causes attempted calculation tan(%f), which is undefined.", fieldOfView, theta); return; } float divisor = tan(theta); GP_ASSERT(divisor); float factor = 1.0f / divisor; memset(dst, 0, MATRIX_SIZE); GP_ASSERT(aspectRatio); dst->m[0] = (1.0f / aspectRatio) * factor; dst->m[5] = factor; dst->m[10] = (-(zFarPlane + zNearPlane)) * f_n; dst->m[11] = -1.0f; dst->m[14] = -2.0f * zFarPlane * zNearPlane * f_n; } void Mat4::createOrthographic(float width, float height, float zNearPlane, float zFarPlane, Mat4* dst) { float halfWidth = width / 2.0f; float halfHeight = height / 2.0f; createOrthographicOffCenter(-halfWidth, halfWidth, -halfHeight, halfHeight, zNearPlane, zFarPlane, dst); } void Mat4::createOrthographicOffCenter(float left, float right, float bottom, float top, float zNearPlane, float zFarPlane, Mat4* dst) { GP_ASSERT(dst); GP_ASSERT(right != left); GP_ASSERT(top != bottom); GP_ASSERT(zFarPlane != zNearPlane); memset(dst, 0, MATRIX_SIZE); dst->m[0] = 2 / (right - left); dst->m[5] = 2 / (top - bottom); dst->m[10] = 2 / (zNearPlane - zFarPlane); dst->m[12] = (left + right) / (left - right); dst->m[13] = (top + bottom) / (bottom - top); dst->m[14] = (zNearPlane + zFarPlane) / (zNearPlane - zFarPlane); dst->m[15] = 1; } void Mat4::createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition, const Vec3& cameraUpVector, Mat4* dst) { createBillboardHelper(objectPosition, cameraPosition, cameraUpVector, nullptr, dst); } void Mat4::createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition, const Vec3& cameraUpVector, const Vec3& cameraForwardVector, Mat4* dst) { createBillboardHelper(objectPosition, cameraPosition, cameraUpVector, &cameraForwardVector, dst); } void Mat4::createBillboardHelper(const Vec3& objectPosition, const Vec3& cameraPosition, const Vec3& cameraUpVector, const Vec3* cameraForwardVector, Mat4* dst) { Vec3 delta(objectPosition, cameraPosition); bool isSufficientDelta = delta.lengthSquared() > MATH_EPSILON; dst->setIdentity(); dst->m[3] = objectPosition.x; dst->m[7] = objectPosition.y; dst->m[11] = objectPosition.z; // As per the contracts for the 2 variants of createBillboard, we need // either a safe default or a sufficient distance between object and camera. if (cameraForwardVector || isSufficientDelta) { Vec3 target = isSufficientDelta ? cameraPosition : (objectPosition - *cameraForwardVector); // A billboard is the inverse of a lookAt rotation Mat4 lookAt; createLookAt(objectPosition, target, cameraUpVector, &lookAt); dst->m[0] = lookAt.m[0]; dst->m[1] = lookAt.m[4]; dst->m[2] = lookAt.m[8]; dst->m[4] = lookAt.m[1]; dst->m[5] = lookAt.m[5]; dst->m[6] = lookAt.m[9]; dst->m[8] = lookAt.m[2]; dst->m[9] = lookAt.m[6]; dst->m[10] = lookAt.m[10]; } } // void Mat4::createReflection(const Plane& plane, Mat4* dst) // { // Vec3 normal(plane.getNormal()); // float k = -2.0f * plane.getDistance(); // dst->setIdentity(); // dst->m[0] -= 2.0f * normal.x * normal.x; // dst->m[5] -= 2.0f * normal.y * normal.y; // dst->m[10] -= 2.0f * normal.z * normal.z; // dst->m[1] = dst->m[4] = -2.0f * normal.x * normal.y; // dst->m[2] = dst->m[8] = -2.0f * normal.x * normal.z; // dst->m[6] = dst->m[9] = -2.0f * normal.y * normal.z; // dst->m[3] = k * normal.x; // dst->m[7] = k * normal.y; // dst->m[11] = k * normal.z; // } void Mat4::createScale(const Vec3& scale, Mat4* dst) { GP_ASSERT(dst); memcpy(dst, &IDENTITY, MATRIX_SIZE); dst->m[0] = scale.x; dst->m[5] = scale.y; dst->m[10] = scale.z; } void Mat4::createScale(float xScale, float yScale, float zScale, Mat4* dst) { GP_ASSERT(dst); memcpy(dst, &IDENTITY, MATRIX_SIZE); dst->m[0] = xScale; dst->m[5] = yScale; dst->m[10] = zScale; } void Mat4::createRotation(const Quaternion& q, Mat4* dst) { GP_ASSERT(dst); float x2 = q.x + q.x; float y2 = q.y + q.y; float z2 = q.z + q.z; float xx2 = q.x * x2; float yy2 = q.y * y2; float zz2 = q.z * z2; float xy2 = q.x * y2; float xz2 = q.x * z2; float yz2 = q.y * z2; float wx2 = q.w * x2; float wy2 = q.w * y2; float wz2 = q.w * z2; dst->m[0] = 1.0f - yy2 - zz2; dst->m[1] = xy2 + wz2; dst->m[2] = xz2 - wy2; dst->m[3] = 0.0f; dst->m[4] = xy2 - wz2; dst->m[5] = 1.0f - xx2 - zz2; dst->m[6] = yz2 + wx2; dst->m[7] = 0.0f; dst->m[8] = xz2 + wy2; dst->m[9] = yz2 - wx2; dst->m[10] = 1.0f - xx2 - yy2; dst->m[11] = 0.0f; dst->m[12] = 0.0f; dst->m[13] = 0.0f; dst->m[14] = 0.0f; dst->m[15] = 1.0f; } void Mat4::createRotation(const Vec3& axis, float angle, Mat4* dst) { GP_ASSERT(dst); float x = axis.x; float y = axis.y; float z = axis.z; // Make sure the input axis is normalized. float n = x*x + y*y + z*z; if (n != 1.0f) { // Not normalized. n = sqrt(n); // Prevent divide too close to zero. if (n > 0.000001f) { n = 1.0f / n; x *= n; y *= n; z *= n; } } float c = cos(angle); float s = sin(angle); float t = 1.0f - c; float tx = t * x; float ty = t * y; float tz = t * z; float txy = tx * y; float txz = tx * z; float tyz = ty * z; float sx = s * x; float sy = s * y; float sz = s * z; dst->m[0] = c + tx*x; dst->m[1] = txy + sz; dst->m[2] = txz - sy; dst->m[3] = 0.0f; dst->m[4] = txy - sz; dst->m[5] = c + ty*y; dst->m[6] = tyz + sx; dst->m[7] = 0.0f; dst->m[8] = txz + sy; dst->m[9] = tyz - sx; dst->m[10] = c + tz*z; dst->m[11] = 0.0f; dst->m[12] = 0.0f; dst->m[13] = 0.0f; dst->m[14] = 0.0f; dst->m[15] = 1.0f; } void Mat4::createRotationX(float angle, Mat4* dst) { GP_ASSERT(dst); memcpy(dst, &IDENTITY, MATRIX_SIZE); float c = cos(angle); float s = sin(angle); dst->m[5] = c; dst->m[6] = s; dst->m[9] = -s; dst->m[10] = c; } void Mat4::createRotationY(float angle, Mat4* dst) { GP_ASSERT(dst); memcpy(dst, &IDENTITY, MATRIX_SIZE); float c = cos(angle); float s = sin(angle); dst->m[0] = c; dst->m[2] = -s; dst->m[8] = s; dst->m[10] = c; } void Mat4::createRotationZ(float angle, Mat4* dst) { GP_ASSERT(dst); memcpy(dst, &IDENTITY, MATRIX_SIZE); float c = cos(angle); float s = sin(angle); dst->m[0] = c; dst->m[1] = s; dst->m[4] = -s; dst->m[5] = c; } void Mat4::createTranslation(const Vec3& translation, Mat4* dst) { GP_ASSERT(dst); memcpy(dst, &IDENTITY, MATRIX_SIZE); dst->m[12] = translation.x; dst->m[13] = translation.y; dst->m[14] = translation.z; } void Mat4::createTranslation(float xTranslation, float yTranslation, float zTranslation, Mat4* dst) { GP_ASSERT(dst); memcpy(dst, &IDENTITY, MATRIX_SIZE); dst->m[12] = xTranslation; dst->m[13] = yTranslation; dst->m[14] = zTranslation; } void Mat4::add(float scalar) { add(scalar, this); } void Mat4::add(float scalar, Mat4* dst) { GP_ASSERT(dst); MathUtil::addMatrix(m, scalar, dst->m); } void Mat4::add(const Mat4& mat) { add(*this, mat, this); } void Mat4::add(const Mat4& m1, const Mat4& m2, Mat4* dst) { GP_ASSERT(dst); MathUtil::addMatrix(m1.m, m2.m, dst->m); } bool Mat4::decompose(Vec3* scale, Quaternion* rotation, Vec3* translation) const { if (translation) { // Extract the translation. translation->x = m[12]; translation->y = m[13]; translation->z = m[14]; } // Nothing left to do. if (scale == nullptr && rotation == nullptr) return true; // Extract the scale. // This is simply the length of each axis (row/column) in the matrix. Vec3 xaxis(m[0], m[1], m[2]); float scaleX = xaxis.length(); Vec3 yaxis(m[4], m[5], m[6]); float scaleY = yaxis.length(); Vec3 zaxis(m[8], m[9], m[10]); float scaleZ = zaxis.length(); // Determine if we have a negative scale (true if determinant is less than zero). // In this case, we simply negate a single axis of the scale. float det = determinant(); if (det < 0) scaleZ = -scaleZ; if (scale) { scale->x = scaleX; scale->y = scaleY; scale->z = scaleZ; } // Nothing left to do. if (rotation == nullptr) return true; // Scale too close to zero, can't decompose rotation. if (scaleX < MATH_TOLERANCE || scaleY < MATH_TOLERANCE || fabs(scaleZ) < MATH_TOLERANCE) return false; float rn; // Factor the scale out of the matrix axes. rn = 1.0f / scaleX; xaxis.x *= rn; xaxis.y *= rn; xaxis.z *= rn; rn = 1.0f / scaleY; yaxis.x *= rn; yaxis.y *= rn; yaxis.z *= rn; rn = 1.0f / scaleZ; zaxis.x *= rn; zaxis.y *= rn; zaxis.z *= rn; // Now calculate the rotation from the resulting matrix (axes). float trace = xaxis.x + yaxis.y + zaxis.z + 1.0f; if (trace > MATH_EPSILON) { float s = 0.5f / sqrt(trace); rotation->w = 0.25f / s; rotation->x = (yaxis.z - zaxis.y) * s; rotation->y = (zaxis.x - xaxis.z) * s; rotation->z = (xaxis.y - yaxis.x) * s; } else { // Note: since xaxis, yaxis, and zaxis are normalized, // we will never divide by zero in the code below. if (xaxis.x > yaxis.y && xaxis.x > zaxis.z) { float s = 0.5f / sqrt(1.0f + xaxis.x - yaxis.y - zaxis.z); rotation->w = (yaxis.z - zaxis.y) * s; rotation->x = 0.25f / s; rotation->y = (yaxis.x + xaxis.y) * s; rotation->z = (zaxis.x + xaxis.z) * s; } else if (yaxis.y > zaxis.z) { float s = 0.5f / sqrt(1.0f + yaxis.y - xaxis.x - zaxis.z); rotation->w = (zaxis.x - xaxis.z) * s; rotation->x = (yaxis.x + xaxis.y) * s; rotation->y = 0.25f / s; rotation->z = (zaxis.y + yaxis.z) * s; } else { float s = 0.5f / sqrt(1.0f + zaxis.z - xaxis.x - yaxis.y ); rotation->w = (xaxis.y - yaxis.x ) * s; rotation->x = (zaxis.x + xaxis.z ) * s; rotation->y = (zaxis.y + yaxis.z ) * s; rotation->z = 0.25f / s; } } return true; } float Mat4::determinant() const { float a0 = m[0] * m[5] - m[1] * m[4]; float a1 = m[0] * m[6] - m[2] * m[4]; float a2 = m[0] * m[7] - m[3] * m[4]; float a3 = m[1] * m[6] - m[2] * m[5]; float a4 = m[1] * m[7] - m[3] * m[5]; float a5 = m[2] * m[7] - m[3] * m[6]; float b0 = m[8] * m[13] - m[9] * m[12]; float b1 = m[8] * m[14] - m[10] * m[12]; float b2 = m[8] * m[15] - m[11] * m[12]; float b3 = m[9] * m[14] - m[10] * m[13]; float b4 = m[9] * m[15] - m[11] * m[13]; float b5 = m[10] * m[15] - m[11] * m[14]; // Calculate the determinant. return (a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0); } void Mat4::getScale(Vec3* scale) const { decompose(scale, nullptr, nullptr); } bool Mat4::getRotation(Quaternion* rotation) const { return decompose(nullptr, rotation, nullptr); } void Mat4::getTranslation(Vec3* translation) const { decompose(nullptr, nullptr, translation); } void Mat4::getUpVector(Vec3* dst) const { GP_ASSERT(dst); dst->x = m[4]; dst->y = m[5]; dst->z = m[6]; } void Mat4::getDownVector(Vec3* dst) const { GP_ASSERT(dst); dst->x = -m[4]; dst->y = -m[5]; dst->z = -m[6]; } void Mat4::getLeftVector(Vec3* dst) const { GP_ASSERT(dst); dst->x = -m[0]; dst->y = -m[1]; dst->z = -m[2]; } void Mat4::getRightVector(Vec3* dst) const { GP_ASSERT(dst); dst->x = m[0]; dst->y = m[1]; dst->z = m[2]; } void Mat4::getForwardVector(Vec3* dst) const { GP_ASSERT(dst); dst->x = -m[8]; dst->y = -m[9]; dst->z = -m[10]; } void Mat4::getBackVector(Vec3* dst) const { GP_ASSERT(dst); dst->x = m[8]; dst->y = m[9]; dst->z = m[10]; } Mat4 Mat4::getInversed() const { Mat4 mat(*this); mat.inverse(); return mat; } bool Mat4::inverse() { float a0 = m[0] * m[5] - m[1] * m[4]; float a1 = m[0] * m[6] - m[2] * m[4]; float a2 = m[0] * m[7] - m[3] * m[4]; float a3 = m[1] * m[6] - m[2] * m[5]; float a4 = m[1] * m[7] - m[3] * m[5]; float a5 = m[2] * m[7] - m[3] * m[6]; float b0 = m[8] * m[13] - m[9] * m[12]; float b1 = m[8] * m[14] - m[10] * m[12]; float b2 = m[8] * m[15] - m[11] * m[12]; float b3 = m[9] * m[14] - m[10] * m[13]; float b4 = m[9] * m[15] - m[11] * m[13]; float b5 = m[10] * m[15] - m[11] * m[14]; // Calculate the determinant. float det = a0 * b5 - a1 * b4 + a2 * b3 + a3 * b2 - a4 * b1 + a5 * b0; // Close to zero, can't invert. if (fabs(det) <= MATH_TOLERANCE) return false; // Support the case where m == dst. Mat4 inverse; inverse.m[0] = m[5] * b5 - m[6] * b4 + m[7] * b3; inverse.m[1] = -m[1] * b5 + m[2] * b4 - m[3] * b3; inverse.m[2] = m[13] * a5 - m[14] * a4 + m[15] * a3; inverse.m[3] = -m[9] * a5 + m[10] * a4 - m[11] * a3; inverse.m[4] = -m[4] * b5 + m[6] * b2 - m[7] * b1; inverse.m[5] = m[0] * b5 - m[2] * b2 + m[3] * b1; inverse.m[6] = -m[12] * a5 + m[14] * a2 - m[15] * a1; inverse.m[7] = m[8] * a5 - m[10] * a2 + m[11] * a1; inverse.m[8] = m[4] * b4 - m[5] * b2 + m[7] * b0; inverse.m[9] = -m[0] * b4 + m[1] * b2 - m[3] * b0; inverse.m[10] = m[12] * a4 - m[13] * a2 + m[15] * a0; inverse.m[11] = -m[8] * a4 + m[9] * a2 - m[11] * a0; inverse.m[12] = -m[4] * b3 + m[5] * b1 - m[6] * b0; inverse.m[13] = m[0] * b3 - m[1] * b1 + m[2] * b0; inverse.m[14] = -m[12] * a3 + m[13] * a1 - m[14] * a0; inverse.m[15] = m[8] * a3 - m[9] * a1 + m[10] * a0; multiply(inverse, 1.0f / det, this); return true; } bool Mat4::isIdentity() const { return (memcmp(m, &IDENTITY, MATRIX_SIZE) == 0); } void Mat4::multiply(float scalar) { multiply(scalar, this); } void Mat4::multiply(float scalar, Mat4* dst) const { multiply(*this, scalar, dst); } void Mat4::multiply(const Mat4& m, float scalar, Mat4* dst) { GP_ASSERT(dst); MathUtil::multiplyMatrix(m.m, scalar, dst->m); } void Mat4::multiply(const Mat4& mat) { multiply(*this, mat, this); } void Mat4::multiply(const Mat4& m1, const Mat4& m2, Mat4* dst) { GP_ASSERT(dst); MathUtil::multiplyMatrix(m1.m, m2.m, dst->m); } void Mat4::negate() { MathUtil::negateMatrix(m, m); } Mat4 Mat4::getNegated() const { Mat4 mat(*this); mat.negate(); return mat; } void Mat4::rotate(const Quaternion& q) { rotate(q, this); } void Mat4::rotate(const Quaternion& q, Mat4* dst) const { Mat4 r; createRotation(q, &r); multiply(*this, r, dst); } void Mat4::rotate(const Vec3& axis, float angle) { rotate(axis, angle, this); } void Mat4::rotate(const Vec3& axis, float angle, Mat4* dst) const { Mat4 r; createRotation(axis, angle, &r); multiply(*this, r, dst); } void Mat4::rotateX(float angle) { rotateX(angle, this); } void Mat4::rotateX(float angle, Mat4* dst) const { Mat4 r; createRotationX(angle, &r); multiply(*this, r, dst); } void Mat4::rotateY(float angle) { rotateY(angle, this); } void Mat4::rotateY(float angle, Mat4* dst) const { Mat4 r; createRotationY(angle, &r); multiply(*this, r, dst); } void Mat4::rotateZ(float angle) { rotateZ(angle, this); } void Mat4::rotateZ(float angle, Mat4* dst) const { Mat4 r; createRotationZ(angle, &r); multiply(*this, r, dst); } void Mat4::scale(float value) { scale(value, this); } void Mat4::scale(float value, Mat4* dst) const { scale(value, value, value, dst); } void Mat4::scale(float xScale, float yScale, float zScale) { scale(xScale, yScale, zScale, this); } void Mat4::scale(float xScale, float yScale, float zScale, Mat4* dst) const { Mat4 s; createScale(xScale, yScale, zScale, &s); multiply(*this, s, dst); } void Mat4::scale(const Vec3& s) { scale(s.x, s.y, s.z, this); } void Mat4::scale(const Vec3& s, Mat4* dst) const { scale(s.x, s.y, s.z, dst); } void Mat4::set(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44) { m[0] = m11; m[1] = m21; m[2] = m31; m[3] = m41; m[4] = m12; m[5] = m22; m[6] = m32; m[7] = m42; m[8] = m13; m[9] = m23; m[10] = m33; m[11] = m43; m[12] = m14; m[13] = m24; m[14] = m34; m[15] = m44; } void Mat4::set(const float* mat) { GP_ASSERT(mat); memcpy(this->m, mat, MATRIX_SIZE); } void Mat4::set(const Mat4& mat) { memcpy(this->m, mat.m, MATRIX_SIZE); } void Mat4::setIdentity() { memcpy(m, &IDENTITY, MATRIX_SIZE); } void Mat4::setZero() { memset(m, 0, MATRIX_SIZE); } void Mat4::subtract(const Mat4& mat) { subtract(*this, mat, this); } void Mat4::subtract(const Mat4& m1, const Mat4& m2, Mat4* dst) { GP_ASSERT(dst); MathUtil::subtractMatrix(m1.m, m2.m, dst->m); } void Mat4::transformPoint(Vec3* point) const { GP_ASSERT(point); transformVector(point->x, point->y, point->z, 1.0f, point); } void Mat4::transformPoint(const Vec3& point, Vec3* dst) const { transformVector(point.x, point.y, point.z, 1.0f, dst); } void Mat4::transformVector(Vec3* vector) const { GP_ASSERT(vector); transformVector(vector->x, vector->y, vector->z, 0.0f, vector); } void Mat4::transformVector(const Vec3& vector, Vec3* dst) const { transformVector(vector.x, vector.y, vector.z, 0.0f, dst); } void Mat4::transformVector(float x, float y, float z, float w, Vec3* dst) const { GP_ASSERT(dst); MathUtil::transformVec4(m, x, y, z, w, (float*)dst); } void Mat4::transformVector(Vec4* vector) const { GP_ASSERT(vector); transformVector(*vector, vector); } void Mat4::transformVector(const Vec4& vector, Vec4* dst) const { GP_ASSERT(dst); MathUtil::transformVec4(m, (const float*) &vector, (float*)dst); } void Mat4::translate(float x, float y, float z) { translate(x, y, z, this); } void Mat4::translate(float x, float y, float z, Mat4* dst) const { Mat4 t; createTranslation(x, y, z, &t); multiply(*this, t, dst); } void Mat4::translate(const Vec3& t) { translate(t.x, t.y, t.z, this); } void Mat4::translate(const Vec3& t, Mat4* dst) const { translate(t.x, t.y, t.z, dst); } void Mat4::transpose() { MathUtil::transposeMatrix(m, m); } Mat4 Mat4::getTransposed() const { Mat4 mat(*this); mat.transpose(); return mat; } const Mat4 Mat4::IDENTITY = Mat4( 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); const Mat4 Mat4::ZERO = Mat4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); NS_CC_MATH_END
/* * Distributed under the OSI-approved Apache License, Version 2.0. See * accompanying file Copyright.txt for details. * * Attribute.cpp : needed for template separation using Attribute.tcc * * Created on: Aug 3, 2017 * Author: William F Godoy godoywf@ornl.gov */ #include "Attribute.h" #include "Attribute.tcc" #include "adios2/common/ADIOSMacros.h" #include "adios2/helper/adiosFunctions.h" //GetDataType<T> #include <type_traits> namespace adios2 { namespace core { namespace // anonymous { template <class T> struct RequiresZeroPadding : std::false_type { }; template <> struct RequiresZeroPadding<long double> : std::true_type { }; } #define declare_type(T) \ \ template <> \ Attribute<T>::Attribute(const Attribute<T> &other) \ : AttributeBase(other), m_DataArray(other.m_DataArray) \ { \ if (RequiresZeroPadding<T>::value) \ std::memset(&m_DataSingleValue, 0, sizeof(m_DataSingleValue)); \ m_DataSingleValue = other.m_DataSingleValue; \ } \ \ template <> \ Attribute<T>::Attribute(const std::string &name, const T *array, \ const size_t elements) \ : AttributeBase(name, helper::GetDataType<T>(), elements) \ { \ if (RequiresZeroPadding<T>::value) \ std::memset(&m_DataSingleValue, 0, sizeof(m_DataSingleValue)); \ m_DataArray = std::vector<T>(array, array + elements); \ } \ \ template <> \ Attribute<T>::Attribute(const std::string &name, const T &value) \ : AttributeBase(name, helper::GetDataType<T>()) \ { \ if (RequiresZeroPadding<T>::value) \ std::memset(&m_DataSingleValue, 0, sizeof(m_DataSingleValue)); \ m_DataSingleValue = value; \ } \ \ template <> \ Params Attribute<T>::GetInfo() const noexcept \ { \ return DoGetInfo(); \ } ADIOS2_FOREACH_ATTRIBUTE_STDTYPE_1ARG(declare_type) #undef declare_type } // end namespace core } // end namespace adios2
#include <utility> // // Created by eliane on 13/03/19. // #include "Calibrator.h" #include <cmath> #include <thread> #include <boost/log/trivial.hpp> #define USE_BOOST_KARMA #include <bprinter/table_printer.h> #include <armadillo> #include <ensmallen.hpp> #include <Engines/Internals/InternalsUtilityFunctions.h> #include <Engines/Utils/ExtractProteinFromBox.hpp> #include <Utilities/LogUtils.h> namespace SmolDock::Calibration { Calibrator::Calibrator(Score::ScoringFunctionType scFuncType, Heuristics::GlobalHeuristicType heurType, Optimizer::LocalOptimizerType localOptimizerType_, unsigned int maxLearningSteps, double stepSize_, unsigned int rngSeed, unsigned int conformerNumber, unsigned int retryNumber, unsigned int batchSize_, Heuristics::HeuristicParameters hParams) : scoringFunctionType(scFuncType), heuristicType(heurType), localOptimizerType(localOptimizerType_), maxLearningSteps(maxLearningSteps), stepSize(stepSize_), rndGenerator(rngSeed), conformerNumber(conformerNumber), retryNumber(retryNumber), batchSize(batchSize_), hParams(std::move(hParams)){ if (conformerNumber == 0 || retryNumber == 0) { BOOST_LOG_TRIVIAL(error) << "Cannot run calibration with number of conformer/number of try per conformer = " << conformerNumber << "," << retryNumber; } iConformer dummy_cf; dummy_cf.num_rotatable_bond = 0; iProtein dummy_prot; iTransform dummy_tr = iTransformIdentityInit(0); this->dummy_sf = scoringFunctionFactory(this->scoringFunctionType, dummy_cf, dummy_prot, dummy_tr, 1e-3, true); BOOST_LOG_TRIVIAL(debug) << " Calibrator::Calibrator() Scoring function type : " << this->scoringFunctionType; this->currentCoeffs = this->dummy_sf->getCurrentCoefficients(); BOOST_LOG_TRIVIAL(debug) << " Retrieved coeffs: " << vectorToString(this->currentCoeffs); this->nameOfAllCoeffs = this->dummy_sf->getCoefficientsNames(); } bool Calibrator::addReferenceLigand_SMILES_Ki(ReceptorID recID, const std::string &smiles, double Ki) { auto mol_sptr = std::make_shared<Molecule>(true); // FIXME : no flexible rings mol_sptr->populateFromSMILES(smiles, 142); const double R = 8.3144598; const double T = 310.15; // 37 degree celsius double deltaG = R * T * std::log(Ki) / 1000; // kcal/mol aka same as other docking software this->referenceLigands[recID].emplace_back(std::make_tuple(mol_sptr, deltaG, std::vector<iConformer>())); return true; } bool Calibrator::addReferenceLigand_Mol_Ki(Calibrator::ReceptorID recID, const Molecule &mol, double Ki) { auto mol_sptr = std::make_shared<Molecule>(mol.deepcopy()); const double R = 8.3144598; const double T = 310.15; // 37 degree celsius double deltaG = R * T * std::log(Ki) / 1000; // kcal/mol aka same as other docking software this->referenceLigands[recID].emplace_back(std::make_tuple(mol_sptr, deltaG, std::vector<iConformer>())); return true; } Calibrator::ReceptorID Calibrator::addReceptor(const Protein &prot, Engine::AbstractDockingEngine::DockingBoxSetting dbsettings) { referenceReceptor.emplace_back( std::make_tuple(std::make_shared<Protein>(prot), dbsettings, iProtein(), iProtein())); this->current_max_ReceptorID++; return this->current_max_ReceptorID - 1; } bool Calibrator::setupCalibration() { BOOST_LOG_TRIVIAL(info) << "Setting up calibration..."; std::uniform_int_distribution<> dis_int(0, std::numeric_limits<int>::max()); std::uniform_real_distribution<double> dis_real_position(-100.0, 100.0); for (unsigned int i = 0; i < this->referenceReceptor.size(); i++) { auto &protein = std::get<std::shared_ptr<Protein>>(this->referenceReceptor[i]); auto &iProt = std::get<2>(this->referenceReceptor[i]); auto &fulliProt = std::get<3>(this->referenceReceptor[i]); auto &settings = std::get<Engine::AbstractDockingEngine::DockingBoxSetting>(this->referenceReceptor[i]); iProt = extractIProteinFromBoxSetting(protein.get(), settings); fulliProt = protein->getiProtein(); for (auto &j : this->referenceLigands[i]) { auto mol_sptr = std::get<std::shared_ptr<Molecule>>(j); auto &conformer_vector = std::get<std::vector<iConformer>>(j); mol_sptr->generateConformers(conformer_vector, this->conformerNumber, true, dis_int(this->rndGenerator)); } } return true; } void Calibrator::fillWorkItemVector(std::shared_ptr<std::vector<CalibratorWorkItem>> workItemVector) { std::uniform_int_distribution<unsigned int> dis_uint(0, std::numeric_limits<unsigned int>::max()); for (unsigned int receptorIdx = 0; receptorIdx < this->referenceReceptor.size(); receptorIdx++) { auto &protein = std::get<std::shared_ptr<Protein>>(this->referenceReceptor[receptorIdx]); auto &iProt = std::get<2>(this->referenceReceptor[receptorIdx]); auto &fulliProt = std::get<3>(this->referenceReceptor[receptorIdx]); auto &settings = std::get<Engine::AbstractDockingEngine::DockingBoxSetting>( this->referenceReceptor[receptorIdx]); if (this->hParams.index() == 0) // LackOfParameter { BOOST_LOG_TRIVIAL(debug) << "Received default heuristics parameters, setting up search domain if relevant"; double proteinMaxRadius = (settings.shape == Engine::AbstractDockingEngine::DockingBoxSetting::Shape::sphere) ? settings.radius : protein->getMaxRadius(); this->hParams = setupSearchDomainIfRelevant(this->heuristicType, proteinMaxRadius); } for (auto &ligandRecord : this->referenceLigands[receptorIdx]) { auto &conformer_vector = std::get<std::vector<iConformer>>(ligandRecord); double referenceScore = std::get<double>(ligandRecord); iTransform starting_pos_tr = iTransformIdentityInit(conformer_vector[0].num_rotatable_bond); if (settings.shape == Engine::AbstractDockingEngine::DockingBoxSetting::Shape::sphere) { starting_pos_tr.transl.x() += settings.center[0]; starting_pos_tr.transl.y() += settings.center[1]; starting_pos_tr.transl.z() += settings.center[2]; } CalibratorWorkItem item = {.scFuncType_ = this->scoringFunctionType, .heurType_ = this->heuristicType, .localOptimizerType_ = this->localOptimizerType, .transform_ = starting_pos_tr, .conformerVector_ = &conformer_vector, .prot_ = &iProt, .fullProt_ = &fulliProt, .seed_ = dis_uint(this->rndGenerator), .retryNumber_ = this->retryNumber, .hParams_ = this->hParams, .referenceScore_ = referenceScore, }; workItemVector->emplace_back(std::move(item)); } } } bool Calibrator::runCalibration2() { auto workItemVector = std::make_shared<std::vector<CalibratorWorkItem>>(); this->fillWorkItemVector(workItemVector); CalibratorEnsmallenLayer calibratorEnsLayer(workItemVector, this->currentCoeffs, this->idxOfCoeffsToCalibrate); arma::mat coeffs_internalRepr = calibratorEnsLayer.getInitialParamMatrix(); ens::Adam optimizer(this->stepSize, this->batchSize, 0.9, 0.999, 1e-8, this->maxLearningSteps, 1e-4, true); optimizer.Optimize(calibratorEnsLayer, coeffs_internalRepr); this->optResultMat = coeffs_internalRepr; std::vector<double> updateCoeffsVector = this->currentCoeffs; for (unsigned int j = 0; j < this->idxOfCoeffsToCalibrate.size(); ++j) { unsigned int idxCoeff = this->idxOfCoeffsToCalibrate[j]; std::string coeffName = this->nameOfAllCoeffs[idxCoeff]; double nonUpdatedCoeff = this->currentCoeffs[idxCoeff]; updateCoeffsVector[idxCoeff] = coeffs_internalRepr[j]; BOOST_LOG_TRIVIAL(info) << "COEFFICIENT " << coeffName << " ---- "; BOOST_LOG_TRIVIAL(info) << " Old coeff : " << nonUpdatedCoeff; BOOST_LOG_TRIVIAL(info) << " New coeff : " << coeffs_internalRepr[j]; BOOST_LOG_TRIVIAL(info) << " ----------------------------- \n"; } this->optResultVector = updateCoeffsVector; return true; } bool Calibrator::runCalibration() { BOOST_LOG_TRIVIAL(info) << "Running the calibration..."; std::vector<double> averageLossHistory; for (unsigned int learningEpoch = 1; learningEpoch <= this->maxLearningSteps; learningEpoch++) { BOOST_LOG_TRIVIAL(info) << " ------------- CALIBRATION EPOCH " << learningEpoch << " of " << this->maxLearningSteps << " ----------------"; auto workItemVector = std::make_shared<std::vector<CalibratorWorkItem>>(); auto resultMutex = std::make_shared<std::mutex>(); auto local_scores = std::make_shared<std::vector<double>>(); auto local_referenceScores = std::make_shared<std::vector<double>>(); auto local_scoreComponents = std::make_shared<std::vector<std::vector<std::tuple<std::string, double>>>>(); this->fillWorkItemVector(workItemVector); // At this point all work items for this epoch have been added // We parellel run them tbb::parallel_for(tbb::blocked_range<size_t>(0, workItemVector->size()), CalibratorLoopRunner(workItemVector, resultMutex, local_scores, local_referenceScores, local_scoreComponents, this->currentCoeffs) ); bprinter::TablePrinter tp(&std::cout); tp.AddColumn("iteration", 10); tp.AddColumn("Local scores", 25); tp.AddColumn("Local DeltaG", 25); tp.PrintHeader(); for (unsigned int l = 0; l < local_referenceScores->size(); ++l) { tp << l << local_scores->at(l) << local_referenceScores->at(l); } tp.PrintFooter(); // std::vector<double> local_scores; // std::vector<double> local_referenceScores; // std::vector<std::vector<std::tuple<std::string,double>>> local_scoreComponents; double averageOutputScore = std::accumulate(local_scores->begin(), local_scores->end(), 0.0) / local_scores->size(); double averageReferenceScore = std::accumulate(local_referenceScores->begin(), local_referenceScores->end(), 0.0) / local_referenceScores->size(); double average_loss = averageReferenceScore - averageOutputScore; unsigned int numElementInBatch = local_scores->size(); BOOST_LOG_TRIVIAL(info) << "\n\n"; for (unsigned int idxCoeff : this->idxOfCoeffsToCalibrate) { std::string coeffName = this->nameOfAllCoeffs[idxCoeff]; double nonUpdatedCoeff = this->currentCoeffs[idxCoeff]; double meanValueInput = 0.0; for (auto &record : *local_scoreComponents) { auto it = std::find_if(record.begin(), record.end(), [&coeffName](auto &e) { return std::get<std::string>(e) == coeffName; }); if (it == record.end()) BOOST_LOG_TRIVIAL(error) << "Coefficient \"" << coeffName << "\" was not found among the score subcomponents, this is a bug.", std::terminate(); meanValueInput += std::get<double>(*it); } meanValueInput = meanValueInput / numElementInBatch; double deltaCoeff = (this->stepSize /* /learningEpoch */) * meanValueInput * average_loss; this->currentCoeffs[idxCoeff] = nonUpdatedCoeff + deltaCoeff; BOOST_LOG_TRIVIAL(info) << "COEFFICIENT " << coeffName << " ---- "; BOOST_LOG_TRIVIAL(info) << " Old coeff : " << nonUpdatedCoeff; BOOST_LOG_TRIVIAL(info) << " Mean input value : " << meanValueInput; BOOST_LOG_TRIVIAL(info) << " Step Size : " << this->stepSize; BOOST_LOG_TRIVIAL(info) << " Avg Loss : " << average_loss; BOOST_LOG_TRIVIAL(info) << " Delta coeff : " << deltaCoeff; BOOST_LOG_TRIVIAL(info) << " New coeff : " << this->currentCoeffs[idxCoeff]; BOOST_LOG_TRIVIAL(info) << " ----------------------------- \n"; } BOOST_LOG_TRIVIAL(info) << "\n"; BOOST_LOG_TRIVIAL(info) << " LOSS HISTORY "; averageLossHistory.push_back(average_loss); bprinter::TablePrinter losstable(&std::cout); losstable.AddColumn("iteration", 10); losstable.AddColumn("Average loss", 25); losstable.PrintHeader(); for (unsigned int l = 0; l < averageLossHistory.size(); ++l) { losstable << l << averageLossHistory[l]; } losstable.PrintFooter(); BOOST_LOG_TRIVIAL(info) << "\n"; BOOST_LOG_TRIVIAL(info) << "\n"; BOOST_LOG_TRIVIAL(info) << " ---- CYCLE RESULTS ---- "; BOOST_LOG_TRIVIAL(info) << " Cycle # : " << learningEpoch << " of " << this->maxLearningSteps; BOOST_LOG_TRIVIAL(info) << " Average loss : " << average_loss; BOOST_LOG_TRIVIAL(info) << " ----------------------- \n"; BOOST_LOG_TRIVIAL(info) << " ------------- END OF CALIBRATION CYCLE ----------------\n\n"; } return true; } bool Calibrator::coefficientsToCalibrate(std::vector<std::string> nameOfCoeffs) { std::vector<std::string> names = this->dummy_sf->getCoefficientsNames(); bool hasNameNotFound = false; for (auto &nameGiven: nameOfCoeffs) { auto it = std::find(names.begin(), names.end(), nameGiven); if (it == names.end()) { BOOST_LOG_TRIVIAL(warning) << "Coefficient to calibrate \"" << nameGiven << "\" was not found among the optimizable coefficients."; hasNameNotFound = true; } else { this->coeffsToCalibrate.push_back(nameGiven); this->idxOfCoeffsToCalibrate.push_back(std::distance(names.begin(), it)); } } if (hasNameNotFound) { BOOST_LOG_TRIVIAL(warning) << "List of optimizable coefficients for " << scoringFunctionTypeToString(this->scoringFunctionType) << " : "; for (auto &nameCoeff : names) { BOOST_LOG_TRIVIAL(warning) << " - " << nameCoeff; } } BOOST_LOG_TRIVIAL(info) << "Calibrating the following coefficients :"; for (auto &nameCoeff : this->coeffsToCalibrate) { BOOST_LOG_TRIVIAL(info) << " - " << nameCoeff; } return true; } CalibratorLoopRunner::CalibratorLoopRunner(std::shared_ptr<std::vector<CalibratorWorkItem>> workItemList, std::shared_ptr<std::mutex> resultMutex_, std::shared_ptr<std::vector<double>> local_scores_, std::shared_ptr<std::vector<double>> local_referenceScores_, std::shared_ptr<std::vector<std::vector<std::tuple<std::string, double>>>> local_scoreComponents_, std::vector<double> currentCoeffs_, std::vector<unsigned int> indexShufflingArray_) : workItemList(std::move(workItemList)), resultMutex(std::move(resultMutex_)), local_scores(std::move(local_scores_)), local_referenceScores(std::move(local_referenceScores_)), local_scoreComponents(std::move(local_scoreComponents_)), currentCoeffs(std::move(currentCoeffs_)) { if (indexShufflingArray_.size() == 0) { for (unsigned int j = 0; j < this->workItemList->size(); ++j) { this->indexShufflingArray.push_back(j); } } else { BOOST_ASSERT(this->workItemList->size() == indexShufflingArray_.size()); this->indexShufflingArray = indexShufflingArray_; } } void CalibratorLoopRunner::operator()(const tbb::blocked_range<size_t> &r) const { for (size_t i = r.begin(); i != r.end(); ++i) { CalibratorWorkItem &item = this->workItemList->at(this->indexShufflingArray[i]); double bestScoreAmongRetry = std::numeric_limits<double>::max(); std::vector<std::tuple<std::string, double>> bestComponentsAmongRetry; unsigned int conformerNum = 0; for (auto &conformer : *(item.conformerVector_)) { item.transform_.transl.x() += conformer.centroidNormalizingTransform.x(); item.transform_.transl.y() += conformer.centroidNormalizingTransform.y(); item.transform_.transl.z() += conformer.centroidNormalizingTransform.z(); item.transform_.rota.normalize(); arma::arma_rng::set_seed(item.seed_); std::shared_ptr<Score::ScoringFunction> scoringFunction = scoringFunctionFactory( item.scFuncType_, conformer, *item.prot_, item.transform_, 1e-3, true); scoringFunction->setNonDefaultCoefficients(this->currentCoeffs); std::shared_ptr<Score::ScoringFunction> fullScoringFunction = scoringFunctionFactory( item.scFuncType_, conformer, *item.fullProt_, item.transform_, 1e-3, true); fullScoringFunction->setNonDefaultCoefficients(this->currentCoeffs); std::shared_ptr<Optimizer::Optimizer> localOptimizer = optimizerFactory( item.localOptimizerType_, scoringFunction.get(), 1e-3); for (unsigned int k = 0; k < item.retryNumber_; ++k) { { std::lock_guard lock(*this->resultMutex); BOOST_LOG_TRIVIAL(debug) << "Run " << k << " of " << item.retryNumber_ << " for conformer " << conformerNum; } std::shared_ptr<Heuristics::GlobalHeuristic> globalHeuristic = globalHeuristicFactory( item.heurType_, scoringFunction.get(), localOptimizer.get(), item.seed_ + k, item.hParams_); globalHeuristic->search(); auto rawResultMatrix = globalHeuristic->getResultMatrix(); double score = scoringFunction->EvaluateOnlyIntermolecular(rawResultMatrix); double fullScore = fullScoringFunction->EvaluateOnlyIntermolecular(rawResultMatrix); double delta_full = fullScore / score; if (delta_full > 1.2 || delta_full < 0.80) { std::lock_guard lock(*this->resultMutex); BOOST_LOG_TRIVIAL(debug) << "Discrepency between score for partial and full protein, ignoring this run "; continue; } if (fullScore < bestScoreAmongRetry) { bestScoreAmongRetry = fullScore; bestComponentsAmongRetry = scoringFunction->EvaluateSubcomponents(rawResultMatrix); } } conformerNum++; } { std::lock_guard lock(*this->resultMutex); this->local_scores->push_back(bestScoreAmongRetry); this->local_referenceScores->push_back(item.referenceScore_); this->local_scoreComponents->push_back(bestComponentsAmongRetry); BOOST_LOG_TRIVIAL(debug) << " ---- Work item " << i << " -------"; BOOST_LOG_TRIVIAL(debug) << "Score : " << bestScoreAmongRetry; BOOST_LOG_TRIVIAL(debug) << "Delta G : " << item.referenceScore_; BOOST_LOG_TRIVIAL(debug) << " --------------------------"; } } } CalibratorEnsmallenLayer::CalibratorEnsmallenLayer(std::shared_ptr<std::vector<CalibratorWorkItem>> workitemVector_, std::vector<double> startingCoeffs_, std::vector<unsigned int> idxOfCoeffsToCalibrate_, unsigned int seed_, double differentialEpsilon_) : workitemVector(std::move(workitemVector_)), startingCoeffs(startingCoeffs_), idxOfCoeffsToCalibrate(idxOfCoeffsToCalibrate_), differentialEpsilon(differentialEpsilon_), rndGenerator(seed_) { this->numWorkItem = this->workitemVector->size(); for (unsigned int j = 0; j < this->numWorkItem; ++j) { this->shuffledIndexArray.push_back(j); } } double CalibratorEnsmallenLayer::doRealEvaluate(const arma::mat &x, size_t i, size_t batchSize) { auto resultMutex = std::make_shared<std::mutex>(); auto local_scores = std::make_shared<std::vector<double>>(); auto local_referenceScores = std::make_shared<std::vector<double>>(); auto local_scoreComponents = std::make_shared<std::vector<std::vector<std::tuple<std::string, double>>>>(); std::vector<double> coeffs = this->startingCoeffs; BOOST_ASSERT(this->idxOfCoeffsToCalibrate.size() == x.n_rows); for (unsigned int j = 0; j < this->idxOfCoeffsToCalibrate.size(); ++j) { coeffs[this->idxOfCoeffsToCalibrate[j]] = x[j]; } tbb::parallel_for(tbb::blocked_range<size_t>(i, i + batchSize), CalibratorLoopRunner(this->workitemVector, resultMutex, local_scores, local_referenceScores, local_scoreComponents, coeffs, this->shuffledIndexArray) ); double averageOutputScore = std::accumulate(local_scores->begin(), local_scores->end(), 0.0) / local_scores->size(); double averageReferenceScore = std::accumulate(local_referenceScores->begin(), local_referenceScores->end(), 0.0) / local_referenceScores->size(); double average_loss = averageOutputScore - averageReferenceScore; return average_loss; } double CalibratorEnsmallenLayer::Evaluate(const arma::mat &x, const size_t i, const size_t batchSize) { return this->doRealEvaluate(x, i, batchSize); } void CalibratorEnsmallenLayer::Gradient(const arma::mat &x, const size_t i, arma::mat &g, const size_t batchSize) { BOOST_ASSERT(x.n_rows == g.n_rows); double score_at_x = this->doRealEvaluate(x, i, batchSize); for (unsigned int j = 0; j < x.n_rows; ++j) { arma::mat gradientX = x; gradientX[j] = gradientX[j] + this->differentialEpsilon; double value = this->doRealEvaluate(gradientX, i, batchSize) - score_at_x; g[j] = value; } } void CalibratorEnsmallenLayer::Shuffle() { std::shuffle(this->shuffledIndexArray.begin(), this->shuffledIndexArray.end(), this->rndGenerator); } size_t CalibratorEnsmallenLayer::NumFunctions() { return this->numWorkItem; } arma::mat CalibratorEnsmallenLayer::getInitialParamMatrix() { arma::mat ret(this->idxOfCoeffsToCalibrate.size(), 1, arma::fill::zeros); for (unsigned int j = 0; j < this->idxOfCoeffsToCalibrate.size(); ++j) { ret[j] = this->startingCoeffs[this->idxOfCoeffsToCalibrate[j]]; } return ret; } } // namespace SmolDock
/* * Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES) * * This file is part of Orfeo Toolbox * * https://www.orfeo-toolbox.org/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef otbDisparityMapTo3DFilter_hxx #define otbDisparityMapTo3DFilter_hxx #include "otbDisparityMapTo3DFilter.h" #include "itkImageRegionConstIteratorWithIndex.h" #include "itkImageRegionIterator.h" namespace otb { template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::DisparityMapTo3DFilter() { // Set the number of inputs this->SetNumberOfRequiredInputs(5); this->SetNumberOfRequiredInputs(1); // Set the outputs this->SetNumberOfRequiredOutputs(1); this->SetNthOutput(0, TOutputImage::New()); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::SetHorizontalDisparityMapInput(const TDisparityImage* hmap) { // Process object is not const-correct so the const casting is required. this->SetNthInput(0, const_cast<TDisparityImage*>(hmap)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::SetVerticalDisparityMapInput(const TDisparityImage* vmap) { // Process object is not const-correct so the const casting is required. this->SetNthInput(1, const_cast<TDisparityImage*>(vmap)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::SetLeftEpipolarGridInput(const TEpipolarGridImage* grid) { // Process object is not const-correct so the const casting is required. this->SetNthInput(2, const_cast<TEpipolarGridImage*>(grid)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::SetRightEpipolarGridInput(const TEpipolarGridImage* grid) { // Process object is not const-correct so the const casting is required. this->SetNthInput(3, const_cast<TEpipolarGridImage*>(grid)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::SetDisparityMaskInput(const TMaskImage* mask) { // Process object is not const-correct so the const casting is required. this->SetNthInput(4, const_cast<TMaskImage*>(mask)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> const TDisparityImage* DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::GetHorizontalDisparityMapInput() const { if (this->GetNumberOfInputs() < 1) { return nullptr; } return static_cast<const TDisparityImage*>(this->itk::ProcessObject::GetInput(0)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> const TDisparityImage* DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::GetVerticalDisparityMapInput() const { if (this->GetNumberOfInputs() < 2) { return nullptr; } return static_cast<const TDisparityImage*>(this->itk::ProcessObject::GetInput(1)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> const TEpipolarGridImage* DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::GetLeftEpipolarGridInput() const { if (this->GetNumberOfInputs() < 3) { return nullptr; } return static_cast<const TEpipolarGridImage*>(this->itk::ProcessObject::GetInput(2)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> const TEpipolarGridImage* DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::GetRightEpipolarGridInput() const { if (this->GetNumberOfInputs() < 4) { return nullptr; } return static_cast<const TEpipolarGridImage*>(this->itk::ProcessObject::GetInput(3)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> const TMaskImage* DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::GetDisparityMaskInput() const { if (this->GetNumberOfInputs() < 5) { return nullptr; } return static_cast<const TMaskImage*>(this->itk::ProcessObject::GetInput(4)); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::GenerateOutputInformation() { const TDisparityImage* horizDisp = this->GetHorizontalDisparityMapInput(); TOutputImage* outputPtr = this->GetOutput(); outputPtr->SetLargestPossibleRegion(horizDisp->GetLargestPossibleRegion()); outputPtr->SetNumberOfComponentsPerPixel(3); // copy also origin and spacing outputPtr->SetOrigin(horizDisp->GetOrigin()); outputPtr->SetSignedSpacing(horizDisp->GetSignedSpacing()); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::GenerateInputRequestedRegion() { // For the epi grid : generate full buffer here ! TEpipolarGridImage* leftGrid = const_cast<TEpipolarGridImage*>(this->GetLeftEpipolarGridInput()); TEpipolarGridImage* rightGrid = const_cast<TEpipolarGridImage*>(this->GetRightEpipolarGridInput()); leftGrid->SetRequestedRegionToLargestPossibleRegion(); rightGrid->SetRequestedRegionToLargestPossibleRegion(); TOutputImage* outputDEM = this->GetOutput(); TDisparityImage* horizDisp = const_cast<TDisparityImage*>(this->GetHorizontalDisparityMapInput()); TDisparityImage* vertiDisp = const_cast<TDisparityImage*>(this->GetVerticalDisparityMapInput()); TMaskImage* maskDisp = const_cast<TMaskImage*>(this->GetDisparityMaskInput()); // We impose that both disparity map inputs have the same size if (vertiDisp && horizDisp->GetLargestPossibleRegion() != vertiDisp->GetLargestPossibleRegion()) { itkExceptionMacro(<< "Horizontal and vertical disparity maps do not have the same size ! Horizontal largest region: " << horizDisp->GetLargestPossibleRegion() << ", vertical largest region: " << vertiDisp->GetLargestPossibleRegion()); } if (maskDisp && horizDisp->GetLargestPossibleRegion() != maskDisp->GetLargestPossibleRegion()) { itkExceptionMacro(<< "Disparity map and mask do not have the same size ! Map region : " << horizDisp->GetLargestPossibleRegion() << ", mask region : " << maskDisp->GetLargestPossibleRegion()); } horizDisp->SetRequestedRegion(outputDEM->GetRequestedRegion()); if (vertiDisp) { vertiDisp->SetRequestedRegion(outputDEM->GetRequestedRegion()); } if (maskDisp) { maskDisp->SetRequestedRegion(outputDEM->GetRequestedRegion()); } // Check that the keywordlists are not empty if (!m_LeftImageMetadata->HasSensorGeometry() || !m_RightImageMetadata->HasSensorGeometry()) { itkExceptionMacro(<< "At least one of the image keywordlist is empty : can't instantiate corresponding projection"); } } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::BeforeThreadedGenerateData() { // Instantiate transforms m_LeftToGroundTransform = RSTransformType::New(); m_RightToGroundTransform = RSTransformType::New(); m_LeftToGroundTransform->SetInputImageMetadata(m_LeftImageMetadata); m_RightToGroundTransform->SetInputImageMetadata(m_RightImageMetadata); m_LeftToGroundTransform->InstantiateTransform(); m_RightToGroundTransform->InstantiateTransform(); } template <class TDisparityImage, class TOutputImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapTo3DFilter<TDisparityImage, TOutputImage, TEpipolarGridImage, TMaskImage>::ThreadedGenerateData( const RegionType& itkNotUsed(outputRegionForThread), itk::ThreadIdType itkNotUsed(threadId)) { const TDisparityImage* horizDisp = this->GetHorizontalDisparityMapInput(); const TDisparityImage* vertiDisp = this->GetVerticalDisparityMapInput(); const TMaskImage* disparityMask = this->GetDisparityMaskInput(); TOutputImage* outputDEM = this->GetOutput(); // Get epipolar grids const TEpipolarGridImage* leftGrid = this->GetLeftEpipolarGridInput(); const TEpipolarGridImage* rightGrid = this->GetRightEpipolarGridInput(); typename TEpipolarGridImage::RegionType gridRegion = leftGrid->GetLargestPossibleRegion(); typename TOutputImage::RegionType outputRequestedRegion = outputDEM->GetRequestedRegion(); itk::ImageRegionIterator<OutputImageType> demIt(outputDEM, outputRequestedRegion); itk::ImageRegionConstIteratorWithIndex<DisparityMapType> horizIt(horizDisp, outputRequestedRegion); demIt.GoToBegin(); horizIt.GoToBegin(); bool useVerti = false; itk::ImageRegionConstIteratorWithIndex<DisparityMapType> vertiIt; if (vertiDisp) { useVerti = true; vertiIt = itk::ImageRegionConstIteratorWithIndex<DisparityMapType>(vertiDisp, outputRequestedRegion); vertiIt.GoToBegin(); } bool useMask = false; itk::ImageRegionConstIterator<MaskImageType> maskIt; if (disparityMask) { useMask = true; maskIt = itk::ImageRegionConstIterator<MaskImageType>(disparityMask, outputRequestedRegion); maskIt.GoToBegin(); } double elevationMin = 0.0; double elevationMax = 300.0; typename OptimizerType::Pointer optimizer = OptimizerType::New(); typename TDisparityImage::PointType epiPoint; itk::ContinuousIndex<double, 2> gridIndexConti; double subPixIndex[2]; typename GridImageType::IndexType ulIndex, urIndex, lrIndex, llIndex; typename GridImageType::PixelType ulPixel(2); typename GridImageType::PixelType urPixel(2); typename GridImageType::PixelType lrPixel(2); typename GridImageType::PixelType llPixel(2); typename GridImageType::PixelType cPixel(2); typename GridImageType::PointType ulPoint; typename GridImageType::PointType urPoint; typename GridImageType::PointType lrPoint; typename GridImageType::PointType llPoint; TDPointType sensorPoint; TDPointType leftGroundHmin; TDPointType leftGroundHmax; TDPointType rightGroundHmin; TDPointType rightGroundHmax; while (!demIt.IsAtEnd() && !horizIt.IsAtEnd()) { // check mask value if any if (useMask) { if (!(maskIt.Get() > 0)) { // TODO : what to do when masked ? put a no-data value ? typename OutputImageType::PixelType pixel3D(3); pixel3D.Fill(0); demIt.Set(pixel3D); ++demIt; ++horizIt; if (useVerti) ++vertiIt; ++maskIt; continue; } } // compute left ray horizDisp->TransformIndexToPhysicalPoint(horizIt.GetIndex(), epiPoint); leftGrid->TransformPhysicalPointToContinuousIndex(epiPoint, gridIndexConti); ulIndex[0] = static_cast<int>(std::floor(gridIndexConti[0])); ulIndex[1] = static_cast<int>(std::floor(gridIndexConti[1])); if (ulIndex[0] < gridRegion.GetIndex(0)) ulIndex[0] = gridRegion.GetIndex(0); if (ulIndex[1] < gridRegion.GetIndex(1)) ulIndex[1] = gridRegion.GetIndex(1); if (ulIndex[0] > (gridRegion.GetIndex(0) + static_cast<int>(gridRegion.GetSize(0)) - 2)) { ulIndex[0] = gridRegion.GetIndex(0) + gridRegion.GetSize(0) - 2; } if (ulIndex[1] > (gridRegion.GetIndex(1) + static_cast<int>(gridRegion.GetSize(1)) - 2)) { ulIndex[1] = gridRegion.GetIndex(1) + gridRegion.GetSize(1) - 2; } urIndex[0] = ulIndex[0] + 1; urIndex[1] = ulIndex[1]; lrIndex[0] = ulIndex[0] + 1; lrIndex[1] = ulIndex[1] + 1; llIndex[0] = ulIndex[0]; llIndex[1] = ulIndex[1] + 1; subPixIndex[0] = gridIndexConti[0] - static_cast<double>(ulIndex[0]); subPixIndex[1] = gridIndexConti[1] - static_cast<double>(ulIndex[1]); leftGrid->TransformIndexToPhysicalPoint(ulIndex, ulPoint); leftGrid->TransformIndexToPhysicalPoint(urIndex, urPoint); leftGrid->TransformIndexToPhysicalPoint(lrIndex, lrPoint); leftGrid->TransformIndexToPhysicalPoint(llIndex, llPoint); ulPixel[0] = (leftGrid->GetPixel(ulIndex))[0] + ulPoint[0]; ulPixel[1] = (leftGrid->GetPixel(ulIndex))[1] + ulPoint[1]; urPixel[0] = (leftGrid->GetPixel(urIndex))[0] + urPoint[0]; urPixel[1] = (leftGrid->GetPixel(urIndex))[1] + urPoint[1]; lrPixel[0] = (leftGrid->GetPixel(lrIndex))[0] + lrPoint[0]; lrPixel[1] = (leftGrid->GetPixel(lrIndex))[1] + lrPoint[1]; llPixel[0] = (leftGrid->GetPixel(llIndex))[0] + llPoint[0]; llPixel[1] = (leftGrid->GetPixel(llIndex))[1] + llPoint[1]; cPixel = (ulPixel * (1.0 - subPixIndex[0]) + urPixel * subPixIndex[0]) * (1.0 - subPixIndex[1]) + (llPixel * (1.0 - subPixIndex[0]) + lrPixel * subPixIndex[0]) * subPixIndex[1]; sensorPoint[0] = cPixel[0]; sensorPoint[1] = cPixel[1]; sensorPoint[2] = elevationMin; leftGroundHmin = m_LeftToGroundTransform->TransformPoint(sensorPoint); sensorPoint[2] = elevationMax; leftGroundHmax = m_LeftToGroundTransform->TransformPoint(sensorPoint); // compute right ray itk::ContinuousIndex<double, 2> rightIndexEstimate; rightIndexEstimate[0] = static_cast<double>((horizIt.GetIndex())[0]) + static_cast<double>(horizIt.Get()); double verticalShift = 0; if (useVerti) verticalShift = static_cast<double>(vertiIt.Get()); rightIndexEstimate[1] = static_cast<double>((horizIt.GetIndex())[1]) + verticalShift; horizDisp->TransformContinuousIndexToPhysicalPoint(rightIndexEstimate, epiPoint); rightGrid->TransformPhysicalPointToContinuousIndex(epiPoint, gridIndexConti); ulIndex[0] = static_cast<int>(std::floor(gridIndexConti[0])); ulIndex[1] = static_cast<int>(std::floor(gridIndexConti[1])); if (ulIndex[0] < gridRegion.GetIndex(0)) ulIndex[0] = gridRegion.GetIndex(0); if (ulIndex[1] < gridRegion.GetIndex(1)) ulIndex[1] = gridRegion.GetIndex(1); if (ulIndex[0] > (gridRegion.GetIndex(0) + static_cast<int>(gridRegion.GetSize(0)) - 2)) { ulIndex[0] = gridRegion.GetIndex(0) + gridRegion.GetSize(0) - 2; } if (ulIndex[1] > (gridRegion.GetIndex(1) + static_cast<int>(gridRegion.GetSize(1)) - 2)) { ulIndex[1] = gridRegion.GetIndex(1) + gridRegion.GetSize(1) - 2; } urIndex[0] = ulIndex[0] + 1; urIndex[1] = ulIndex[1]; lrIndex[0] = ulIndex[0] + 1; lrIndex[1] = ulIndex[1] + 1; llIndex[0] = ulIndex[0]; llIndex[1] = ulIndex[1] + 1; subPixIndex[0] = gridIndexConti[0] - static_cast<double>(ulIndex[0]); subPixIndex[1] = gridIndexConti[1] - static_cast<double>(ulIndex[1]); rightGrid->TransformIndexToPhysicalPoint(ulIndex, ulPoint); rightGrid->TransformIndexToPhysicalPoint(urIndex, urPoint); rightGrid->TransformIndexToPhysicalPoint(lrIndex, lrPoint); rightGrid->TransformIndexToPhysicalPoint(llIndex, llPoint); ulPixel[0] = (rightGrid->GetPixel(ulIndex))[0] + ulPoint[0]; ulPixel[1] = (rightGrid->GetPixel(ulIndex))[1] + ulPoint[1]; urPixel[0] = (rightGrid->GetPixel(urIndex))[0] + urPoint[0]; urPixel[1] = (rightGrid->GetPixel(urIndex))[1] + urPoint[1]; lrPixel[0] = (rightGrid->GetPixel(lrIndex))[0] + lrPoint[0]; lrPixel[1] = (rightGrid->GetPixel(lrIndex))[1] + lrPoint[1]; llPixel[0] = (rightGrid->GetPixel(llIndex))[0] + llPoint[0]; llPixel[1] = (rightGrid->GetPixel(llIndex))[1] + llPoint[1]; cPixel = (ulPixel * (1.0 - subPixIndex[0]) + urPixel * subPixIndex[0]) * (1.0 - subPixIndex[1]) + (llPixel * (1.0 - subPixIndex[0]) + lrPixel * subPixIndex[0]) * subPixIndex[1]; sensorPoint[0] = cPixel[0]; sensorPoint[1] = cPixel[1]; sensorPoint[2] = elevationMin; rightGroundHmin = m_RightToGroundTransform->TransformPoint(sensorPoint); sensorPoint[2] = elevationMax; rightGroundHmax = m_RightToGroundTransform->TransformPoint(sensorPoint); // Compute ray intersection with the generic line of sight optimizer typename PointSetType::Pointer pointSetA = PointSetType::New(); typename PointSetType::Pointer pointSetB = PointSetType::New(); pointSetA->SetPoint(0, leftGroundHmax); pointSetA->SetPoint(1, rightGroundHmax); pointSetA->SetPointData(0, 0); pointSetA->SetPointData(1, 1); pointSetB->SetPoint(0, leftGroundHmin); pointSetB->SetPoint(1, rightGroundHmin); pointSetB->SetPointData(0, 0); pointSetB->SetPointData(1, 1); TDPointType midPoint3D = optimizer->Compute(pointSetA, pointSetB); // record 3D point typename OutputImageType::PixelType pixel3D(3); pixel3D[0] = midPoint3D[0]; pixel3D[1] = midPoint3D[1]; pixel3D[2] = midPoint3D[2]; demIt.Set(pixel3D); ++demIt; ++horizIt; if (useVerti) ++vertiIt; if (useMask) ++maskIt; } } } #endif
// Copyright (c) 2012-2016 The Helveticum Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "streams.h" #include "support/allocators/zeroafterfree.h" #include "test/test_helveticum.h" #include <boost/assign/std/vector.hpp> // for 'operator+=()' #include <boost/test/unit_test.hpp> using namespace boost::assign; // bring 'operator+=()' into scope BOOST_FIXTURE_TEST_SUITE(streams_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(streams_vector_writer) { unsigned char a(1); unsigned char b(2); unsigned char bytes[] = { 3, 4, 5, 6 }; std::vector<unsigned char> vch; // Each test runs twice. Serializing a second time at the same starting // point should yield the same results, even if the first test grew the // vector. CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 0, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{1, 2}})); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 0, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{1, 2}})); vch.clear(); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 1, 2}})); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 1, 2}})); vch.clear(); vch.resize(5, 0); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 1, 2, 0}})); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 1, 2, 0}})); vch.clear(); vch.resize(4, 0); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 3, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 0, 1, 2}})); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 3, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 0, 1, 2}})); vch.clear(); vch.resize(4, 0); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 4, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 0, 0, 1, 2}})); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 4, a, b); BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 0, 0, 1, 2}})); vch.clear(); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 0, FLATDATA(bytes)); BOOST_CHECK((vch == std::vector<unsigned char>{{3, 4, 5, 6}})); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 0, FLATDATA(bytes)); BOOST_CHECK((vch == std::vector<unsigned char>{{3, 4, 5, 6}})); vch.clear(); vch.resize(4, 8); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, FLATDATA(bytes), b); BOOST_CHECK((vch == std::vector<unsigned char>{{8, 8, 1, 3, 4, 5, 6, 2}})); CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, FLATDATA(bytes), b); BOOST_CHECK((vch == std::vector<unsigned char>{{8, 8, 1, 3, 4, 5, 6, 2}})); vch.clear(); } BOOST_AUTO_TEST_CASE(streams_serializedata_xor) { std::vector<char> in; std::vector<char> expected_xor; std::vector<unsigned char> key; CDataStream ds(in, 0, 0); // Degenerate case key += '\x00','\x00'; ds.Xor(key); BOOST_CHECK_EQUAL( std::string(expected_xor.begin(), expected_xor.end()), std::string(ds.begin(), ds.end())); in += '\x0f','\xf0'; expected_xor += '\xf0','\x0f'; // Single character key ds.clear(); ds.insert(ds.begin(), in.begin(), in.end()); key.clear(); key += '\xff'; ds.Xor(key); BOOST_CHECK_EQUAL( std::string(expected_xor.begin(), expected_xor.end()), std::string(ds.begin(), ds.end())); // Multi character key in.clear(); expected_xor.clear(); in += '\xf0','\x0f'; expected_xor += '\x0f','\x00'; ds.clear(); ds.insert(ds.begin(), in.begin(), in.end()); key.clear(); key += '\xff','\x0f'; ds.Xor(key); BOOST_CHECK_EQUAL( std::string(expected_xor.begin(), expected_xor.end()), std::string(ds.begin(), ds.end())); } BOOST_AUTO_TEST_SUITE_END()
#include <cmath> #include "gameplayState.h" #include "app.h" #include "Assets.h" #include "noiseGenerator.h" #include "terrain.h" #include "player.h" gameplayState::gameplayState(app * tEngine, sf::RenderWindow * tWindow) { window = tWindow; engine = tEngine; init(); } gameplayState::~gameplayState() { delete currentTerrain; delete currentBiomManager; for (auto & object : objects) { delete object; } } void gameplayState::update(float deltaTime) { if (!currentBiomManager->biomsToDraw.empty()) mainCamera.biom = currentBiomManager->biomsToDraw.front()->biomId; if (player->px > mainCamera.windowWidth * CHUNK_SIZE) { player->px = mainCamera.windowWidth / 2; currentTerrain->setPosition(0, currentTerrain->getPosition().y); currentBiomManager->setPosition(0, currentBiomManager->getPosition().y); } for (int x = 0; x < 3; x++) for (auto & i : objects) { i->ay += GRAVITY; i->vx += i->ax * deltaTime; i->vy += i->ay * deltaTime; float newPosX = i->px + i->vx * deltaTime; float newPosY = i->py + i->vy * deltaTime; i->ax = 0.0f; i->ay = 0.0f; bool colision = false; for (int v = 0; v < currentTerrain->terrainVerticies.size(); v++) { float testX = v * (window->getSize().x / (currentTerrain->terrainVerticies.size() - MARGIN)) + currentTerrain->getPosition().x; float testY = currentTerrain->terrainVerticies[v] * 100 + window->getSize().y * 0.78; float distance = sqrtf((newPosX - testX) * (newPosX - testX) + (newPosY - testY) * (newPosY - testY)); if (distance < i->radius - 1) { colision = true; } if (currentTerrain->obstacles[v] != nullptr) { if (distance < (i->radius + currentTerrain->obstacles[v]->radius)) { i->vx += currentTerrain->obstacles[v]->slowDown; if (i->vx < 0) i->vx = 0; delete currentTerrain->obstacles[v]; currentTerrain->obstacles[v] = nullptr; } } } if (colision) { i->canJump = true; if (i->vx != 0) i->py -= 1.0f; i->vy = 0.0f; } else { i->px = newPosX; i->py = newPosY; } } float cameraX = player->px; float cameraY = player->py; if (cameraY > mainCamera.windowHeight / 2) { cameraY = mainCamera.windowHeight / 2; } for (auto & o : objects) { o->update(deltaTime); } gameView.setCenter(cameraX, cameraY); window->setView(gameView); mainCamera.view = &window->getView(); currentTerrain->update(mainCamera, deltaTime, mainCamera.windowHeight * 0.78); currentBiomManager->setPosition(player->px - mainCamera.windowWidth / 2, 0); currentBiomManager->update(mainCamera, deltaTime, mainCamera.windowHeight * 0.78); playerScore += player->vx * deltaTime;; if (player->vx <= 50) { gameOver = true; engine->score = playerScore; engine->changeState(GAMEOVER); } } void gameplayState::handleEvents() { while (window->pollEvent(event)) { switch (event.type) { case sf::Event::Closed: window->close(); break; case sf::Event::KeyPressed: switch (event.key.code) { case sf::Keyboard::Left: //player->vx = 0.0f; break; case sf::Keyboard::Right: //player->vx = 300.0f; break; case sf::Keyboard::Space: if(player->canJump) player->vy = player->jumpiness * -1; player->canJump = false; break; } break; } } } void gameplayState::render() { window->clear(sf::Color(80,175,228)); window->draw(*currentBiomManager); window->draw(*currentTerrain); for (auto & i : objects) { i->updateTextures(); window->draw(*i); } window->display(); } void gameplayState::scale() { mainCamera.windowHeight = window->getSize().y; mainCamera.windowWidth = window->getSize().x; reset(); } void gameplayState::init() { srand(time(NULL)); player = new Player(window->getSize().x / 2.0f,window->getSize().y / 2); objects.push_back(player); gameView.setCenter(player->px,player->py); gameView.setSize(window->getSize().x,window->getSize().y); window->setView(gameView); currentTerrain = new terrain(window->getSize().x, sf::Color(30,30,30)); currentBiomManager = new biomManager(player); } void gameplayState::reset() { player->vx = 300.0f; player->vy = 0; player->px = window->getSize().x * 0.5f; player->py = window->getSize().y * 0.7f; gameView.setCenter(player->px, player->py); gameView.setSize(window->getSize().x, window->getSize().y); window->setView(gameView); playerScore = 0.0f; delete currentBiomManager; delete currentTerrain; currentTerrain = new terrain(window->getSize().x, sf::Color(30, 30, 30)); currentBiomManager = new biomManager(player); player->ax = 0.01f; update(0.0f); }
///////////////////////// /* // stitching.cpp // adapted from stitching.cpp sample distributed with openCV source. // adapted by Foundry for iOS */ /*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // * The name of the copyright holders may not be used to endorse or promote products // derived from this software without specific prior written permission. // // This software is provided by the copyright holders and contributors "as is" and // any express or implied warranties, including, but not limited to, the implied // warranties of merchantability and fitness for a particular purpose are disclaimed. // In no event shall the Intel Corporation or contributors be liable for any direct, // indirect, incidental, special, exemplary, or consequential damages // (including, but not limited to, procurement of substitute goods or services; // loss of use, data, or profits; or business interruption) however caused // and on any theory of liability, whether in contract, strict liability, // or tort (including negligence or otherwise) arising in any way out of // the use of this software, even if advised of the possibility of such damage. // // M*/ #include "stitching.h" #include <iostream> #include <fstream> //openCV 2.4.x //#include "opencv2/stitching/stitcher.hpp" //openCV 3.x #include "opencv2/stitching.hpp" using namespace std; using namespace cv; bool try_use_gpu = false; vector<Mat> imgs; string result_name = "result.jpg"; void printUsage(); int parseCmdArgs(int argc, char** argv); cv::Mat stitch (vector<Mat>& images) { imgs = images; Mat pano; Stitcher stitcher = Stitcher::createDefault(try_use_gpu); Stitcher::Status status = stitcher.stitch(imgs, pano); if (status != Stitcher::OK) { cout << "Can't stitch images, error code = " << int(status) << endl; //return 0; } return pano; } //// DEPRECATED CODE ////// /* the code below this line is unused. it is derived from the openCV 'stitched' C++ sample left in here only for illustration purposes - refactor main loop as member function - replace user input with iOS GUI - replace ouput with return value to CVWrapper */ //refactored as stitch function int deprecatedMain(int argc, char* argv[]) { int retval = parseCmdArgs(argc, argv); if (retval) return -1; Mat pano; Stitcher stitcher = Stitcher::createDefault(try_use_gpu); Stitcher::Status status = stitcher.stitch(imgs, pano); if (status != Stitcher::OK) { cout << "Can't stitch images, error code = " << int(status) << endl; return -1; } imwrite(result_name, pano); return 0; } //unused void printUsage() { cout << "Rotation model images stitcher.\n\n" "stitching img1 img2 [...imgN]\n\n" "Flags:\n" " --try_use_gpu (yes|no)\n" " Try to use GPU. The default value is 'no'. All default values\n" " are for CPU mode.\n" " --output <result_img>\n" " The default is 'result.jpg'.\n"; } //all input passed in via CVWrapper to stitcher function int parseCmdArgs(int argc, char** argv) { if (argc == 1) { printUsage(); return -1; } for (int i = 1; i < argc; ++i) { if (string(argv[i]) == "--help" || string(argv[i]) == "/?") { printUsage(); return -1; } else if (string(argv[i]) == "--try_use_gpu") { if (string(argv[i + 1]) == "no") try_use_gpu = false; else if (string(argv[i + 1]) == "yes") try_use_gpu = true; else { cout << "Bad --try_use_gpu flag value\n"; return -1; } i++; } else if (string(argv[i]) == "--output") { result_name = argv[i + 1]; i++; } else { Mat img = imread(argv[i]); if (img.empty()) { cout << "Can't read image '" << argv[i] << "'\n"; return -1; } imgs.push_back(img); } } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string> #include <math.h> #include <cstring> #include <iostream> #include <sstream> #include <cmath> #include <vector> #include <map> #include <algorithm> #include <assert.h> #include "../src/tools.h" // Numerical tools int main(int argc, char *argv[]) { // Test array-array L2 norm double v1 [5] = {0, 3, 3, 3, 3}; double v1short [3] = {0, 3, 3}; double result = 6; int len = 5; int lenshort = 3; assert(L2(v1,len)==result && "tools - L2, array gave an unexpected result"); // Test vector L2 norm std::vector<double> vv1; for (int i=0;i<len;i++) { vv1.push_back(v1[i]); } assert(L2(vv1)==result && "tools - L2, vector gave an unexpected result"); // Test Vector L2 norm std::vector<double> vv1short; for (int i=0;i<lenshort;i++) { vv1short.push_back(v1short[i]); } Vector vvv1; for (int i=0;i<2;i++) { vvv1.push_back(vv1short); } assert(L2(vvv1)==result && "tools - L2, Vector gave an unexpected result"); return 0; }
// ConsoleDemo.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "stdafx.h" //#include <iostream> //#include <windows.h> /********************************************************* Functiopn: Description:控制台程序 *******************************************************/ int main() { std::cout << "Hello Console!\n"; return getchar(); } // 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 // 调试程序: F5 或调试 >“开始调试”菜单 // 入门使用技巧: // 1. 使用解决方案资源管理器窗口添加/管理文件 // 2. 使用团队资源管理器窗口连接到源代码管理 // 3. 使用输出窗口查看生成输出和其他消息 // 4. 使用错误列表窗口查看错误 // 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 // 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件
/** * Copyright (C) 2015-2019 * Author Alvin Ahmadov <alvin.dev.ahmadov@gmail.com> * * This file is part of Dixter Project * License-Identifier: MIT License * See README.md for more information. */ #pragma once #include "Types.hpp" #include <map> #include <list> namespace Dixter { namespace Unicode { namespace { const TCodePoint am[] = { 0x0531, 0x0532, 0x0533, 0x0534, 0x0535, 0x0536, 0x0537, 0x0538, 0x0539, 0x053A, 0x053B, 0x053C, 0x053D, 0x053E, 0x053F, 0x0540, 0x0541, 0x0542, 0x0543, 0x0544, 0x0545, 0x0546, 0x0547, 0x0548, 0x0549, 0x054A, 0x054B, 0x054C, 0x054D, 0x054E, 0x054F, 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, 0x0587, 0x0555, 0x0556, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0587, 0x0585, 0x0586, 0 }; const TCodePoint az[] = { 0x0041, 0x0042, 0x0043, 0x00C7, 0x0044, 0x0045, 0x018F, 0x0046, 0x0047, 0x011E, 0x0048, 0x0058, 0x0049, 0x0130, 0x004A, 0x004B, 0x0051, 0x004C, 0x004D, 0x004E, 0x004F, 0x00D6, 0x0050, 0x0052, 0x0053, 0x015E, 0x0054, 0x0055, 0x00DC, 0x0056, 0x0059, 0x005A, 0x0061, 0x0062, 0x0063, 0x00E7, 0x0064, 0x0065, 0x0259, 0x0066, 0x0067, 0x011F, 0x0068, 0x0078, 0x0131, 0x0069, 0x006A, 0x006B, 0x0071, 0x006C, 0x006D, 0x006E, 0x006F, 0x00F6, 0x0070, 0x0072, 0x0073, 0x015F, 0x0074, 0x0075, 0x00FC, 0x0076, 0x0079, 0x007A, 0 }; const TCodePoint cu[] = { 0x12000, 0x12001, 0x12002, 0x12003, 0x12004, 0x12005, 0x12006, 0x12007, 0x12008, 0x12009, 0x1200A, 0x1200B, 0x1200C, 0x1200D, 0x1200E, 0x1200F, 0x12010, 0x12011, 0x12012, 0x12013, 0x12014, 0x12015, 0x12016, 0x12017, 0x12018, 0x12019, 0x1201A, 0x1201B, 0x1201C, 0x1201D, 0x1201E, 0x1201F, 0x12020, 0x12021, 0x12022, 0x12023, 0x12024, 0x12025, 0x12026, 0x12027, 0x12028, 0x12029, 0x1202A, 0x1202B, 0x1202C, 0x1202D, 0x1202E, 0x1202F, 0x12030, 0x12031, 0x12032, 0x12033, 0x12034, 0x12035, 0x12036, 0x12037, 0x12038, 0x12039, 0x1203A, 0x1203B, 0x1203C, 0x1203D, 0x1203E, 0x1203F, 0x12040, 0x12041, 0x12042, 0x12043, 0x12044, 0x12045, 0x12046, 0x12047, 0x12048, 0x12049, 0x1204A, 0x1204B, 0x1204C, 0x1204D, 0x1204E, 0x1204F, 0x12050, 0x12051, 0x12052, 0x12053, 0x12054, 0x12055, 0x12056, 0x12057, 0x12058, 0x12059, 0x1205A, 0x1205B, 0x1205C, 0x1205D, 0x1205E, 0x1205F, 0x12060, 0x12061, 0x12062, 0x12063, 0x12064, 0x12065, 0x12066, 0x12067, 0x12068, 0x12069, 0x1206A, 0x1206B, 0x1206C, 0x1206D, 0x1206E, 0x1206F, 0x12070, 0x12071, 0x12072, 0x12073, 0x12074, 0x12075, 0x12076, 0x12077, 0x12078, 0x12079, 0x1207A, 0x1207B, 0x1207C, 0x1207D, 0x1207E, 0x1207F, 0x12080, 0x12081, 0x12082, 0x12083, 0x12084, 0x12085, 0x12086, 0x12087, 0x12088, 0x12089, 0x1208A, 0x1208B, 0x1208C, 0x1208D, 0x1208E, 0x1208F, 0x12090, 0x12091, 0x12092, 0x12093, 0x12094, 0x12095, 0x12096, 0x12097, 0x12098, 0x12099, 0x1209A, 0x1209B, 0x1209C, 0x1209D, 0x1209E, 0x1209F, 0x120A0, 0x120A1, 0x120A2, 0x120A3, 0x120A4, 0x120A5, 0x120A6, 0x120A7, 0x120A8, 0x120A9, 0x120AA, 0x120AB, 0x120AC, 0x120AD, 0x120AE, 0x120AF, 0x120B0, 0x120B1, 0x120B2, 0x120B3, 0x120B4, 0x120B5, 0x120B6, 0x120B7, 0x120B8, 0x120B9, 0x120BA, 0x120BB, 0x120BC, 0x120BD, 0x120BE, 0x120BF, 0x120C0, 0x120C1, 0x120C2, 0x120C3, 0x120C4, 0x120C5, 0x120C6, 0x120C7, 0x120C8, 0x120C9, 0x120CA, 0x120CB, 0x120CC, 0x120CD, 0x120CE, 0x120CF, 0x120D0, 0x120D1, 0x120D2, 0x120D3, 0x120D4, 0x120D5, 0x120D6, 0x120D7, 0x120D8, 0x120D9, 0x120DA, 0x120DB, 0x120DC, 0x120DD, 0x120DE, 0x120DF, 0x120E0, 0x120E1, 0x120E2, 0x120E3, 0x120E4, 0x120E5, 0x120E6, 0x120E7, 0x120E8, 0x120E9, 0x120EA, 0x120EB, 0x120EC, 0x120ED, 0x120EE, 0x120EF, 0x120F0, 0x120F1, 0x120F2, 0x120F3, 0x120F4, 0x120F5, 0x120F6, 0x120F7, 0x120F8, 0x120F9, 0x120FA, 0x120FB, 0x120FC, 0x120FD, 0x120FE, 0x120FF, 0x12100, 0x12101, 0x12102, 0x12103, 0x12104, 0x12105, 0x12106, 0x12107, 0x12108, 0x12109, 0x1210A, 0x1210B, 0x1210C, 0x1210D, 0x1210E, 0x1210F, 0x12110, 0x12111, 0x12112, 0x12113, 0x12114, 0x12115, 0x12116, 0x12117, 0x12118, 0x12119, 0x1211A, 0x1211B, 0x1211C, 0x1211D, 0x1211E, 0x1211F, 0 }; const TCodePoint da[] = { 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00c6, 0x00D8, 0x00C5, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E6, 0x00F8, 0x00E5, 0 }; const TCodePoint de[] = { 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00c4, 0x00d6, 0x00DC, 0x1E9E, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E4, 0x00f6, 0x00FC, 0x00DF, 0 }; const TCodePoint en[] = { 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0 }; const TCodePoint fr[] = { 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00E9, 0x00E0, 0x00E8, 0x00F9, 0x00E2, 0x00EA, 0x00EE, 0x00F4, 0x00FB, 0x00EB, 0x00EF, 0x00FC, 0x00FF, 0x00E7, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E9, 0x00E0, 0x00E8, 0x00F9, 0x00E2, 0x00EA, 0x00EE, 0x00F4, 0x00FB, 0x00EB, 0x00EF, 0x00FC, 0x00FF, 0x00E7, 0 }; const TCodePoint ft[] = { 0x16A0, 0x16A1, 0x16A2, 0x16A3, 0x16A4, 0x16A5, 0x16A6, 0x16A7, 0x16A8, 0x16A9, 0x16AA, 0x16AB, 0x16AC, 0x16AD, 0x16AE, 0x16AF, 0x16B0, 0x16B1, 0x16B2, 0x16B3, 0x16B4, 0x16B5, 0x16B6, 0x16B7, 0x16B8, 0x16B9, 0x16BA, 0x16BB, 0x16BC, 0x16BD, 0x16BE, 0x16BF, 0x16C0, 0x16C1, 0x16C2, 0x16C3, 0x16C4, 0x16C5, 0x16C6, 0x16C7, 0x16C8, 0x16C9, 0x16CA, 0x16CB, 0x16CC, 0x16CD, 0x16CE, 0x16CF, 0x16D0, 0x16D1, 0x16D2, 0x16D3, 0x16D4, 0x16D5, 0x16D6, 0x16D7, 0x16D8, 0x16D9, 0x16DA, 0x16DB, 0x16DC, 0x16DD, 0x16DE, 0x16DF, 0x16E0, 0x16E1, 0x16E2, 0x16E3, 0x16E4, 0x16E5, 0x16E6, 0x16E7, 0x16E8, 0x16E9, 0x16EA, 0 }; const TCodePoint jp[] = { 0x30A1, 0x30A2, 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA, 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30B1, 0x30B2, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, 0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, 0x30C1, 0x30C2, 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, 0x30C9, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, 0x30D1, 0x30D2, 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, 0x30D9, 0x30DA, 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30F5, 0x30F6, 0x30F7, 0x30F8, 0x30F9, 0x30FA, 0x30FB, 0x30FC, 0x30FD, 0x30FE, 0x30FF, 0 }; const TCodePoint is[] = { 0x0041, 0x00C1, 0x0042, 0x0044, 0x00D0, 0x0045, 0x00C9, 0x0046, 0x0047, 0x0048, 0x0049, 0x00CD, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x00D3, 0x0050, 0x0052, 0x0053, 0x0054, 0x0055, 0x00DA, 0x0056, 0x0058, 0x0059, 0x00DD, 0x00DE, 0x00C6, 0x00D6, 0x0061, 0x00E1, 0x0062, 0x0064, 0x00F0, 0x0065, 0x00E9, 0x0066, 0x0067, 0x0068, 0x0069, 0x00ED, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x00F3, 0x0070, 0x0072, 0x0073, 0x0074, 0x0075, 0x00FA, 0x0076, 0x0078, 0x0079, 0x00FD, 0x00FE, 0x00E6, 0 }; const TCodePoint ru[] = { 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0 }; const TCodePoint no[] = { 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00C6, 0x00D8, 0x00C5, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E6, 0x00F8, 0x00E5, 0 }; const TCodePoint sv[] = { 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x00C5, 0x00D6, 0x00C4, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x00E5, 0x00F6, 0x00E4, 0 }; const TCodePoint tr[] = { 0x0041, 0x0042, 0x0043, 0x00C7, 0x0044, 0x0045, 0x0046, 0x0047, 0x011E, 0x0048, 0x0058, 0x0049, 0x0130, 0x004A, 0x004B, 0x0051, 0x004C, 0x004D, 0x004E, 0x004F, 0x00D6, 0x0050, 0x0052, 0x0053, 0x015E, 0x0054, 0x0055, 0x00DC, 0x0056, 0x0059, 0x005A, 0x0061, 0x0062, 0x0063, 0x00E7, 0x0064, 0x0065, 0x0066, 0x0067, 0x011F, 0x0068, 0x0078, 0x0131, 0x0069, 0x006A, 0x006B, 0x0071, 0x006C, 0x006D, 0x006E, 0x006F, 0x00F6, 0x0070, 0x0072, 0x0073, 0x015F, 0x0074, 0x0075, 0x00FC, 0x0076, 0x0079, 0x007A, 0 }; } // anonymous namespace using TCodePointMap = std::map<TString, const TCodePoint*>; const static TCodePointMap langdefs { {"am", am}, {"az", az}, {"cu", cu}, {"da", da}, {"de", de}, {"en", en}, {"fr", fr}, {"ft", ft}, {"is", is}, {"jp", jp}, {"ru", ru}, {"no", no}, {"sv", sv}, {"tr", tr} }; } // namespace Unicode } // namespace Dixter
/******************************************************************************* Copyright(c) 2015-2020 Parker Hannifin Corp. All rights reserved. MIT Licensed. See the included LICENSE.txt for a copy of the full MIT License. *******************************************************************************/ #include "stdafx.h" #include "SyncNodeConfig.h" #include "mscl/MicroStrain/Wireless/WirelessModels.h" #include "mscl/MicroStrain/Wireless/SyncNetworkInfo.h" #include "mscl/MicroStrain/SampleUtils.h" #include "WirelessNodeConfig.h" namespace mscl { SyncNodeConfig::SyncNodeConfig(const SyncNetworkInfo* networkInfo): m_networkInfo(networkInfo), m_eepromHelper(networkInfo->m_node.eepromHelper()) { } SampleRate SyncNodeConfig::sampleRate() { WirelessTypes::WirelessSampleRate sampleRateVal; try { //try to read the value from the pending config sampleRateVal = m_networkInfo->getPendingConfig().sampleRate(); } catch(Error_NoData&) { //not set in the config, read the value from eeprom sampleRateVal = m_eepromHelper.read_sampleRate(WirelessTypes::samplingMode_sync); } //convert to a SampleRate object and return return SampleUtils::convertToSampleRate(sampleRateVal); } ChannelMask SyncNodeConfig::activeChannels() { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().activeChannels(); } catch(Error_NoData&) { //not set in the config, read the value from eeprom return m_eepromHelper.read_channelMask(); } } uint16 SyncNodeConfig::activeChannelCount() { ChannelMask mask = activeChannels(); uint16 totalChannelCount = mask.count(); WirelessModels::NodeModel model = m_networkInfo->m_model; //if this is the iepe-link, and channel 4 (temp) is enabled if(mask.enabled(4) && model == WirelessModels::node_iepeLink) { //channel 4 doesn't count as a channel in calculations (it transmits at a rate of once per burst) totalChannelCount -= 1; } return totalChannelCount; } WirelessTypes::CommProtocol SyncNodeConfig::commProtocol() { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().communicationProtocol(); } catch(Error_NoData&) { //not set in the config, read the value from eeprom return m_eepromHelper.read_commProtocol(); } } WirelessTypes::DataFormat SyncNodeConfig::dataFormat() { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().dataFormat(); } catch(Error_NoData&) { //not set in the config, read the value from eeprom return m_eepromHelper.read_dataFormat(); } } WirelessTypes::DataCollectionMethod SyncNodeConfig::collectionMethod() { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().dataCollectionMethod(); } catch(Error_NoData&) { //not set in the config, read the value from eeprom return m_eepromHelper.read_collectionMode(); } } uint32 SyncNodeConfig::sweepsPerSession() { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().numSweeps(); } catch(Error_NoData&) { //not set in the config, read the value from eeprom return m_eepromHelper.read_numSweeps(); } } WirelessTypes::SamplingMode SyncNodeConfig::samplingMode() { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().samplingMode(); } catch(Error_NoData&) { //read the value from eeprom return m_eepromHelper.read_samplingMode(); } } uint32 SyncNodeConfig::sensorDelay() { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().sensorDelay(); } catch(Error_NoData&) { //read the value from eeprom return m_eepromHelper.read_sensorDelay(); } } TimeSpan SyncNodeConfig::timeBetweenBursts() { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().timeBetweenBursts(); } catch(Error_NoData&) { //read the value from eeprom return m_eepromHelper.read_timeBetweenBursts(); } } WirelessTypes::SettlingTime SyncNodeConfig::filterSettlingTime(uint8 channelNumber) { ChannelMask mask; //find the ChannelMask for the filterSettlingTime that contains the requested channel number auto groups = m_networkInfo->channelGroups(); for(auto i : groups) { if(i.hasSetting(mscl::WirelessTypes::chSetting_filterSettlingTime)) { if(i.channels().enabled(channelNumber)) { mask = i.channels(); } } } try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().filterSettlingTime(mask); } catch(Error_NoData&) { //read the value from eeprom return m_eepromHelper.read_settlingTime(mask); } } DataModeMask SyncNodeConfig::dataMode() { try { //try to read the value from the pending config return DataModeMask(m_networkInfo->getPendingConfig().dataMode()); } catch(Error_NoData&) { return DataModeMask(m_eepromHelper.read_dataMode()); } } SampleRate SyncNodeConfig::derivedDataRate() { WirelessTypes::WirelessSampleRate sampleRateVal; try { //try to read the value from the pending config sampleRateVal = m_networkInfo->getPendingConfig().derivedDataRate(); } catch(Error_NoData&) { sampleRateVal = m_eepromHelper.read_derivedSampleRate(); } return SampleUtils::convertToSampleRate(sampleRateVal); } ChannelMask SyncNodeConfig::derivedChannelMask(WirelessTypes::DerivedCategory category) { try { //try to read the value from the pending config return m_networkInfo->getPendingConfig().derivedChannelMask(category); } catch(Error_NoData&) { return m_eepromHelper.read_derivedChannelMask(category); } } uint16 SyncNodeConfig::diagnosticInterval() { try { return m_networkInfo->getPendingConfig().diagnosticInterval(); } catch(Error_NoData&) { return m_eepromHelper.read_diagnosticInterval(); } } void SyncNodeConfig::txPerGroup(uint32 txPerGroup) { //write the transmissions per group value to eeprom m_eepromHelper.write_txPerGroup(static_cast<uint16>(txPerGroup)); } void SyncNodeConfig::groupSize(uint32 groupSize) { //write the group size value to eeprom m_eepromHelper.write_groupSize(static_cast<uint16>(groupSize)); } void SyncNodeConfig::tdmaAddress(uint32 address) { //write the TDMA address to eeprom m_eepromHelper.write_tdmaAddress(static_cast<uint16>(address)); } void SyncNodeConfig::retransmission(WirelessTypes::NodeRetransmission reTx) { //write the retransmission option to eeprom m_eepromHelper.write_retransmission(reTx); } void SyncNodeConfig::maxRetransPerBurst(uint32 maxReTxPerBurst) { //write the max retransmissions per burst to eeprom m_eepromHelper.write_maxRetransPerBurst(static_cast<uint16>(maxReTxPerBurst)); } void SyncNodeConfig::applyEepromChanges() { m_eepromHelper.applyEepromChanges(); } }
#ifndef RandomSearch_h #define RandomSearch_h 1 // Metaheuristic #include "Metaheuristic.hpp" //#include "RsConfiguration.hpp" // Random Search Algorithim // 1. generate a current_genome as dictated by the genome // configuration. // 2. Evaluate this current_genome to obtain the current_ // score. // 3. Set best_score = current_score // 4. Randomly Generate another_genome who may or may not // be a neighbour. // 5. Evaluate another_genome to obtain current_score. // 6. if the current_score is better than the best_score // then set the best_score = current_score. // 7. goto step 4. class RandomSearch : public Metaheuristic { public: RandomSearch(); RandomSearch(const RandomSearch &right); virtual ~RandomSearch(); int run_trial(int); int selftest(void); // Additional Public Declarations protected: // Additional Protected Declarations private: // Additional Private Declarations // RsConfiguration c; // Additional Implementation Declarations }; // Class RandomSearch #endif
#pragma once namespace coro::detail { struct void_value { }; } // namespace coro::detail
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #include "LocalizationPrivatePCH.h" #include "LocalizationSettings.h" #include "LocalizationTargetTypes.h" #include "ISourceControlModule.h" ULocalizationSettings::ULocalizationSettings(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) , EngineTargetSet(ObjectInitializer.CreateDefaultSubobject<ULocalizationTargetSet>(this, TEXT("EngineLocalizationTargetSet"))) , GameTargetSet(ObjectInitializer.CreateDefaultSubobject<ULocalizationTargetSet>(this, TEXT("ProjectLocalizationTargetSet"))) { } #if WITH_EDITOR void ULocalizationSettings::PostInitProperties() { Super::PostInitProperties(); // Create and initialize objects for details model from backing config properties. if (EngineTargetSet) { EngineTargetSet->TargetObjects.Empty(EngineTargetsSettings.Num()); for (const auto& TargetSettings : EngineTargetsSettings) { ULocalizationTarget* const TargetObject = NewObject<ULocalizationTarget>(EngineTargetSet); TargetObject->Settings = TargetSettings; TargetObject->UpdateStatusFromConflictReport(); TargetObject->UpdateWordCountsFromCSV(); EngineTargetSet->TargetObjects.Add(TargetObject); } } // Create and initialize objects for details model from backing config properties. if (GameTargetSet) { GameTargetSet->TargetObjects.Empty(EngineTargetsSettings.Num()); for (const auto& TargetSettings : GameTargetsSettings) { ULocalizationTarget* const TargetObject = NewObject<ULocalizationTarget>(GameTargetSet); TargetObject->Settings = TargetSettings; TargetObject->UpdateStatusFromConflictReport(); TargetObject->UpdateWordCountsFromCSV(); GameTargetSet->TargetObjects.Add(TargetObject); } } } void ULocalizationSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) { Super::PostEditChangeProperty(PropertyChangedEvent); // Copy settings back. if (EngineTargetSet) { EngineTargetsSettings.Empty(EngineTargetSet->TargetObjects.Num()); for (const auto& TargetObject : EngineTargetSet->TargetObjects) { EngineTargetsSettings.Add(TargetObject ? TargetObject->Settings : FLocalizationTargetSettings()); } } // Copy settings back. if (GameTargetSet) { GameTargetsSettings.Empty(GameTargetSet->TargetObjects.Num()); for (const auto& TargetObject : GameTargetSet->TargetObjects) { GameTargetsSettings.Add(TargetObject ? TargetObject->Settings : FLocalizationTargetSettings()); } } UpdateDefaultConfigFile(); } #endif ULocalizationTargetSet* ULocalizationSettings::GetEngineTargetSet() { ULocalizationSettings* LocalizationSettings = GetMutableDefault<ULocalizationSettings>(); check(LocalizationSettings); return LocalizationSettings->EngineTargetSet; } ULocalizationTargetSet* ULocalizationSettings::GetGameTargetSet() { ULocalizationSettings* LocalizationSettings = GetMutableDefault<ULocalizationSettings>(); check(LocalizationSettings); return LocalizationSettings->GameTargetSet; }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/shell/browser/web_test/web_test_push_messaging_service.h" #include "base/bind.h" #include "base/callback.h" #include "base/optional.h" #include "base/stl_util.h" #include "base/time/time.h" #include "content/public/browser/permission_type.h" #include "content/shell/browser/web_test/web_test_browser_context.h" #include "content/shell/browser/web_test/web_test_content_browser_client.h" #include "content/shell/browser/web_test/web_test_permission_manager.h" #include "third_party/blink/public/mojom/push_messaging/push_messaging_status.mojom.h" #include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h" namespace content { namespace { // NIST P-256 public key made available to web tests. Must be an uncompressed // point in accordance with SEC1 2.3.3. const uint8_t kTestP256Key[] = { 0x04, 0x55, 0x52, 0x6A, 0xA5, 0x6E, 0x8E, 0xAA, 0x47, 0x97, 0x36, 0x10, 0xC1, 0x66, 0x3C, 0x1E, 0x65, 0xBF, 0xA1, 0x7B, 0xEE, 0x48, 0xC9, 0xC6, 0xBB, 0xBF, 0x02, 0x18, 0x53, 0x72, 0x1D, 0x0C, 0x7B, 0xA9, 0xE3, 0x11, 0xB7, 0x03, 0x52, 0x21, 0xD3, 0x71, 0x90, 0x13, 0xA8, 0xC1, 0xCF, 0xED, 0x20, 0xF7, 0x1F, 0xD1, 0x7F, 0xF2, 0x76, 0xB6, 0x01, 0x20, 0xD8, 0x35, 0xA5, 0xD9, 0x3C, 0x43, 0xFD}; static_assert(sizeof(kTestP256Key) == 65, "The fake public key must be a valid P-256 uncompressed point."); // 92-bit (12 byte) authentication key associated with a subscription. const uint8_t kAuthentication[] = {0xA5, 0xD9, 0x3C, 0x43, 0x0C, 0x00, 0xA9, 0xE3, 0x1E, 0x65, 0xBF, 0xA1}; static_assert(sizeof(kAuthentication) == 12, "The fake authentication key must be at least 12 bytes in size."); const int64_t kTestExpirationWindowInDays = 90; base::Time GetFutureTime() { return base::Time::Now() + base::TimeDelta::FromDays(kTestExpirationWindowInDays); } } // anonymous namespace WebTestPushMessagingService::WebTestPushMessagingService() : subscribed_service_worker_registration_( blink::mojom::kInvalidServiceWorkerRegistrationId) {} WebTestPushMessagingService::~WebTestPushMessagingService() {} void WebTestPushMessagingService::SubscribeFromDocument( const GURL& requesting_origin, int64_t service_worker_registration_id, int renderer_id, int render_frame_id, blink::mojom::PushSubscriptionOptionsPtr options, bool user_gesture, RegisterCallback callback) { SubscribeFromWorker(requesting_origin, service_worker_registration_id, std::move(options), std::move(callback)); } void WebTestPushMessagingService::SubscribeFromWorker( const GURL& requesting_origin, int64_t service_worker_registration_id, blink::mojom::PushSubscriptionOptionsPtr options, RegisterCallback callback) { blink::mojom::PermissionStatus permission_status = WebTestContentBrowserClient::Get() ->browser_context() ->GetPermissionControllerDelegate() ->GetPermissionStatus(PermissionType::NOTIFICATIONS, requesting_origin, requesting_origin); // The `userVisibleOnly` option is still required when subscribing. if (!options->user_visible_only) permission_status = blink::mojom::PermissionStatus::DENIED; if (permission_status == blink::mojom::PermissionStatus::GRANTED) { std::vector<uint8_t> p256dh(kTestP256Key, kTestP256Key + base::size(kTestP256Key)); std::vector<uint8_t> auth(kAuthentication, kAuthentication + base::size(kAuthentication)); const std::string subscription_id = "layoutTestRegistrationId"; const GURL endpoint = CreateEndpoint(subscription_id); subscribed_service_worker_registration_ = service_worker_registration_id; std::move(callback).Run( subscription_id, endpoint, GetFutureTime(), p256dh, auth, blink::mojom::PushRegistrationStatus::SUCCESS_FROM_PUSH_SERVICE); } else { std::move(callback).Run( "registration_id", GURL::EmptyGURL() /* endpoint */, base::nullopt /* expiration_time */, std::vector<uint8_t>() /* p256dh */, std::vector<uint8_t>() /* auth */, blink::mojom::PushRegistrationStatus::PERMISSION_DENIED); } } void WebTestPushMessagingService::GetSubscriptionInfo( const GURL& origin, int64_t service_worker_registration_id, const std::string& sender_id, const std::string& subscription_id, SubscriptionInfoCallback callback) { std::vector<uint8_t> p256dh(kTestP256Key, kTestP256Key + base::size(kTestP256Key)); std::vector<uint8_t> auth(kAuthentication, kAuthentication + base::size(kAuthentication)); const GURL endpoint = CreateEndpoint(subscription_id); std::move(callback).Run(true /* is_valid */, endpoint, GetFutureTime(), p256dh, auth); } bool WebTestPushMessagingService::SupportNonVisibleMessages() { return false; } void WebTestPushMessagingService::Unsubscribe( blink::mojom::PushUnregistrationReason reason, const GURL& requesting_origin, int64_t service_worker_registration_id, const std::string& sender_id, UnregisterCallback callback) { ClearPushSubscriptionId( WebTestContentBrowserClient::Get()->browser_context(), requesting_origin, service_worker_registration_id, base::BindOnce( std::move(callback), service_worker_registration_id == subscribed_service_worker_registration_ ? blink::mojom::PushUnregistrationStatus::SUCCESS_UNREGISTERED : blink::mojom::PushUnregistrationStatus:: SUCCESS_WAS_NOT_REGISTERED)); if (service_worker_registration_id == subscribed_service_worker_registration_) { subscribed_service_worker_registration_ = blink::mojom::kInvalidServiceWorkerRegistrationId; } } void WebTestPushMessagingService::DidDeleteServiceWorkerRegistration( const GURL& origin, int64_t service_worker_registration_id) { if (service_worker_registration_id == subscribed_service_worker_registration_) { subscribed_service_worker_registration_ = blink::mojom::kInvalidServiceWorkerRegistrationId; } } void WebTestPushMessagingService::DidDeleteServiceWorkerDatabase() { subscribed_service_worker_registration_ = blink::mojom::kInvalidServiceWorkerRegistrationId; } GURL WebTestPushMessagingService::CreateEndpoint( const std::string& subscription_id) const { return GURL("https://example.com/StandardizedEndpoint/" + subscription_id); } } // namespace content
// SPDX-FileCopyrightText: 2014 Erik Garrison // // SPDX-License-Identifier: MIT #include "small_snarl_simplifier.hpp" #include "cactus_snarl_finder.hpp" namespace vg { using namespace std; SmallSnarlSimplifier::SmallSnarlSimplifier(VG& graph) : Progressive(), graph(graph), traversal_finder(graph) { // create a SnarlManager using Cactus CactusSnarlFinder site_finder(graph); site_manager = site_finder.find_snarls(); } pair<size_t, size_t> SmallSnarlSimplifier::simplify_once(size_t iteration) { // Set up the deleted node and edge counts pair<size_t, size_t> to_return {0, 0}; auto& deleted_nodes = to_return.first; auto& deleted_edges = to_return.second; if(!graph.is_valid(true, true, true, true)) { // Make sure the graph is valid and not missing nodes or edges cerr << "error:[vg::SmallSnarlSimplifier] Invalid graph on iteration " << iteration << endl; exit(1); } // Make a list of leaf sites list<const Snarl*> leaves; if (show_progress) { cerr << "Iteration " << iteration << ": Scanning " << graph.node_count() << " nodes and " << graph.edge_count() << " edges for sites..." << endl; } for (const Snarl* top_level_site : site_manager.top_level_snarls()) { list<const Snarl*> queue {top_level_site}; while (queue.size()) { const Snarl* site = queue.front(); queue.pop_front(); if (site_manager.is_leaf(site)) { // It's a leaf. Filter it out if it is trivial if (site->type() == ULTRABUBBLE) { auto contents = site_manager.shallow_contents(site, graph, false); if (contents.first.empty()) { // Nothing but the boundary nodes in this snarl continue; } } // Not trivial. Keep it. leaves.push_back(site); } else { for (const Snarl* child_site : site_manager.children_of(site)) { queue.push_back(child_site); } } } } if (show_progress) { cerr << "Found " << leaves.size() << " leaves" << endl; } // Index all the graph paths map<string, unique_ptr<PathIndex>> path_indexes; graph.paths.for_each_name([&](const string& name) { // For every path name, go index it and put it in this collection path_indexes.insert(make_pair(name, move(unique_ptr<PathIndex>(new PathIndex(graph, name))))); }); // Now we have a list of all the leaf sites. create_progress("simplifying leaves", leaves.size()); // We can't use the SnarlManager after we modify the graph, so we load the // contents of all the leaves we're going to modify first. map<const Snarl*, pair<unordered_set<id_t>, unordered_set<edge_t>>> leaf_contents; // How big is each leaf in bp map<const Snarl*, size_t> leaf_sizes; // We also need to pre-calculate the traversals for the snarls that are the // right size, since the traversal finder uses the snarl manager amd might // not work if we modify the graph. map<const Snarl*, vector<SnarlTraversal>> leaf_traversals; for (const Snarl* leaf : leaves) { // Look at all the leaves // Get the contents of the bubble, excluding the boundary nodes leaf_contents[leaf] = site_manager.deep_contents(leaf, graph, false); // For each leaf, calculate its total size. unordered_set<id_t>& nodes = leaf_contents[leaf].first; size_t& total_size = leaf_sizes[leaf]; for (id_t node_id : nodes) { // For each node include it in the size figure total_size += graph.get_length(graph.get_handle(node_id)); } if (total_size == 0) { // This site is just the start and end nodes, so it doesn't make // sense to try and remove it. continue; } if (total_size >= min_size) { // This site is too big to remove continue; } // Identify the replacement traversal for the bubble if it's the right size. // We can't necessarily do this after we've modified the graph. vector<SnarlTraversal>& traversals = leaf_traversals[leaf]; traversals = traversal_finder.find_traversals(*leaf); } for (const Snarl* leaf : leaves) { // Look at all the leaves // Get the contents of the bubble, excluding the boundary nodes unordered_set<id_t>& nodes = leaf_contents[leaf].first; unordered_set<edge_t>& edges = leaf_contents[leaf].second; // For each leaf, grab its total size. size_t& total_size = leaf_sizes[leaf]; if (total_size == 0) { // This site is just the start and end nodes, so it doesn't make // sense to try and remove it. continue; } if (total_size >= min_size) { // This site is too big to remove continue; } #ifdef debug cerr << "Found " << total_size << " bp leaf" << endl; for (id_t node_id : nodes) { cerr << "\t" << node << " = " << node_id << ": " << graph.get_sequence(graph.get_handle(node_id)) << endl; } #endif // Otherwise we want to simplify this site away // Grab the replacement traversal for the bubble vector<SnarlTraversal>& traversals = leaf_traversals[leaf]; if (traversals.empty()) { // We couldn't find any paths through the site. continue; } // Get the traversal out of the vector SnarlTraversal& traversal = traversals.front(); #ifdef debug cerr << "Chosen traversal has: " << traversal.visit_size() << " visits" << endl; #endif // Determine the length of the new traversal size_t new_site_length = 0; for (size_t i = 1; i < traversal.visit_size() - 1; i++) { // For every non-anchoring node const Visit& visit = traversal.visit(i); #ifdef debug cerr << "Chosen traversal has: " << visit << endl; #endif // Total up the lengths of all the nodes that are newly visited. assert(visit.node_id()); new_site_length += graph.get_node(visit.node_id())->sequence().size(); } #ifdef debug cerr << "Chosen traversal is " << new_site_length << " bp" << endl; #endif // Now we have to rewrite paths that visit nodes/edges not on this // traversal, or in a different order, or whatever. To be safe we'll // just rewrite all paths. // Find all the paths that traverse this region. // We start at the start node. Copy out all the mapping pointers on that // node, so we can go through them while tampering with them. map<string, set<mapping_t*> > mappings_by_path = graph.paths.get_node_mapping_by_path_name(graph.get_node(leaf->start().node_id())); // It's possible a path can enter the site through the end node and // never hit the start. So we're going to trim those back before we delete nodes and edges. map<string, set<mapping_t*> > end_mappings_by_path = graph.paths.get_node_mapping_by_path_name(graph.get_node(leaf->end().node_id())); if (!drop_hairpin_paths) { // We shouldn't drop paths if they hairpin and can't be represented // in a simplified bubble. So we instead have to not simplify // bubbles that would have that problem. bool found_hairpin = false; for (auto& kv : mappings_by_path) { // For each path that hits the start node if (found_hairpin) { // We only care if there are 1 or more hairpins, not how many break; } // Unpack the name auto& path_name = kv.first; for (mapping_t* start_mapping : kv.second) { // For each visit to the start node if (found_hairpin) { // We only care if there are 1 or more hairpins, not how many break; } // Determine what orientation we're going to scan in bool backward = start_mapping->is_reverse(); // Start at the start node mapping_t* here = start_mapping; while (here) { // Until we hit the start/end of the path or the mapping we want if (here->node_id() == leaf->end().node_id() && here->is_reverse() == (leaf->end().backward() != backward)) { // We made it out. // Stop scanning! break; } if (here->node_id() == leaf->start().node_id() && here->is_reverse() != (leaf->start().backward() != backward)) { // We have encountered the start node with an incorrect orientation. cerr << "warning:[vg::SmallSnarlSimplifier] Path " << path_name << " doubles back through start of site " << to_node_traversal(leaf->start(), graph) << " - " << to_node_traversal(leaf->end(), graph) << "; skipping site!" << endl; found_hairpin = true; break; } // Scan left along ther path if we found the site start backwards, and right if we found it forwards. here = backward ? graph.paths.traverse_left(here) : graph.paths.traverse_right(here); } } } for (auto& kv : end_mappings_by_path) { // For each path that hits the end node if (found_hairpin) { // We only care if there are 1 or more hairpins, not how many break; } // Unpack the name auto& path_name = kv.first; for (mapping_t* end_mapping : kv.second) { if (found_hairpin) { // We only care if there are 1 or more hairpins, not how many break; } // Determine what orientation we're going to scan in bool backward = end_mapping->is_reverse(); // Start at the end mapping_t* here = end_mapping; while (here) { if (here->node_id() == leaf->start().node_id() && here->is_reverse() == (leaf->start().backward() != backward)) { // We made it out. // Stop scanning! break; } if (here->node_id() == leaf->end().node_id() && here->is_reverse() != (leaf->end().backward() != backward)) { // We have encountered the end node with an incorrect orientation. cerr << "warning:[vg::SmallSnarlSimplifier] Path " << path_name << " doubles back through end of site " << to_node_traversal(leaf->start(), graph) << " - " << to_node_traversal(leaf->end(), graph) << "; dropping site!" << endl; found_hairpin = true; break; } // Scan right along the path if we found the site end backwards, and left if we found it forwards. here = backward ? graph.paths.traverse_right(here) : graph.paths.traverse_left(here); } } } if (found_hairpin) { // We found a hairpin, so we want to skip the site. cerr << "warning:[vg::SmallSnarlSimplifier] Site " << to_node_traversal(leaf->start(), graph) << " - " << to_node_traversal(leaf->end(), graph) << " skipped due to hairpin path." << endl; continue; } } // We'll keep a set of the end mappings we managed to find, starting from the start set<mapping_t*> found_end_mappings; for (auto& kv : mappings_by_path) { // For each path that hits the start node // Unpack the name auto& path_name = kv.first; // If a path can't be represented after a bubble is popped // (because the path reversed and came out the same side as it // went in), we just clobber the path entirely. TODO: handle // out-the-same-side traversals as valid genotypes somehow.. bool kill_path = false; for (mapping_t* start_mapping : kv.second) { // For each visit to the start node // Determine what orientation we're going to scan in bool backward = start_mapping->is_reverse(); // We're going to fill this list with the mappings we need to // remove and replace in this path for this traversal. Initially // runs from start of site to end of site, but later gets // flipped into path-local orientation. list<mapping_t*> existing_mappings; // Tracing along forward/backward from each as appropriate, see // if the end of the site is found in the expected orientation // (or if the path ends first). bool found_end = false; mapping_t* here = start_mapping; // We want to remember the end mapping when we find it mapping_t* end_mapping = nullptr; #ifdef debug cerr << "Scanning " << path_name << " from " << *here << " for " << to_node_traversal(leaf->end(), graph) << " orientation " << backward << endl; #endif while (here) { // Until we hit the start/end of the path or the mapping we want #ifdef debug cerr << "\tat " << *here << endl; #endif if (here->node_id() == leaf->end().node_id() && here->is_reverse() == (leaf->end().backward() != backward)) { // We have encountered the end of the site in the // orientation we expect, given the orientation we saw // for the start. found_end = true; end_mapping = here; // Know we got to this mapping at the end from the // start, so we don't need to clobber everything // before it. found_end_mappings.insert(here); // Stop scanning! break; } if (here->node_id() == leaf->start().node_id() && here->is_reverse() != (leaf->start().backward() != backward)) { // We have encountered the start node with an incorrect orientation. cerr << "warning:[vg::SmallSnarlSimplifier] Path " << path_name << " doubles back through start of site " << to_node_traversal(leaf->start(), graph) << " - " << to_node_traversal(leaf->end(), graph) << "; dropping!" << endl; assert(drop_hairpin_paths); kill_path = true; break; } if (here->node_id() != leaf->start().node_id() && here->node_id() != leaf->end().node_id() && !nodes.count(here->node_id())) { // We aren't the start, the end, or any internal contained node. // That's an error! // We really should stay inside the site! cerr << "error:[vg::SmallSnarlSimplifier] Path " << path_name << " somehow escapes site " << to_node_traversal(leaf->start(), graph) << " - " << to_node_traversal(leaf->end(), graph) << " and reaches non-contained node " << here->node_id() << " at address " << graph.get_node(here->node_id()) << endl; exit(1); } if (here != start_mapping) { // Remember the mappings that aren't to the start or // end of the site, so we can remove them later. existing_mappings.push_back(here); } // Scan left along the path if we found the site start backwards, and right if we found it forwards. mapping_t* next = backward ? graph.paths.traverse_left(here) : graph.paths.traverse_right(here); #ifdef debug cerr << "Here is " << *here << " at " << here << " and next is " << *next << " at " << next << endl; #endif if (next == nullptr) { // We hit the end of the path without finding the end of the site. // We've found all the existing mappings, so we can stop. break; } // Make into NodeTraversals NodeTraversal here_traversal(graph.get_node(here->node_id()), here->is_reverse()); NodeTraversal next_traversal(graph.get_node(next->node_id()), next->is_reverse()); if (backward) { // We're scanning the other way std::swap(here_traversal, next_traversal); } // Make sure we have an edge so we can traverse this node and then the node we're going to. if(graph.get_edge(here_traversal, next_traversal) == nullptr) { cerr << "error:[vg::SmallSnarlSimplifier] No edge " << here_traversal << " to " << next_traversal << endl; exit(1); } here = next; } if (kill_path) { // This path can't exist after we pop this bubble. break; } if (!found_end) { // This path only partly traverses the site, and is // anchored at the start. Remove the part inside the site. // TODO: let it stay if it matches the one true traversal. for(auto* mapping : existing_mappings) { // Trim the path out of the site graph.paths.remove_mapping(mapping); } // TODO: update feature positions if we trim off the start of a path // Maybe the next time the path visits the site it will go // all the way through. continue; } // If we found the end, remove all the mappings encountered, in // order so that the last one removed is the last one along the // path. if (backward) { // Make sure the last mapping in the list is the last // mapping to occur along the path. existing_mappings.reverse(); } // Where does the variable region of the site start for this // traversal of the path? If there are no existing mappings, // it's the start mapping's position if we traverse the site // backwards and the end mapping's position if we traverse // the site forwards. If there are existing mappings, it's // the first existing mapping's position in the path. TODO: // This is super ugly. Can we view the site in path // coordinates or something? PathIndex& path_index = *path_indexes.at(path_name).get(); mapping_t* mapping_after_first = existing_mappings.empty() ? (backward ? start_mapping : end_mapping) : existing_mappings.front(); assert(path_index.mapping_positions.count(mapping_after_first)); size_t variable_start = path_index.mapping_positions.at(mapping_after_first); // Determine the total length of the old traversal of the site size_t old_site_length = 0; for (auto* mapping : existing_mappings) { // Add in the lengths of all the mappings that will get // removed. old_site_length += mapping->length; } #ifdef debug cerr << "Replacing " << old_site_length << " bp at " << variable_start << " with " << new_site_length << " bp" << endl; #endif // Actually update any BED features if (features != nullptr) { features->on_path_edit(path_name, variable_start, old_site_length, new_site_length); } // Where will we insert the new site traversal into the path? list<mapping_t>::iterator insert_position; if (!existing_mappings.empty()) { // If there are existing internal mappings, we'll insert right where they were for (auto* mapping : existing_mappings) { // Remove each mapping from left to right along the // path, saving the position after the mapping we just // removed. At the end we'll have the position of the // mapping to the end of the site. #ifdef debug cerr << path_name << " forward: Drop mapping " << *mapping << endl; #endif insert_position = graph.paths.remove_mapping(mapping); } } else { // Otherwise we'll insert right before the mapping to // the start or end of the site (whichever occurs last // along the path) insert_position = graph.paths.find_mapping(backward ? start_mapping : here); } // Make sure we're going to insert starting from the correct end of the site. if (backward) { assert(insert_position->node_id() == leaf->start().node_id()); } else { assert(insert_position->node_id() == leaf->end().node_id()); } #ifdef debug cerr << "Chosen traversal has " << traversal.visit_size() << " visits" << endl; #endif // Loop through the internal visits in the canonical // traversal backwards along the path we are splicing. If // it's a forward path this is just right to left, but if // it's a reverse path it has to be left to right. for (size_t i = 1; i + 1 < traversal.visit_size(); i++) { // Don't visit the first or last node on the traversal // because they are the snarl start and end which we didn't // remove. // Find the visit we need next, as a function of which // way we need to insert this run of visits. Normally we // go through the visits right to left, but when we have // a backward path we go left to right. const Visit& visit = backward ? traversal.visit(i) : traversal.visit(traversal.visit_size() - i - 1); // Make a mapping_t to represent it mapping_t new_mapping; new_mapping.set_node_id(visit.node_id()); // We hit this node backward if it's backward along the // traversal, xor if we are traversing the traversal // backward new_mapping.set_is_reverse(visit.backward() != backward); // Add the length size_t node_seq_length = graph.get_node(visit.node_id())->sequence().size(); new_mapping.length = node_seq_length; #ifdef debug cerr << path_name << " backward: Add mapping " << new_mapping << endl; #endif // Insert the mapping in the path, moving right to left insert_position = graph.paths.insert_mapping(insert_position, path_name, new_mapping); } // Now we've corrected this site on this path. Update its index. // TODO: right now this means retracing the entire path. path_indexes[path_name].get()->update_mapping_positions(graph, path_name); } if (kill_path) { // Destroy the path completely, because it needs to reverse // inside a site that we have popped. graph.paths.remove_path(path_name); } } for (auto& kv : end_mappings_by_path) { // Now we handle the end mappings not reachable from the start. For each path that touches the end... // Unpack the name auto& path_name = kv.first; // We might have to kill the path, if it reverses inside a // bubble we're popping bool kill_path = false; for (mapping_t* end_mapping : kv.second) { if (found_end_mappings.count(end_mapping)) { // Skip the traversals of the site that we handled. continue; } // Now we're left with paths that leave the site but don't // enter. We're going to clobber everything before the path // leaves the site. // Determine what orientation we're going to scan in bool backward = end_mapping->is_reverse(); // Start at the end mapping_t* here = end_mapping; // Keep a list of mappings we need to remove list<mapping_t*> to_remove; while (here) { if (here->node_id() == leaf->end().node_id() && here->is_reverse() != (leaf->end().backward() != backward)) { // We have encountered the end node with an incorrect orientation. cerr << "warning:[vg::SmallSnarlSimplifier] Path " << path_name << " doubles back through end of site " << to_node_traversal(leaf->start(), graph) << " - " << to_node_traversal(leaf->end(), graph) << "; dropping!" << endl; assert(drop_hairpin_paths); kill_path = true; break; } // Say we should remove the mapping. to_remove.push_back(here); // Scan right along the path if we found the site end backwards, and left if we found it forwards. here = backward ? graph.paths.traverse_right(here) : graph.paths.traverse_left(here); // Eventually we should hit the end of the path, or the // end of the site, since we don't hit the start. } if (kill_path) { // Just go kill the whole path break; } for (auto* mapping: to_remove) { // Get rid of all the mappings once we're done tracing them out. graph.paths.remove_mapping(mapping); } } if (kill_path) { // Destroy the path completely, because it needs to reverse // inside a site that we have popped. graph.paths.remove_path(path_name); } } // Now delete all edges that aren't connecting adjacent nodes on the // blessed traversal (before we delete their nodes). set<Edge*> blessed_edges; for (int i = 0; i < traversal.visit_size() - 1; ++i) { // For each node and the next node (which won't be the end) const Visit visit = traversal.visit(i); const Visit next = traversal.visit(i+1); #ifdef debug cerr << "Follow edge from " << visit << " to " << next << endl; #endif // Find the edge between them NodeTraversal here(graph.get_node(visit.node_id()), visit.backward()); NodeTraversal next_traversal(graph.get_node(next.node_id()), next.backward()); Edge* edge = graph.get_edge(here, next_traversal); assert(edge != nullptr); // Remember we need it blessed_edges.insert(edge); } // The traversal also touches the boundary nodes, so don't do anything special for them. for (const edge_t& edge_handle : edges) { Node* from_node = graph.get_node(graph.get_id(edge_handle.first)); Node* to_node = graph.get_node(graph.get_id(edge_handle.second)); Edge* edge = graph.get_edge(NodeTraversal(from_node, graph.get_is_reverse(edge_handle.first)), NodeTraversal(to_node, graph.get_is_reverse(edge_handle.second))); if (!blessed_edges.count(edge)) { // Get rid of all the edges not needed for the one true traversal #ifdef debug cerr << to_node_traversal(leaf->start(), graph) << " - " << to_node_traversal(leaf->end(), graph) << ": Delete edge: " << pb2json(*edge) << endl; #endif graph.destroy_edge(edge); deleted_edges++; } } // Now delete all the nodes that aren't on the blessed traversal. // What nodes are on it? set<Node*> blessed_nodes; for (int i = 0; i < traversal.visit_size(); i++) { const Visit& visit = traversal.visit(i); blessed_nodes.insert(graph.get_node(visit.node_id())); } for (id_t node_id : nodes) { Node* node = graph.get_node(node_id); // For every node in the site if (!blessed_nodes.count(node)) { // If we don't need it for the chosen path, destroy it #ifdef debug cerr << to_node_traversal(leaf->start(), graph) << " - " << to_node_traversal(leaf->end(), graph) << ": Delete node: " << pb2json(*node) << endl; #endif // There may be paths still touching this node, if they // managed to get into the site without touching the start // node. We'll delete those paths. set<string> paths_to_kill; for (auto& kv : graph.paths.get_node_mapping_by_path_name(node)) { if (mappings_by_path.count(kv.first)) { // We've already actually updated this path; the // node_mapping data is just out of date. continue; } paths_to_kill.insert(kv.first); } for (auto& path : paths_to_kill) { graph.paths.remove_path(path); cerr << "warning:[vg::SmallSnarlSimplifier] Path " << path << " removed" << endl; } graph.destroy_node(node); deleted_nodes++; } } // OK we finished a leaf increment_progress(); } destroy_progress(); // Reset the ranks in the graph, since we rewrote paths graph.paths.clear_mapping_ranks(); // Return the statistics. return to_return; } void SmallSnarlSimplifier::simplify() { for (size_t i = 0; i < max_iterations; i++) { // Try up to the max number of iterations auto deleted_elements = simplify_once(i); if (show_progress) { cerr << "Iteration " << i << ": deleted " << deleted_elements.first << " nodes and " << deleted_elements.second << " edges" << endl; } if (deleted_elements.first == 0 && deleted_elements.second == 0) { // If nothing gets deleted, stop because trying again won't change // things break; } } } }
/*Exercise 4 - Functions Write a program to calculate the function called nCr which is defined as nCr = n!/ r!(n−r)! Where n! is the factorial of n. Implement the functions long Factorial(int no); long nCr(int n, int r); Do not modify the main function.*/ #include <iostream> using namespace std; long Factorial (int no); long nCr(int n, int r); int main(){ int n, r; std::cout << "Enter a value for n "; std::cin >> n; std::cout << "Enter a value for r "; std::cin >> r; std::cout << "nCr = "; std::cout << nCr( n, r); std::cout << std::endl; return 0; } long nCr( int n,int r){ long nCr; nCr = Factorial (n) /Factorial (r) * Factorial(n-r); return nCr; } long Factorial (int no) { int fac = 1,i; for(i=1; i<=no; i++) { fac = fac * i; } return fac; }
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved. // Copyright (c) 2021 by Apex.AI Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 #ifndef IOX_POSH_POPO_PORTS_BASE_PORT_DATA_HPP #define IOX_POSH_POPO_PORTS_BASE_PORT_DATA_HPP #include "iceoryx_hoofs/internal/relocatable_pointer/relative_pointer.hpp" #include "iceoryx_posh/capro/service_description.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/capro/capro_message.hpp" #include "iceoryx_posh/internal/popo/building_blocks/typed_unique_id.hpp" #include <atomic> namespace iox { namespace popo { /// @brief Defines different base port data struct BasePortData { /// @brief Constructor for base port data members BasePortData() = default; /// @brief Constructor /// @param[in] serviceDescription creates the service service description /// @param[in] runtimeName Name of the application's runtime /// @param[in] nodeName Name of the node BasePortData(const capro::ServiceDescription& serviceDescription, const RuntimeName_t& runtimeName, const NodeName_t& nodeName) noexcept; BasePortData(const BasePortData&) = delete; BasePortData& operator=(const BasePortData&) = delete; BasePortData(BasePortData&&) = delete; BasePortData& operator=(BasePortData&&) = delete; ~BasePortData() = default; capro::ServiceDescription m_serviceDescription; RuntimeName_t m_runtimeName; NodeName_t m_nodeName; UniquePortId m_uniqueId; std::atomic_bool m_toBeDestroyed{false}; }; } // namespace popo } // namespace iox #endif // IOX_POSH_POPO_PORTS_BASE_PORT_DATA_HPP
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4: #ident "$Id$" /*====== This file is part of PerconaFT. Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. PerconaFT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. PerconaFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with PerconaFT. If not, see <http://www.gnu.org/licenses/>. ---------------------------------------- PerconaFT is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. PerconaFT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with PerconaFT. If not, see <http://www.gnu.org/licenses/>. ======= */ #ident "Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved." #include <stdio.h> #include "locktree.h" #include "test.h" // One client locks 1,2,3... // The other client locks -1,-2,-3... // Eventually lock escalation runs. using namespace toku; static int verbose = 0; static int killed = 0; static void locktree_release_lock(locktree *lt, TXNID txn_id, int64_t left_k, int64_t right_k) { range_buffer buffer; buffer.create(); DBT left; toku_fill_dbt(&left, &left_k, sizeof left_k); DBT right; toku_fill_dbt(&right, &right_k, sizeof right_k); buffer.append(&left, &right); lt->release_locks(txn_id, &buffer); buffer.destroy(); } // grab a write range lock on int64 keys bounded by left_k and right_k static int locktree_write_lock(locktree *lt, TXNID txn_id, int64_t left_k, int64_t right_k, bool big_txn) { DBT left; toku_fill_dbt(&left, &left_k, sizeof left_k); DBT right; toku_fill_dbt(&right, &right_k, sizeof right_k); return lt->acquire_write_lock(txn_id, &left, &right, nullptr, big_txn); } static void run_big_txn(locktree_manager *mgr UU(), locktree *lt, TXNID txn_id, int64_t start_i) { fprintf(stderr, "%u run_big_txn %p %" PRIu64 " %" PRId64 "\n", toku_os_gettid(), lt, txn_id, start_i); int64_t last_i = -1; for (int64_t i = start_i; !killed; i++) { if (0) printf("%u %" PRId64 "\n", toku_os_gettid(), i); uint64_t t_start = toku_current_time_microsec(); int r = locktree_write_lock(lt, txn_id, i, i, true); if (r != 0) break; last_i = i; uint64_t t_end = toku_current_time_microsec(); uint64_t t_duration = t_end - t_start; if (t_duration > 100000) { printf("%u %s %" PRId64 " %" PRIu64 "\n", toku_os_gettid(), __FUNCTION__, i, t_duration); } toku_pthread_yield(); } if (last_i != -1) locktree_release_lock(lt, txn_id, start_i, last_i); // release the range start_i .. last_i } struct arg { locktree_manager *mgr; locktree *lt; TXNID txn_id; int64_t start_i; }; static void *big_f(void *_arg) { struct arg *arg = (struct arg *) _arg; run_big_txn(arg->mgr, arg->lt, arg->txn_id, arg->start_i); return arg; } static void e_callback(TXNID txnid, const locktree *lt, const range_buffer &buffer, void *extra) { if (verbose) printf("%u %s %" PRIu64 " %p %d %p\n", toku_os_gettid(), __FUNCTION__, txnid, lt, buffer.get_num_ranges(), extra); } static uint64_t get_escalation_count(locktree_manager &mgr) { LTM_STATUS_S ltm_status_test; mgr.get_status(&ltm_status_test); TOKU_ENGINE_STATUS_ROW key_status = NULL; // lookup keyname in status for (int i = 0; ; i++) { TOKU_ENGINE_STATUS_ROW status = &ltm_status_test.status[i]; if (status->keyname == NULL) break; if (strcmp(status->keyname, "LTM_ESCALATION_COUNT") == 0) { key_status = status; break; } } assert(key_status); return key_status->value.num; } int main(int argc, const char *argv[]) { const int n_big = 2; int n_lt = 1; uint64_t stalls = 1; uint64_t max_lock_memory = 1000000; for (int i = 1; i < argc; i++) { if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--verbose") == 0) { verbose++; continue; } if (strcmp(argv[i], "--stalls") == 0 && i+1 < argc) { stalls = atoll(argv[++i]); continue; } if (strcmp(argv[i], "--n_lt") == 0 && i+1 < argc) { n_lt = atoi(argv[++i]); continue; } if (strcmp(argv[i], "--max_lock_memory") == 0 && i+1 < argc) { max_lock_memory = atoll(argv[++i]); continue; } } int r; // create a manager locktree_manager mgr; mgr.create(nullptr, nullptr, e_callback, nullptr); mgr.set_max_lock_memory(max_lock_memory); // create lock trees locktree *lt[n_big]; for (int i = 0; i < n_lt; i++) { DICTIONARY_ID dict_id = { .dictid = (uint64_t) i }; lt[i] = mgr.get_lt(dict_id, dbt_comparator, nullptr); assert(lt[i]); } // create the worker threads struct arg big_arg[n_big]; pthread_t big_ids[n_big]; for (int i = 0; i < n_big; i++) { big_arg[i] = { &mgr, lt[i % n_lt], (TXNID)(1000 + i), i == 0 ? 1 : -1000000000}; r = toku_pthread_create( toku_uninstrumented, &big_ids[i], nullptr, big_f, &big_arg[i]); assert(r == 0); } // wait for some escalations to occur while (get_escalation_count(mgr) < stalls) { sleep(1); } killed = 1; // cleanup for (int i = 0; i < n_big; i++) { void *ret; r = toku_pthread_join(big_ids[i], &ret); assert(r == 0); } for (int i = 0; i < n_lt ; i++) { mgr.release_lt(lt[i]); } mgr.destroy(); return 0; }
/* Generated SBE (Simple Binary Encoding) message codec */ #ifndef _FRAMECODEC_HPP_ #define _FRAMECODEC_HPP_ /* math.h needed for NAN */ #include <math.h> #include "sbe/sbe.hpp" #include "uk_co_real_logic_sbe_ir_generated/ByteOrderCodec.hpp" #include "uk_co_real_logic_sbe_ir_generated/SignalCodec.hpp" #include "uk_co_real_logic_sbe_ir_generated/PresenceCodec.hpp" #include "uk_co_real_logic_sbe_ir_generated/PrimitiveTypeCodec.hpp" #include "uk_co_real_logic_sbe_ir_generated/VarDataEncoding.hpp" using namespace sbe; namespace uk_co_real_logic_sbe_ir_generated { class FrameCodec { private: char *buffer_; int bufferLength_; int *positionPtr_; int offset_; int position_; int actingBlockLength_; int actingVersion_; public: static sbe_uint16_t sbeBlockLength(void) { return (sbe_uint16_t)12; } static sbe_uint16_t sbeTemplateId(void) { return (sbe_uint16_t)1; } static sbe_uint16_t sbeSchemaId(void) { return (sbe_uint16_t)0; } static sbe_uint16_t sbeSchemaVersion(void) { return (sbe_uint16_t)0; } static const char *sbeSemanticType(void) { return ""; } sbe_uint64_t offset(void) const { return offset_; } FrameCodec &wrapForEncode(char *buffer, const int offset, const int bufferLength) { buffer_ = buffer; offset_ = offset; bufferLength_ = bufferLength; actingBlockLength_ = sbeBlockLength(); actingVersion_ = sbeSchemaVersion(); position(offset + actingBlockLength_); positionPtr_ = &position_; return *this; } FrameCodec &wrapForDecode(char *buffer, const int offset, const int actingBlockLength, const int actingVersion, const int bufferLength) { buffer_ = buffer; offset_ = offset; bufferLength_ = bufferLength; actingBlockLength_ = actingBlockLength; actingVersion_ = actingVersion; positionPtr_ = &position_; position(offset + actingBlockLength_); return *this; } sbe_uint64_t position(void) const { return position_; } void position(const sbe_uint64_t position) { if (SBE_BOUNDS_CHECK_EXPECT((position > bufferLength_), 0)) { throw "buffer too short"; } position_ = position; } int size(void) const { return position() - offset_; } char *buffer(void) { return buffer_; } int actingVersion(void) const { return actingVersion_; } static int irIdId(void) { return 1; } static int irIdSinceVersion(void) { return 0; } bool irIdInActingVersion(void) { return (actingVersion_ >= 0) ? true : false; } static const char *irIdMetaAttribute(const MetaAttribute::Attribute metaAttribute) { switch (metaAttribute) { case MetaAttribute::EPOCH: return "unix"; case MetaAttribute::TIME_UNIT: return "nanosecond"; case MetaAttribute::SEMANTIC_TYPE: return ""; } return ""; } static sbe_int32_t irIdNullValue() { return -2147483648; } static sbe_int32_t irIdMinValue() { return -2147483647; } static sbe_int32_t irIdMaxValue() { return 2147483647; } sbe_int32_t irId(void) const { return SBE_LITTLE_ENDIAN_ENCODE_32(*((sbe_int32_t *)(buffer_ + offset_ + 0))); } FrameCodec &irId(const sbe_int32_t value) { *((sbe_int32_t *)(buffer_ + offset_ + 0)) = SBE_LITTLE_ENDIAN_ENCODE_32(value); return *this; } static int irVersionId(void) { return 2; } static int irVersionSinceVersion(void) { return 0; } bool irVersionInActingVersion(void) { return (actingVersion_ >= 0) ? true : false; } static const char *irVersionMetaAttribute(const MetaAttribute::Attribute metaAttribute) { switch (metaAttribute) { case MetaAttribute::EPOCH: return "unix"; case MetaAttribute::TIME_UNIT: return "nanosecond"; case MetaAttribute::SEMANTIC_TYPE: return ""; } return ""; } static sbe_int32_t irVersionNullValue() { return -2147483648; } static sbe_int32_t irVersionMinValue() { return -2147483647; } static sbe_int32_t irVersionMaxValue() { return 2147483647; } sbe_int32_t irVersion(void) const { return SBE_LITTLE_ENDIAN_ENCODE_32(*((sbe_int32_t *)(buffer_ + offset_ + 4))); } FrameCodec &irVersion(const sbe_int32_t value) { *((sbe_int32_t *)(buffer_ + offset_ + 4)) = SBE_LITTLE_ENDIAN_ENCODE_32(value); return *this; } static int schemaVersionId(void) { return 3; } static int schemaVersionSinceVersion(void) { return 0; } bool schemaVersionInActingVersion(void) { return (actingVersion_ >= 0) ? true : false; } static const char *schemaVersionMetaAttribute(const MetaAttribute::Attribute metaAttribute) { switch (metaAttribute) { case MetaAttribute::EPOCH: return "unix"; case MetaAttribute::TIME_UNIT: return "nanosecond"; case MetaAttribute::SEMANTIC_TYPE: return ""; } return ""; } static sbe_int32_t schemaVersionNullValue() { return -2147483648; } static sbe_int32_t schemaVersionMinValue() { return -2147483647; } static sbe_int32_t schemaVersionMaxValue() { return 2147483647; } sbe_int32_t schemaVersion(void) const { return SBE_LITTLE_ENDIAN_ENCODE_32(*((sbe_int32_t *)(buffer_ + offset_ + 8))); } FrameCodec &schemaVersion(const sbe_int32_t value) { *((sbe_int32_t *)(buffer_ + offset_ + 8)) = SBE_LITTLE_ENDIAN_ENCODE_32(value); return *this; } static const char *packageNameMetaAttribute(const MetaAttribute::Attribute metaAttribute) { switch (metaAttribute) { case MetaAttribute::EPOCH: return "unix"; case MetaAttribute::TIME_UNIT: return "nanosecond"; case MetaAttribute::SEMANTIC_TYPE: return ""; } return ""; } static const char *packageNameCharacterEncoding() { return "UTF-8"; } static int packageNameSinceVersion(void) { return 0; } bool packageNameInActingVersion(void) { return (actingVersion_ >= 0) ? true : false; } static int packageNameId(void) { return 4; } static int packageNameHeaderSize() { return 1; } sbe_int64_t packageNameLength(void) const { return (*((sbe_uint8_t *)(buffer_ + position()))); } const char *packageName(void) { const char *fieldPtr = (buffer_ + position() + 1); position(position() + 1 + *((sbe_uint8_t *)(buffer_ + position()))); return fieldPtr; } int getPackageName(char *dst, const int length) { sbe_uint64_t sizeOfLengthField = 1; sbe_uint64_t lengthPosition = position(); position(lengthPosition + sizeOfLengthField); sbe_int64_t dataLength = (*((sbe_uint8_t *)(buffer_ + lengthPosition))); int bytesToCopy = (length < dataLength) ? length : dataLength; sbe_uint64_t pos = position(); position(position() + (sbe_uint64_t)dataLength); ::memcpy(dst, buffer_ + pos, bytesToCopy); return bytesToCopy; } int putPackageName(const char *src, const int length) { sbe_uint64_t sizeOfLengthField = 1; sbe_uint64_t lengthPosition = position(); *((sbe_uint8_t *)(buffer_ + lengthPosition)) = ((sbe_uint8_t)length); position(lengthPosition + sizeOfLengthField); sbe_uint64_t pos = position(); position(position() + (sbe_uint64_t)length); ::memcpy(buffer_ + pos, src, length); return length; } static const char *namespaceNameMetaAttribute(const MetaAttribute::Attribute metaAttribute) { switch (metaAttribute) { case MetaAttribute::EPOCH: return "unix"; case MetaAttribute::TIME_UNIT: return "nanosecond"; case MetaAttribute::SEMANTIC_TYPE: return ""; } return ""; } static const char *namespaceNameCharacterEncoding() { return "UTF-8"; } static int namespaceNameSinceVersion(void) { return 0; } bool namespaceNameInActingVersion(void) { return (actingVersion_ >= 0) ? true : false; } static int namespaceNameId(void) { return 5; } static int namespaceNameHeaderSize() { return 1; } sbe_int64_t namespaceNameLength(void) const { return (*((sbe_uint8_t *)(buffer_ + position()))); } const char *namespaceName(void) { const char *fieldPtr = (buffer_ + position() + 1); position(position() + 1 + *((sbe_uint8_t *)(buffer_ + position()))); return fieldPtr; } int getNamespaceName(char *dst, const int length) { sbe_uint64_t sizeOfLengthField = 1; sbe_uint64_t lengthPosition = position(); position(lengthPosition + sizeOfLengthField); sbe_int64_t dataLength = (*((sbe_uint8_t *)(buffer_ + lengthPosition))); int bytesToCopy = (length < dataLength) ? length : dataLength; sbe_uint64_t pos = position(); position(position() + (sbe_uint64_t)dataLength); ::memcpy(dst, buffer_ + pos, bytesToCopy); return bytesToCopy; } int putNamespaceName(const char *src, const int length) { sbe_uint64_t sizeOfLengthField = 1; sbe_uint64_t lengthPosition = position(); *((sbe_uint8_t *)(buffer_ + lengthPosition)) = ((sbe_uint8_t)length); position(lengthPosition + sizeOfLengthField); sbe_uint64_t pos = position(); position(position() + (sbe_uint64_t)length); ::memcpy(buffer_ + pos, src, length); return length; } static const char *semanticVersionMetaAttribute(const MetaAttribute::Attribute metaAttribute) { switch (metaAttribute) { case MetaAttribute::EPOCH: return "unix"; case MetaAttribute::TIME_UNIT: return "nanosecond"; case MetaAttribute::SEMANTIC_TYPE: return ""; } return ""; } static const char *semanticVersionCharacterEncoding() { return "UTF-8"; } static int semanticVersionSinceVersion(void) { return 0; } bool semanticVersionInActingVersion(void) { return (actingVersion_ >= 0) ? true : false; } static int semanticVersionId(void) { return 6; } static int semanticVersionHeaderSize() { return 1; } sbe_int64_t semanticVersionLength(void) const { return (*((sbe_uint8_t *)(buffer_ + position()))); } const char *semanticVersion(void) { const char *fieldPtr = (buffer_ + position() + 1); position(position() + 1 + *((sbe_uint8_t *)(buffer_ + position()))); return fieldPtr; } int getSemanticVersion(char *dst, const int length) { sbe_uint64_t sizeOfLengthField = 1; sbe_uint64_t lengthPosition = position(); position(lengthPosition + sizeOfLengthField); sbe_int64_t dataLength = (*((sbe_uint8_t *)(buffer_ + lengthPosition))); int bytesToCopy = (length < dataLength) ? length : dataLength; sbe_uint64_t pos = position(); position(position() + (sbe_uint64_t)dataLength); ::memcpy(dst, buffer_ + pos, bytesToCopy); return bytesToCopy; } int putSemanticVersion(const char *src, const int length) { sbe_uint64_t sizeOfLengthField = 1; sbe_uint64_t lengthPosition = position(); *((sbe_uint8_t *)(buffer_ + lengthPosition)) = ((sbe_uint8_t)length); position(lengthPosition + sizeOfLengthField); sbe_uint64_t pos = position(); position(position() + (sbe_uint64_t)length); ::memcpy(buffer_ + pos, src, length); return length; } }; } #endif
int res[MAX_V][MAX_V], mf, f, s, t; vi p; // p stores the BFS spanning tree from s void augment(int v, int minEdge) { if (v == s) { f = minEdge; return; } else if ( p[v] != -1 ) { augment( p[v], min(minEdge, res[ p[v] ][ v ]) ); res[ p[v] ][ v ] -= f; res[ v ][ p[v] ] += f; } } // inside int main(): set up 'res', 's', and 't' with appropriate values mf = 0; while (true) // O(V^3 * E) Edmonds Karp's algorithm { f = 0; vi dist(MAX_V, INF); dist[s] = 0; queue<int> q; q.push(s); p.assign(MAX_V, -1); while (!q.empty()) { int u = q.front(); q.pop(); if (u == t) break; // immediately stop BFS if we already reach sink t for (int v = 0; v < MAX_V; ++v) if (res[u][v] > 0 && dist[v] == INF) dist[v] = dist[u] + 1, q.push(v), p[v] = u; } augment(t, INF); // find the min edge weight 'f' in this path, if any if (f == 0) break; // we cannot send any more flow ('f' = 0), terminate mf += f; // we can still send a flow, increase the max flow! } printf("%d\n", mf);
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/elasticbeanstalk/model/ConfigurationDeploymentStatus.h> #include <aws/core/utils/HashingUtils.h> #include <aws/core/Globals.h> #include <aws/core/utils/EnumParseOverflowContainer.h> using namespace Aws::Utils; namespace Aws { namespace ElasticBeanstalk { namespace Model { namespace ConfigurationDeploymentStatusMapper { static const int deployed_HASH = HashingUtils::HashString("deployed"); static const int pending_HASH = HashingUtils::HashString("pending"); static const int failed_HASH = HashingUtils::HashString("failed"); ConfigurationDeploymentStatus GetConfigurationDeploymentStatusForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == deployed_HASH) { return ConfigurationDeploymentStatus::deployed; } else if (hashCode == pending_HASH) { return ConfigurationDeploymentStatus::pending; } else if (hashCode == failed_HASH) { return ConfigurationDeploymentStatus::failed; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast<ConfigurationDeploymentStatus>(hashCode); } return ConfigurationDeploymentStatus::NOT_SET; } Aws::String GetNameForConfigurationDeploymentStatus(ConfigurationDeploymentStatus enumValue) { switch(enumValue) { case ConfigurationDeploymentStatus::deployed: return "deployed"; case ConfigurationDeploymentStatus::pending: return "pending"; case ConfigurationDeploymentStatus::failed: return "failed"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); } return ""; } } } // namespace ConfigurationDeploymentStatusMapper } // namespace Model } // namespace ElasticBeanstalk } // namespace Aws
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <memory> // unique_ptr // Test unique_ptr converting move assignment #include <memory> #include <cassert> #include "../../deleter.h" struct A { static int count; A() {++count;} A(const A&) {++count;} virtual ~A() {--count;} }; int A::count = 0; struct B : public A { static int count; B() {++count;} B(const B&) {++count;} virtual ~B() {--count;} }; int B::count = 0; int main() { { std::unique_ptr<B, Deleter<B> > s(new B, Deleter<B>(5)); A* p = s.get(); std::unique_ptr<A, Deleter<A> > s2(new A); assert(A::count == 2); s2 = std::move(s); assert(s2.get() == p); assert(s.get() == 0); assert(A::count == 1); assert(B::count == 1); assert(s2.get_deleter().state() == 5); assert(s.get_deleter().state() == 0); } assert(A::count == 0); assert(B::count == 0); }
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/engagement/important_sites_util.h" #include <memory> #include <utility> #include "base/bind.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/sample_vector.h" #include "base/strings/utf_string_conversions.h" #include "base/test/metrics/histogram_tester.h" #include "build/build_config.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/test/bookmark_test_helpers.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/keyed_service/core/keyed_service.h" #include "components/site_engagement/content/site_engagement_score.h" #include "components/site_engagement/content/site_engagement_service.h" #include "content/public/browser/web_contents.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" // TODO(crbug.com/1039517): Disabled all tests because they lead the flakiness // dashboard. The root cause is documented in the bug. #if !defined(OS_ANDROID) namespace site_engagement { namespace { using BookmarkModel = bookmarks::BookmarkModel; using ImportantDomainInfo = ImportantSitesUtil::ImportantDomainInfo; const size_t kNumImportantSites = 5; // We only need to reproduce the values that we are testing. The values here // need to match the values in important_sites_util. enum ImportantReasonForTesting { ENGAGEMENT = 0, BOOKMARKS = 2, NOTIFICATIONS = 4 }; // We only need to reproduce the values that we are testing. The values here // need to match the values in important_sites_util. enum CrossedReasonForTesting { CROSSED_NOTIFICATIONS_AND_ENGAGEMENT = 3, CROSSED_REASON_UNKNOWN = 7, }; } // namespace class ImportantSitesUtilTest : public ChromeRenderViewHostTestHarness { public: void SetUp() override { ChromeRenderViewHostTestHarness::SetUp(); SiteEngagementScore::SetParamValuesForTesting(); } TestingProfile::TestingFactories GetTestingFactories() const override { return {{BookmarkModelFactory::GetInstance(), BookmarkModelFactory::GetDefaultFactory()}, {HistoryServiceFactory::GetInstance(), HistoryServiceFactory::GetDefaultFactory()}}; } void AddContentSetting(ContentSettingsType type, ContentSetting setting, const GURL& origin) { HostContentSettingsMapFactory::GetForProfile(profile()) ->SetContentSettingCustomScope( ContentSettingsPattern::FromURLNoWildcard(origin), ContentSettingsPattern::Wildcard(), type, setting); EXPECT_EQ(setting, HostContentSettingsMapFactory::GetForProfile(profile()) ->GetContentSetting(origin, GURL(), type)); } void AddBookmark(const GURL& origin) { if (!model_) { model_ = BookmarkModelFactory::GetForBrowserContext(profile()); bookmarks::test::WaitForBookmarkModelToLoad(model_); } model_->AddURL(model_->bookmark_bar_node(), 0, base::ASCIIToUTF16(origin.spec()), origin); } void ExpectImportantResultsEq( const std::vector<std::string>& domains, const std::vector<GURL>& expected_sorted_origins, const std::vector<ImportantDomainInfo>& important_sites) { ASSERT_EQ(domains.size(), important_sites.size()); ASSERT_EQ(expected_sorted_origins.size(), important_sites.size()); for (size_t i = 0; i < important_sites.size(); i++) { EXPECT_EQ(domains[i], important_sites[i].registerable_domain); EXPECT_EQ(expected_sorted_origins[i], important_sites[i].example_origin); } } void ExpectImportantResultsEqualUnordered( const std::vector<std::string>& domains, const std::vector<GURL>& expected_sorted_origins, const std::vector<ImportantDomainInfo>& important_sites) { ASSERT_EQ(domains.size(), important_sites.size()); ASSERT_EQ(expected_sorted_origins.size(), important_sites.size()); std::vector<std::string> actual_domains; std::vector<GURL> actual_origins; for (size_t i = 0; i < important_sites.size(); i++) { actual_domains.push_back(important_sites[i].registerable_domain); actual_origins.push_back(important_sites[i].example_origin); } EXPECT_THAT(actual_domains, testing::UnorderedElementsAreArray(domains)); EXPECT_THAT(actual_origins, testing::UnorderedElementsAreArray(expected_sorted_origins)); } private: BookmarkModel* model_ = nullptr; }; TEST_F(ImportantSitesUtilTest, TestNoImportantSites) { EXPECT_TRUE(ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites) .empty()); } TEST_F(ImportantSitesUtilTest, SourceOrdering) { SiteEngagementService* service = SiteEngagementService::Get(profile()); ASSERT_TRUE(service); GURL url1("http://www.google.com/"); GURL url2("https://www.google.com/"); GURL url3("https://drive.google.com/"); GURL url4("https://www.chrome.com/"); GURL url5("https://www.example.com/"); GURL url6("https://youtube.com/"); GURL url7("https://foo.bar/"); service->ResetBaseScoreForURL(url1, 5); service->ResetBaseScoreForURL(url2, 2); // Below medium engagement (5). service->ResetBaseScoreForURL(url3, 7); service->ResetBaseScoreForURL(url4, 8); service->ResetBaseScoreForURL(url5, 9); service->ResetBaseScoreForURL(url6, 1); // Below the medium engagement (5). service->ResetBaseScoreForURL(url7, 11); // Here we should have: // 1: removed domains below minimum engagement, // 2: combined the google.com entries, and // 3: sorted by the score. std::vector<ImportantDomainInfo> important_sites = ImportantSitesUtil::GetImportantRegisterableDomains(profile(), kNumImportantSites); std::vector<std::string> expected_sorted_domains = { "foo.bar", "example.com", "chrome.com", "google.com"}; std::vector<GURL> expected_sorted_origins = {url7, url5, url4, url3}; ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); // Test that notifications get moved to the front. AddContentSetting(ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_ALLOW, url6); // BLOCK'ed sites don't count. We want to make sure we only bump sites that // were granted the permsion. AddContentSetting(ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_BLOCK, url1); // Same as above, but the site with notifications should be at the front. important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); expected_sorted_domains = {"youtube.com", "foo.bar", "example.com", "chrome.com", "google.com"}; expected_sorted_origins = {url6, url7, url5, url4, url3}; ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); // Test that bookmarks move above engagements and below notifications. AddBookmark(url1); important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); expected_sorted_domains = {"youtube.com", "google.com", "foo.bar", "example.com", "chrome.com"}; expected_sorted_origins = {url6, url3, url7, url5, url4}; ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); } TEST_F(ImportantSitesUtilTest, TooManyBookmarks) { SiteEngagementService* service = SiteEngagementService::Get(profile()); ASSERT_TRUE(service); GURL url1("http://www.google.com/"); GURL url2("https://www.google.com/"); GURL url3("https://drive.google.com/"); GURL url4("https://www.chrome.com/"); GURL url5("https://www.example.com/"); GURL url6("https://youtube.com/"); GURL url7("https://foo.bar/"); // Add some as bookmarks. AddBookmark(url1); AddBookmark(url2); AddBookmark(url3); AddBookmark(url4); AddBookmark(url5); // We have just below our limit, so all sites are important (the first three // origins collapse, so we end up with 3). std::vector<ImportantDomainInfo> important_sites = ImportantSitesUtil::GetImportantRegisterableDomains(profile(), kNumImportantSites); EXPECT_EQ(3u, important_sites.size()); // Add the rest, which should put us over the limit. AddBookmark(url6); AddBookmark(url7); // Too many bookmarks! Nothing shows up now. important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); EXPECT_EQ(0u, important_sites.size()); // If we add some site engagement, they should show up (even though the site // engagement score is too low for a signal by itself). service->ResetBaseScoreForURL(url1, 2); service->ResetBaseScoreForURL(url4, 3); service->ResetBaseScoreForURL(url7, 0); important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); ASSERT_EQ(2u, important_sites.size()); std::vector<std::string> expected_sorted_domains = {"google.com", "chrome.com"}; std::vector<GURL> expected_sorted_origins = {url1, url4}; ExpectImportantResultsEqualUnordered( expected_sorted_domains, expected_sorted_origins, important_sites); } TEST_F(ImportantSitesUtilTest, Suppressing) { SiteEngagementService* service = SiteEngagementService::Get(profile()); ASSERT_TRUE(service); GURL url1("http://www.google.com/"); GURL url2("http://www.gmail.com/"); // Set a bunch of positive signals. service->ResetBaseScoreForURL(url1, 5); AddBookmark(url2); AddContentSetting(ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_ALLOW, url1); // Important fetch 1. std::vector<ImportantDomainInfo> important_sites = ImportantSitesUtil::GetImportantRegisterableDomains(profile(), kNumImportantSites); std::vector<std::string> expected_sorted_domains = {"google.com", "gmail.com"}; std::vector<GURL> expected_sorted_origins = {url1, url2}; ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); ASSERT_EQ(2u, important_sites.size()); // Record ignore twice. ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"gmail.com"}, {important_sites[1].reason_bitfield}, {"google.com"}, {important_sites[0].reason_bitfield}); ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"gmail.com"}, {important_sites[1].reason_bitfield}, {"google.com"}, {important_sites[0].reason_bitfield}); // Important fetch 2. important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); // We shouldn't suppress after first two times. ASSERT_EQ(2u, important_sites.size()); // Record ignore 3rd time. ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"gmail.com"}, {important_sites[1].reason_bitfield}, {"google.com"}, {important_sites[0].reason_bitfield}); // Important fetch 3. Google.com should be suppressed now. important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); ASSERT_EQ(1u, important_sites.size()); expected_sorted_domains = {"gmail.com"}; expected_sorted_origins = {url2}; ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); } TEST_F(ImportantSitesUtilTest, SuppressingReset) { SiteEngagementService* service = SiteEngagementService::Get(profile()); ASSERT_TRUE(service); GURL url1("http://www.google.com/"); GURL url2("http://www.gmail.com/"); // Set a bunch of positive signals. service->ResetBaseScoreForURL(url1, 5); AddBookmark(url2); AddContentSetting(ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_ALLOW, url1); // Important fetch 1. std::vector<ImportantDomainInfo> important_sites = ImportantSitesUtil::GetImportantRegisterableDomains(profile(), kNumImportantSites); ASSERT_EQ(2u, important_sites.size()); // Record ignore twice. ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"gmail.com"}, {important_sites[1].reason_bitfield}, {"google.com"}, {important_sites[0].reason_bitfield}); ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"gmail.com"}, {important_sites[1].reason_bitfield}, {"google.com"}, {important_sites[0].reason_bitfield}); // Important fetch, we should still be there. important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); std::vector<std::string> expected_sorted_domains = {"google.com", "gmail.com"}; std::vector<GURL> expected_sorted_origins = {url1, url2}; ASSERT_EQ(2u, important_sites.size()); ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); // Record NOT ignored. ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"google.com", "gmail.com"}, {important_sites[0].reason_bitfield, important_sites[1].reason_bitfield}, std::vector<std::string>(), std::vector<int32_t>()); // Record ignored twice again ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"gmail.com"}, {important_sites[1].reason_bitfield}, {"google.com"}, {important_sites[0].reason_bitfield}); ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"gmail.com"}, {important_sites[1].reason_bitfield}, {"google.com"}, {important_sites[0].reason_bitfield}); // Important fetch, we should still be there. important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); // Record ignored 3rd time in a row. ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"gmail.com"}, {important_sites[1].reason_bitfield}, {"google.com"}, {important_sites[0].reason_bitfield}); // Suppressed now. important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); ASSERT_EQ(1u, important_sites.size()); expected_sorted_domains = {"gmail.com"}; expected_sorted_origins = {url2}; ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); } TEST_F(ImportantSitesUtilTest, Metrics) { SiteEngagementService* service = SiteEngagementService::Get(profile()); ASSERT_TRUE(service); base::HistogramTester histogram_tester; GURL url1("http://www.google.com/"); service->ResetBaseScoreForURL(url1, 5); AddContentSetting(ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_ALLOW, url1); GURL url2("http://www.youtube.com/"); AddBookmark(url2); GURL url3("http://www.bad.com/"); AddBookmark(url3); std::vector<ImportantDomainInfo> important_sites = ImportantSitesUtil::GetImportantRegisterableDomains(profile(), kNumImportantSites); ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), {"google.com", "youtube.com"}, {important_sites[0].reason_bitfield, important_sites[1].reason_bitfield}, {"bad.com"}, {important_sites[2].reason_bitfield}); EXPECT_THAT( histogram_tester.GetAllSamples("Storage.ImportantSites.CBDChosenReason"), testing::ElementsAre(base::Bucket(ENGAGEMENT, 1), base::Bucket(BOOKMARKS, 1), base::Bucket(NOTIFICATIONS, 1))); EXPECT_THAT( histogram_tester.GetAllSamples("Storage.ImportantSites.CBDIgnoredReason"), testing::ElementsAre(base::Bucket(BOOKMARKS, 1))); // Bookmarks are "unknown", as they were added after the crossed reasons. EXPECT_THAT(histogram_tester.GetAllSamples( "Storage.BlacklistedImportantSites.Reason"), testing::ElementsAre( base::Bucket(CROSSED_NOTIFICATIONS_AND_ENGAGEMENT, 1), base::Bucket(CROSSED_REASON_UNKNOWN, 1))); } TEST_F(ImportantSitesUtilTest, DialogExcluding) { SiteEngagementService* service = SiteEngagementService::Get(profile()); ASSERT_TRUE(service); GURL url1("http://www.google.com/"); GURL url2("http://www.yahoo.com/"); // Set a bunch of positive signals. service->ResetBaseScoreForURL(url2, 5); AddBookmark(url1); AddContentSetting(ContentSettingsType::NOTIFICATIONS, CONTENT_SETTING_ALLOW, url1); // Start off not disabled. EXPECT_FALSE(ImportantSitesUtil::IsDialogDisabled(profile())); // Important fetch 1. std::vector<ImportantDomainInfo> important_sites = ImportantSitesUtil::GetImportantRegisterableDomains(profile(), kNumImportantSites); std::vector<std::string> expected_sorted_domains = {"google.com", "yahoo.com"}; std::vector<GURL> expected_sorted_origins = {url1, url2}; ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); ASSERT_EQ(2u, important_sites.size()); // Ignore all sites 2 times. ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), std::vector<std::string>(), std::vector<int32_t>(), {"google.com", "yahoo.com"}, {important_sites[0].reason_bitfield, important_sites[1].reason_bitfield}); ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), std::vector<std::string>(), std::vector<int32_t>(), {"google.com", "yahoo.com"}, {important_sites[0].reason_bitfield, important_sites[1].reason_bitfield}); // Still not disabled... EXPECT_FALSE(ImportantSitesUtil::IsDialogDisabled(profile())); // Ignore 3rd time. ImportantSitesUtil::RecordExcludedAndIgnoredImportantSites( profile(), std::vector<std::string>(), std::vector<int32_t>(), {"google.com", "yahoo.com"}, {important_sites[0].reason_bitfield, important_sites[1].reason_bitfield}); // Items should still be present. important_sites = ImportantSitesUtil::GetImportantRegisterableDomains( profile(), kNumImportantSites); ExpectImportantResultsEq(expected_sorted_domains, expected_sorted_origins, important_sites); // Dialog should be disabled. EXPECT_TRUE(ImportantSitesUtil::IsDialogDisabled(profile())); } } // namespace site_engagement #endif // !defined(OS_ANDROID)
/** * @file MqBase.hpp * @brief MqBase class prototype. * @author zer0 * @date 2018-11-25 */ #ifndef __INCLUDE_LIBTBAG__LIBTBAG_MQ_NODE_MQBASE_HPP__ #define __INCLUDE_LIBTBAG__LIBTBAG_MQ_NODE_MQBASE_HPP__ // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif #include <libtbag/config.h> #include <libtbag/predef.hpp> #include <libtbag/mq/details/MqCommon.hpp> #include <libtbag/mq/details/MqEventQueue.hpp> #include <libtbag/mq/details/MqQueue.hpp> #include <libtbag/uvpp/Loop.hpp> #include <libtbag/uvpp/Async.hpp> #include <libtbag/uvpp/Timer.hpp> #include <libtbag/lock/UvLock.hpp> #include <libtbag/lock/UvCondition.hpp> #include <cassert> #include <atomic> // ------------------- NAMESPACE_LIBTBAG_OPEN // ------------------- namespace mq { namespace node { /** * MqBase class prototype. * * @author zer0 * @date 2018-11-25 */ class TBAG_API MqBase : protected libtbag::mq::details::MqEventQueue, public libtbag::mq::details::MqInterface { public: using Loop = libtbag::uvpp::Loop; using Async = libtbag::uvpp::Async; using Timer = libtbag::uvpp::Timer; using Buffer = libtbag::util::Buffer; using binf = libtbag::util::binf; using cbinf = libtbag::util::cbinf; using MqEvent = libtbag::mq::details::MqEvent; using MqType = libtbag::mq::details::MqType; using MqRequestState = libtbag::mq::details::MqRequestState; using MqMachineState = libtbag::mq::details::MqMachineState; using MqMsg = libtbag::mq::details::MqMsg; using MqEventQueue = libtbag::mq::details::MqEventQueue; using MqQueue = libtbag::mq::details::MqQueue; using MqInternal = libtbag::mq::details::MqInternal; using MqParams = libtbag::mq::details::MqParams; using MqIsConsume = libtbag::mq::details::MqIsConsume; using AsyncMsg = MqEventQueue::AsyncMsg; using AfterAction = MqEventQueue::AfterAction; using AsyncMsgPointer = libtbag::container::Pointer<AsyncMsg>; using AsyncMsgQueue = std::queue<AsyncMsgPointer>; using AtomicState = std::atomic<MqMachineState>; using AtomicBool = std::atomic_bool; using AtomicInt = std::atomic_int; using UvLock = libtbag::lock::UvLock; using UvCondition = libtbag::lock::UvCondition; public: struct Initializer : public Async { MqBase * parent = nullptr; Initializer(Loop & loop, MqBase * p) : Async(loop), parent(p) { assert(parent != nullptr); } virtual ~Initializer() { /* EMPTY. */ } virtual void onAsync() override { parent->onInitializerAsync(this); } virtual void onClose() override { parent->onInitializerClose(this); } }; struct Terminator : public Async { MqBase * parent = nullptr; Terminator(Loop & loop, MqBase * p) : Async(loop), parent(p) { assert(parent != nullptr); } virtual ~Terminator() { /* EMPTY. */ } virtual void onAsync() override { parent->onTerminatorAsync(this); } virtual void onClose() override { parent->onTerminatorClose(this); } }; struct Writer : public Async { MqBase * parent = nullptr; MqRequestState state; AsyncMsgQueue queue; std::size_t write_count; Writer(Loop & loop, MqBase * p) : Async(loop), parent(p), state(MqRequestState::MRS_WAITING), queue(), write_count(0) { assert(parent != nullptr); } virtual ~Writer() { /* EMPTY. */ } virtual void onAsync() override { parent->onWriterAsync(this); } virtual void onClose() override { parent->onWriterClose(this); } }; struct CloseTimer : public Timer { MqBase * parent = nullptr; CloseTimer(Loop & loop, MqBase * p) : Timer(loop), parent(p) { assert(parent != nullptr); } virtual ~CloseTimer() { /* EMPTY. */ } virtual void onTimer() override { parent->onCloseTimerTimer(this); } virtual void onClose() override { parent->onCloseTimerClose(this); } }; public: using SharedInitializer = std::shared_ptr<Initializer>; using SharedTerminator = std::shared_ptr<Terminator>; public: MqInternal const INTERNAL; MqParams const PARAMS; protected: MqQueue _receives; protected: SharedTerminator _terminator; protected: AtomicState _state; AtomicInt _sending; AtomicInt _exiting; private: UvLock mutable _wait_lock; UvCondition _wait_cond; bool _wait_enable; protected: MqBase(MqInternal const & internal, MqParams const & params); MqBase(Loop & loop, MqInternal const & internal, MqParams const & params); virtual ~MqBase(); protected: /** Obtain an inaccurate active send-queue size. */ std::size_t getActiveSendSize() const; /** Obtain an inaccurate active recv-queue size. */ std::size_t getActiveRecvSize() const; void enableWait(bool enable = true); void disableWait(); void createTerminator(Loop & loop); void closeTerminator(); void changeClosingState(); void changeClosedState(); Err enqueueReceiveForSingleProducer(MqMsg const & msg); protected: virtual void onInitializerAsync(Initializer * init) { /* EMPTY. */ } virtual void onInitializerClose(Initializer * init) { /* EMPTY. */ } virtual void onTerminatorAsync(Terminator * terminator) { /* EMPTY. */ } virtual void onTerminatorClose(Terminator * terminator) { /* EMPTY. */ } virtual void onWriterAsync(Writer * writer) { /* EMPTY. */ } virtual void onWriterClose(Writer * writer) { /* EMPTY. */ } virtual void onCloseTimerTimer(CloseTimer * timer) { /* EMPTY. */ } virtual void onCloseTimerClose(CloseTimer * timer) { /* EMPTY. */ } public: inline MqMachineState state() const TBAG_NOEXCEPT { return _state.load(); } inline int getTypeInteger() const TBAG_NOEXCEPT { return static_cast<int>(PARAMS.type); } inline char const * const getTypeName() const TBAG_NOEXCEPT { return libtbag::mq::details::getTypeName(PARAMS.type); } public: virtual Err exit() override; virtual Err send(MqMsg const & msg) override; virtual Err recv(MqMsg & msg) override; virtual Err waitEnable(uint64_t timeout_nano) override; virtual Err waitRecv(MqMsg & msg, uint64_t timeout_nano) override; }; } // namespace node } // namespace mq // -------------------- NAMESPACE_LIBTBAG_CLOSE // -------------------- #endif // __INCLUDE_LIBTBAG__LIBTBAG_MQ_NODE_MQBASE_HPP__
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <vector> #include <iomanip> #include <cmath> #include <set> #include <map> #include <queue> #include <climits> #include <cassert> using namespace std; typedef long long LL; typedef pair<int,int> pii; #define pb push_back #define mp make_pair #define sz size() #define ln length() #define forr(i,a,b) for(int i=a;i<b;i++) #define rep(i,n) forr(i,0,n) #define all(v) v.begin(),v.end() #define uniq(v) sort(all(v));v.erase(unique(all(v)),v.end()) #define clr(a) memset(a,0,sizeof a) #define debug if(1) #define debugoff if(0) #define print(x) cerr << x << " "; #define pn() cerr << endl; #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl; #define MAX 1010 #define MOD 1000000007 LL L[MAX],R[MAX],n; double p[MAX],mem[MAX][MAX]; double solve(int idx,int k) // worst case : k=100 , i.e all good one items { if(k == 0) return 1; if(idx == n) return 0; double& res = mem[idx][k]; if(res != -1) return res; res = 0; res = p[idx] * solve(idx+1,k-1); res += (1.0 - p[idx]) * solve(idx+1,k); return res; } int main() { LL k,goodnum; cin>>n; rep(i,n) cin>>L[i]>>R[i]; cin>>k; //find prob. that item-i is good one. rep(i,n) { goodnum = 0; for(LL j=0,pwr = 1;j<=18;pwr*=10,j++) goodnum += max((min(R[i],2*pwr-1) - max(L[i],pwr) + 1) , 0LL); p[i] = (1.0 * goodnum)/(R[i]-L[i]+1); } rep(i,n+1) rep(j,n+1) mem[i][j] = -1; int req = ceil((k*n)/100.0); printf("%.15lf\n",solve(0,req)); return 0; }
/* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Author: jefftk@google.com (Jeff Kaufman) #include "pagespeed/kernel/http/domain_registry.h" #include <cstddef> // for size_t #include "third_party/domain_registry_provider/src/domain_registry/domain_registry.h" #include "pagespeed/kernel/base/string.h" #include "pagespeed/kernel/base/string_util.h" namespace net_instaweb { namespace domain_registry { void Init() { InitializeDomainRegistry(); } StringPiece MinimalPrivateSuffix(StringPiece hostname) { if (hostname.empty()) { return ""; } size_t length_of_public_suffix = GetRegistryLength(hostname.as_string().c_str()); if (length_of_public_suffix == 0) { // Unrecognized top level domain. We don't know what kind of multi-level // public suffixes they might have created, so be on the safe side and // treat the entire hostname as a private suffix. return hostname; } stringpiece_ssize_type last_dot_before_private_suffix = hostname.rfind('.', hostname.size() - length_of_public_suffix - 1 /* don't include the dot */ - 1 /* pos is inclusive */); if (last_dot_before_private_suffix == StringPiece::npos) { // Hostname is already a minimal private suffix. last_dot_before_private_suffix = 0; } else { last_dot_before_private_suffix++; // Don't include the dot. } return hostname.substr(last_dot_before_private_suffix); } } // namespace domain_registry } // namespace net_instaweb
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/core/common_runtime/device.h" #include "tensorflow/core/common_runtime/device_factory.h" #include "tensorflow/core/kernels/mlir_generated/base_ops_test.h" #include "tensorflow/core/kernels/mlir_generated/base_unary_ops_test.h" namespace tensorflow { namespace { // Test fixture `UnaryOpsTest` that sets the TF device is expected by the TEST // macros below. class UnaryOpsTest : public UnaryOpsTestBase { protected: void SetUp() override { std::unique_ptr<tensorflow::Device> device_cpu( tensorflow::DeviceFactory::NewDevice("CPU", {}, "/job:a/replica:0/task:0")); SetDevice(tensorflow::DEVICE_CPU, std::move(device_cpu)); } }; /// Test `tf.Abs`. // TODO(b/179242253): Re-enable buffer reuse. GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES_2( Abs, DT_HALF, DT_HALF, DT_HALF, DT_HALF, test::NearZeroAndExtremeInput<Eigen::half>(), Eigen::numext::abs, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES( Abs, DT_FLOAT, DT_FLOAT, test::NearZeroAndExtremeInput<float>(), std::abs, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES( Abs, DT_DOUBLE, DT_DOUBLE, test::NearZeroAndExtremeInput<double>(), std::abs, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES_2( Abs, DT_INT8, DT_INT32, DT_INT8, DT_INT32, test::NearZeroAndExtremeInput<int8>(), std::abs, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES_2( Abs, DT_INT16, DT_INT32, DT_INT16, DT_INT32, test::NearZeroAndExtremeInput<int16>(), std::abs, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES( Abs, DT_INT32, DT_INT32, test::NearZeroAndExtremeInput<int32>(), std::abs, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) GENERATE_DEFAULT_TEST_WITH_SPECIFIC_INPUT_VALUES( Abs, DT_INT64, DT_INT64, test::NearZeroAndExtremeInput<int64>(), std::abs, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) /// Test `tf.Ceil`. GENERATE_DEFAULT_TEST(Ceil, DT_HALF, DT_HALF, Eigen::numext::ceil, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Ceil, DT_FLOAT, DT_FLOAT, Eigen::numext::ceil, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Ceil, DT_DOUBLE, DT_DOUBLE, Eigen::numext::ceil, test::OpsTestConfig().NoBufferReuse()) /// Test `tf.Cos`. GENERATE_DEFAULT_TEST(Cos, DT_HALF, DT_HALF, Eigen::numext::cos, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Cos, DT_FLOAT, DT_FLOAT, Eigen::numext::cos, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Cos, DT_DOUBLE, DT_DOUBLE, Eigen::numext::cos, test::OpsTestConfig().NoBufferReuse()) /// Test `tf.Floor`. GENERATE_DEFAULT_TEST(Floor, DT_HALF, DT_HALF, Eigen::numext::floor, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Floor, DT_FLOAT, DT_FLOAT, Eigen::numext::floor, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Floor, DT_DOUBLE, DT_DOUBLE, Eigen::numext::floor, test::OpsTestConfig().NoBufferReuse()) /// Test `tf.Rsqrt`. GENERATE_DEFAULT_TEST(Rsqrt, DT_HALF, DT_HALF, Eigen::numext::rsqrt, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Rsqrt, DT_FLOAT, DT_FLOAT, Eigen::numext::rsqrt, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Rsqrt, DT_DOUBLE, DT_DOUBLE, Eigen::numext::rsqrt, test::OpsTestConfig().NoBufferReuse()) /// Test `tf.Sin`. GENERATE_DEFAULT_TEST(Sin, DT_HALF, DT_HALF, Eigen::numext::sin, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Sin, DT_FLOAT, DT_FLOAT, Eigen::numext::sin, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Sin, DT_DOUBLE, DT_DOUBLE, Eigen::numext::sin, test::OpsTestConfig().NoBufferReuse()) /// Test `tf.Sqrt`. GENERATE_DEFAULT_TEST(Sqrt, DT_HALF, DT_HALF, Eigen::numext::sqrt, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Sqrt, DT_FLOAT, DT_FLOAT, Eigen::numext::sqrt, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Sqrt, DT_DOUBLE, DT_DOUBLE, Eigen::numext::sqrt, test::OpsTestConfig().NoBufferReuse()) /// Test `tf.Square`. template <typename T> T baseline_square(T a) { return a * a; } GENERATE_DEFAULT_TEST(Square, DT_HALF, DT_HALF, baseline_square, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Square, DT_FLOAT, DT_FLOAT, baseline_square, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Square, DT_DOUBLE, DT_DOUBLE, baseline_square, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST( Square, DT_INT32, DT_INT32, baseline_square, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) GENERATE_DEFAULT_TEST( Square, DT_INT64, DT_INT64, baseline_square, test::OpsTestConfig().NoBufferReuse().ExpectStrictlyEqual()) GENERATE_DEFAULT_TEST(Square, DT_COMPLEX64, DT_COMPLEX64, baseline_square, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Square, DT_COMPLEX128, DT_COMPLEX128, baseline_square, test::OpsTestConfig().NoBufferReuse()) /// Test `tf.Tan`. GENERATE_DEFAULT_TEST(Tan, DT_HALF, DT_HALF, Eigen::numext::tan, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Tan, DT_FLOAT, DT_FLOAT, Eigen::numext::tan, test::OpsTestConfig().NoBufferReuse()) GENERATE_DEFAULT_TEST(Tan, DT_DOUBLE, DT_DOUBLE, Eigen::numext::tan, test::OpsTestConfig().NoBufferReuse()) } // namespace } // namespace tensorflow
#include "common_main.h" #include "bc_random.h" // defined in generated #include "gm_rand.h" class my_main: public main_t { public: float* BC; ~my_main() { delete[] BC; } my_main() { BC = NULL; } virtual bool prepare() { BC = new float[G.num_nodes()]; return true; } virtual bool run() { bc_random(G, BC, 10); return true; } virtual bool post_process() { printf("BC[0] = %0.9lf\n", BC[0]); printf("BC[1] = %0.9lf\n", BC[1]); printf("BC[2] = %0.9lf\n", BC[2]); printf("BC[3] = %0.9lf\n", BC[3]); return true; } }; int main(int argc, char** argv) { my_main M; M.main(argc, argv); }
class Solution { public: /** * @param string: An array of Char * @param length: The true length of the string * @return: The true length of new string */ int replaceBlank(char string[], int length) { // Write your code here int blankCount = 0; // indicate the blank number for ( int i = 0; i < length; i++) { if(string[i] == ' '){ blankCount++; } } int res = blankCount*2+length; int temp = res-1; for (int i = length-1; i >= 0 && blankCount>0; i--){ if(string[i]!=' '){ string[temp--]=string[i]; }else{ //meet the ' ' string[temp--]='0'; string[temp--]='2'; string[temp--]='%'; blankCount--; } } return res; } };
// David Eberly, Geometric Tools, Redmond WA 98052 // Copyright (c) 1998-2021 // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt // https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt // Version: 4.0.2021.11.12 #include "MorphControllersWindow3.h" #include <iostream> int main() { try { Window::Parameters parameters(L"MorphControllersWindow3", 0, 0, 768, 768); auto window = TheWindowSystem.Create<MorphControllersWindow3>(parameters); TheWindowSystem.MessagePump(window, TheWindowSystem.DEFAULT_ACTION); TheWindowSystem.Destroy(window); } catch (std::exception const& e) { std::cout << e.what() << std::endl; } return 0; }
// $Id: PM_Server.cpp 80826 2008-03-04 14:51:23Z wotte $ #include "Options.h" #include "Rwho_DB_Manager.h" #include "PM_Server.h" #include "ace/ACE.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_stdio.h" // This is the main method for the server side of things. It reads // the RWHO file on the local machine and inserts HOST_NAME // information for each LOGIN_NAME that is a friend into the // DRWHO_LIST. This function is also responsible for determining // whether a given LOGIN_NAME is currently idle or not. int PM_Server::process (void) { RWho_DB_Manager ru; Protocol_Record protocol_record (1); while (ru.get_next_user (protocol_record) > 0) this->insert_protocol_info (protocol_record); return 1; } // Insert the HOST_NAME into the server's lookup table on behalf of // user LOGIN_NAME. Note that we need to allocate memory for // HOST_NAME... Protocol_Record * PM_Server::insert_protocol_info (Protocol_Record &protocol_record) { Protocol_Record *prp = this->ss->insert (protocol_record.get_login ()); Drwho_Node *current_node = protocol_record.get_drwho_list (); if (current_node->get_idle_time () < MAX_USER_TIMEOUT) this->increment_total_users (); if (prp) { Drwho_Node *np = this->get_drwho_node (ACE::strnew (current_node->get_host_name ()), prp->drwho_list_); if (current_node->get_idle_time () >= MAX_USER_TIMEOUT) np->inactive_count_++; else np->active_count_++; } return prp; } // Put the inactive and active counts, plus the hostname into the // packet. char * PM_Server::handle_protocol_entries (char *buf_ptr, Drwho_Node *np) { for (; np != 0; np = np->next_) { ACE_OS::sprintf (buf_ptr, "%d %d %s", np->get_inactive_count (), np->get_active_count (), np->get_host_name ()); buf_ptr += ACE_OS::strlen (buf_ptr) + 1; } return buf_ptr; } PM_Server::PM_Server (void) { } PM_Server::~PM_Server (void) { }
// Copyright (c) 2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or https://www.opensource.org/licenses/mit-license.php . #include <vector> #include "prevector.h" #include "test_random.h" #include "reverse_iterator.h" #include "serialize.h" #include "streams.h" #include "test/test_bitcoin.h" #include <boost/test/unit_test.hpp> BOOST_FIXTURE_TEST_SUITE(PrevectorTests, TestingSetup) template<unsigned int N, typename T> class prevector_tester { typedef std::vector<T> realtype; realtype real_vector; realtype real_vector_alt; typedef prevector<N, T> pretype; pretype pre_vector; pretype pre_vector_alt; typedef typename pretype::size_type Size; bool passed = true; FastRandomContext rand_cache; uint256 rand_seed; template <typename A, typename B> void local_check_equal(A a, B b) { local_check(a == b); } void local_check(bool b) { passed &= b; } void test() { const pretype& const_pre_vector = pre_vector; local_check_equal(real_vector.size(), pre_vector.size()); local_check_equal(real_vector.empty(), pre_vector.empty()); for (Size s = 0; s < real_vector.size(); s++) { local_check(real_vector[s] == pre_vector[s]); local_check(&(pre_vector[s]) == &(pre_vector.begin()[s])); local_check(&(pre_vector[s]) == &*(pre_vector.begin() + s)); local_check(&(pre_vector[s]) == &*((pre_vector.end() + s) - real_vector.size())); } // local_check(realtype(pre_vector) == real_vector); local_check(pretype(real_vector.begin(), real_vector.end()) == pre_vector); local_check(pretype(pre_vector.begin(), pre_vector.end()) == pre_vector); size_t pos = 0; for (const T& v : pre_vector) { local_check(v == real_vector[pos++]); } for (const T& v : reverse_iterate(pre_vector)) { local_check(v == real_vector[--pos]); } for (const T& v : const_pre_vector) { local_check(v == real_vector[pos++]); } for (const T& v : reverse_iterate(const_pre_vector)) { local_check(v == real_vector[--pos]); } CDataStream ss1(SER_DISK, 0); CDataStream ss2(SER_DISK, 0); ss1 << real_vector; ss2 << pre_vector; local_check_equal(ss1.size(), ss2.size()); for (Size s = 0; s < ss1.size(); s++) { local_check_equal(ss1[s], ss2[s]); } } public: void resize(Size s) { real_vector.resize(s); local_check_equal(real_vector.size(), s); pre_vector.resize(s); local_check_equal(pre_vector.size(), s); test(); } void reserve(Size s) { real_vector.reserve(s); local_check(real_vector.capacity() >= s); pre_vector.reserve(s); local_check(pre_vector.capacity() >= s); test(); } void insert(Size position, const T& value) { real_vector.insert(real_vector.begin() + position, value); pre_vector.insert(pre_vector.begin() + position, value); test(); } void insert(Size position, Size count, const T& value) { real_vector.insert(real_vector.begin() + position, count, value); pre_vector.insert(pre_vector.begin() + position, count, value); test(); } template<typename I> void insert_range(Size position, I first, I last) { real_vector.insert(real_vector.begin() + position, first, last); pre_vector.insert(pre_vector.begin() + position, first, last); test(); } void erase(Size position) { real_vector.erase(real_vector.begin() + position); pre_vector.erase(pre_vector.begin() + position); test(); } void erase(Size first, Size last) { real_vector.erase(real_vector.begin() + first, real_vector.begin() + last); pre_vector.erase(pre_vector.begin() + first, pre_vector.begin() + last); test(); } void update(Size pos, const T& value) { real_vector[pos] = value; pre_vector[pos] = value; test(); } void push_back(const T& value) { real_vector.push_back(value); pre_vector.push_back(value); test(); } void pop_back() { real_vector.pop_back(); pre_vector.pop_back(); test(); } void clear() { real_vector.clear(); pre_vector.clear(); } void assign(Size n, const T& value) { real_vector.assign(n, value); pre_vector.assign(n, value); } Size size() { return real_vector.size(); } Size capacity() { return pre_vector.capacity(); } void shrink_to_fit() { pre_vector.shrink_to_fit(); test(); } void swap() { real_vector.swap(real_vector_alt); pre_vector.swap(pre_vector_alt); test(); } ~prevector_tester() { BOOST_CHECK_MESSAGE(passed, "insecure_rand: " + rand_seed.ToString()); } prevector_tester() { seed_insecure_rand(); rand_seed = insecure_rand_seed; rand_cache = insecure_rand_ctx; } }; BOOST_AUTO_TEST_CASE(PrevectorTestInt) { for (int j = 0; j < 64; j++) { prevector_tester<8, int> test; for (int i = 0; i < 2048; i++) { int r = insecure_rand(); if ((r % 4) == 0) { test.insert(insecure_rand() % (test.size() + 1), insecure_rand()); } if (test.size() > 0 && ((r >> 2) % 4) == 1) { test.erase(insecure_rand() % test.size()); } if (((r >> 4) % 8) == 2) { int new_size = std::max<int>(0, std::min<int>(30, test.size() + (insecure_rand() % 5) - 2)); test.resize(new_size); } if (((r >> 7) % 8) == 3) { test.insert(insecure_rand() % (test.size() + 1), 1 + (insecure_rand() % 2), insecure_rand()); } if (((r >> 10) % 8) == 4) { int del = std::min<int>(test.size(), 1 + (insecure_rand() % 2)); int beg = insecure_rand() % (test.size() + 1 - del); test.erase(beg, beg + del); } if (((r >> 13) % 16) == 5) { test.push_back(insecure_rand()); } if (test.size() > 0 && ((r >> 17) % 16) == 6) { test.pop_back(); } if (((r >> 21) % 32) == 7) { int values[4]; int num = 1 + (insecure_rand() % 4); for (int i = 0; i < num; i++) { values[i] = insecure_rand(); } test.insert_range(insecure_rand() % (test.size() + 1), values, values + num); } if (((r >> 26) % 32) == 8) { int del = std::min<int>(test.size(), 1 + (insecure_rand() % 4)); int beg = insecure_rand() % (test.size() + 1 - del); test.erase(beg, beg + del); } r = insecure_rand(); if (r % 32 == 9) { test.reserve(insecure_rand() % 32); } if ((r >> 5) % 64 == 10) { test.shrink_to_fit(); } if (test.size() > 0) { test.update(insecure_rand() % test.size(), insecure_rand()); } if (((r >> 11) % 1024) == 11) { test.clear(); } if (((r >> 21) % 512) == 12) { test.assign(insecure_rand() % 32, insecure_rand()); } if (((r >> 15) % 64) == 3) { test.swap(); } } } } BOOST_AUTO_TEST_SUITE_END()
/* * ****************************************************************** * * Copyright 2015 Intel Corporation. * * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */ #include "JniOcRequestHandle.h" JniOcRequestHandle::JniOcRequestHandle(OCRequestHandle requestHandle) : m_requestHandle(requestHandle) { } JniOcRequestHandle::~JniOcRequestHandle() { LOGD("~JniOcRequestHandle()"); } JniOcRequestHandle* JniOcRequestHandle::getJniOcRequestHandlePtr (JNIEnv *env, jobject thiz) { JniOcRequestHandle *handle = GetHandle<JniOcRequestHandle>(env, thiz); if (env->ExceptionCheck()) { LOGE("Failed to get native handle from OcRequestHandle"); } if (!handle) { ThrowOcException(JNI_NO_NATIVE_POINTER, ""); } return handle; } OCRequestHandle JniOcRequestHandle::getOCRequestHandle() { return this->m_requestHandle; } /* * Class: org_iotivity_base_OcRequestHandle * Method: dispose * Signature: ()V */ JNIEXPORT void JNICALL Java_org_iotivity_base_OcRequestHandle_dispose (JNIEnv *env, jobject thiz) { LOGD("OcRequestHandle_dispose"); JniOcRequestHandle *handle = JniOcRequestHandle::getJniOcRequestHandlePtr(env, thiz); delete handle; }
// (C) Copyright Edward Diener 2011 // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). #include "test_mem_type.hpp" #include <boost/mpl/assert.hpp> int main() { BOOST_MPL_ASSERT((boost::tti::valid_member_type<BOOST_TTI_MEMBER_TYPE_GEN(AnIntType)<AType>::type>)); BOOST_MPL_ASSERT((boost::tti::valid_member_type<BOOST_TTI_MEMBER_TYPE_GEN(AnIntTypeReference)<AType>::type>)); BOOST_MPL_ASSERT((boost::tti::valid_member_type<BOOST_TTI_MEMBER_TYPE_GEN(BType)<AType>::type>)); BOOST_MPL_ASSERT((boost::tti::valid_member_type<TheInteger<AType::BType>::type>)); BOOST_MPL_ASSERT((boost::tti::valid_member_type<BOOST_TTI_MEMBER_TYPE_GEN(AnotherIntegerType)<AType::BType::CType>::type>)); BOOST_MPL_ASSERT((boost::tti::valid_member_type<SomethingElse<AnotherType>::type>)); BOOST_MPL_ASSERT((boost::tti::valid_member_type<NameStruct<AType,MarkerType>::type,NameStruct<AType,MarkerType>::boost_tti_marker_type>)); BOOST_MPL_ASSERT((boost::tti::valid_member_type<BOOST_TTI_MEMBER_TYPE_GEN(CType)<AType::BType,MarkerType>::type,BOOST_TTI_MEMBER_TYPE_GEN(CType)<AType::BType,MarkerType>::boost_tti_marker_type>)); BOOST_MPL_ASSERT_NOT((boost::tti::valid_member_type<BOOST_TTI_MEMBER_TYPE_GEN(BType)<AnotherType>::type>)); BOOST_MPL_ASSERT_NOT((boost::tti::valid_member_type<BOOST_TTI_MEMBER_TYPE_GEN(NoExistType)<AType,MarkerType>::type,BOOST_TTI_MEMBER_TYPE_GEN(NoExistType)<AType,MarkerType>::boost_tti_marker_type>)); return 0; }
// Copyright 2004-present Facebook. All Rights Reserved. #include "src/NullRequestHandler.h" namespace reactivesocket { template class NullSubscriberT<Payload>; void NullSubscription::request(size_t /*n*/) noexcept {} void NullSubscription::cancel() noexcept {} std::shared_ptr<Subscriber<Payload>> NullRequestHandler::handleRequestChannel( Payload /*request*/, StreamId /*streamId*/, const std::shared_ptr<Subscriber<Payload>>& response) noexcept { // TODO(lehecka): get rid of onSubscribe call response->onSubscribe(std::make_shared<NullSubscription>()); response->onError(std::runtime_error("NullRequestHandler")); return std::make_shared<NullSubscriber>(); } void NullRequestHandler::handleRequestStream( Payload /*request*/, StreamId /*streamId*/, const std::shared_ptr<Subscriber<Payload>>& response) noexcept { // TODO(lehecka): get rid of onSubscribe call response->onSubscribe(std::make_shared<NullSubscription>()); response->onError(std::runtime_error("NullRequestHandler")); } void NullRequestHandler::handleRequestSubscription( Payload /*request*/, StreamId /*streamId*/, const std::shared_ptr<Subscriber<Payload>>& response) noexcept { // TODO(lehecka): get rid of onSubscribe call response->onSubscribe(std::make_shared<NullSubscription>()); response->onError(std::runtime_error("NullRequestHandler")); } void NullRequestHandler::handleRequestResponse( Payload /*request*/, StreamId /*streamId*/, const std::shared_ptr<Subscriber<Payload>>& response) noexcept { response->onSubscribe(std::make_shared<NullSubscription>()); response->onError(std::runtime_error("NullRequestHandler")); } void NullRequestHandler::handleFireAndForgetRequest( Payload /*request*/, StreamId /*streamId*/) noexcept {} void NullRequestHandler::handleMetadataPush( std::unique_ptr<folly::IOBuf> /*request*/) noexcept {} std::shared_ptr<StreamState> NullRequestHandler::handleSetupPayload( ReactiveSocket& socket, ConnectionSetupPayload /*request*/) noexcept { return nullptr; } bool NullRequestHandler::handleResume( ReactiveSocket& socket, const ResumeIdentificationToken& /*token*/, ResumePosition /*position*/) noexcept { return false; } void NullRequestHandler::handleCleanResume( std::shared_ptr<Subscription> /* response */) noexcept {} void NullRequestHandler::handleDirtyResume( std::shared_ptr<Subscription> /* response */) noexcept {} void NullRequestHandler::onSubscriptionPaused( const std::shared_ptr<Subscription>&) noexcept {} void NullRequestHandler::onSubscriptionResumed( const std::shared_ptr<Subscription>&) noexcept {} void NullRequestHandler::onSubscriberPaused( const std::shared_ptr<Subscriber<Payload>>&) noexcept {} void NullRequestHandler::onSubscriberResumed( const std::shared_ptr<Subscriber<Payload>>&) noexcept {} } // reactivesocket
#pragma once #include "../../dc/model_if.hpp" #include "../../dc/qm_fixed.hpp" #include "../../dc/bbox.hpp" namespace rev::gltf::v2 { struct IGLTFMesh; using HGMesh = std::shared_ptr<IGLTFMesh>; class Scene; class GLTFModel : public dc::IModel { private: using MeshV = std::vector<HGMesh>; MeshV _mesh, _skinmesh; HTf _tf; mutable dc::BSphere_Op _bsphere; mutable dc::QM_Fixed _qm; public: static HMdl FromScene(const Scene& s); GLTFModel(const MeshV& mesh, const MeshV& skinmesh, const HTf& tf); void draw(IEffect& e) const override; HTf getNode() const override; dc::BSphere_Op getBSphere() const override; DEF_DEBUGGUI_NAME DEF_DEBUGGUI_PROP }; }
// Copyright (c) 2011-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Copyright (c) 2019 The ERPcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "overviewpage.h" #include "ui_overviewpage.h" #include "bitcoinunits.h" #include "clientmodel.h" #include "guiconstants.h" #include "guiutil.h" #include "init.h" #include "optionsmodel.h" #include "platformstyle.h" #include "transactionfilterproxy.h" #include "transactiontablemodel.h" #include "utilitydialog.h" #include "walletmodel.h" #include "instantx.h" #include "darksendconfig.h" #include "masternode-sync.h" #include "privatesend-client.h" #include <QAbstractItemDelegate> #include <QPainter> #include <QSettings> #include <QTimer> #define ICON_OFFSET 16 #define DECORATION_SIZE 54 #define NUM_ITEMS 5 #define NUM_ITEMS_ADV 7 class TxViewDelegate : public QAbstractItemDelegate { Q_OBJECT public: TxViewDelegate(const PlatformStyle *_platformStyle, QObject *parent=nullptr): QAbstractItemDelegate(), unit(BitcoinUnits::ERP), platformStyle(_platformStyle) { } inline void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const { painter->save(); QIcon icon = qvariant_cast<QIcon>(index.data(TransactionTableModel::RawDecorationRole)); QRect mainRect = option.rect; mainRect.moveLeft(ICON_OFFSET); QRect decorationRect(mainRect.topLeft(), QSize(DECORATION_SIZE, DECORATION_SIZE)); int xspace = DECORATION_SIZE + 8; int ypad = 6; int halfheight = (mainRect.height() - 2*ypad)/2; QRect amountRect(mainRect.left() + xspace, mainRect.top()+ypad, mainRect.width() - xspace - ICON_OFFSET, halfheight); QRect addressRect(mainRect.left() + xspace, mainRect.top()+ypad+halfheight, mainRect.width() - xspace, halfheight); icon = platformStyle->SingleColorIcon(icon); icon.paint(painter, decorationRect); QDateTime date = index.data(TransactionTableModel::DateRole).toDateTime(); QString address = index.data(Qt::DisplayRole).toString(); qint64 amount = index.data(TransactionTableModel::AmountRole).toLongLong(); bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool(); QVariant value = index.data(Qt::ForegroundRole); QColor foreground = option.palette.color(QPalette::Text); if(value.canConvert<QBrush>()) { QBrush brush = qvariant_cast<QBrush>(value); foreground = brush.color(); } painter->setPen(foreground); QRect boundingRect; painter->drawText(addressRect, Qt::AlignLeft|Qt::AlignVCenter, address, &boundingRect); if (index.data(TransactionTableModel::WatchonlyRole).toBool()) { QIcon iconWatchonly = qvariant_cast<QIcon>(index.data(TransactionTableModel::WatchonlyDecorationRole)); QRect watchonlyRect(boundingRect.right() + 5, mainRect.top()+ypad+halfheight, 16, halfheight); iconWatchonly.paint(painter, watchonlyRect); } if(amount < 0) { foreground = COLOR_NEGATIVE; } else if(!confirmed) { foreground = COLOR_UNCONFIRMED; } else { foreground = option.palette.color(QPalette::Text); } painter->setPen(foreground); QString amountText = BitcoinUnits::floorWithUnit(unit, amount, true, BitcoinUnits::separatorAlways); if(!confirmed) { amountText = QString("[") + amountText + QString("]"); } painter->drawText(amountRect, Qt::AlignRight|Qt::AlignVCenter, amountText); painter->setPen(option.palette.color(QPalette::Text)); painter->drawText(amountRect, Qt::AlignLeft|Qt::AlignVCenter, GUIUtil::dateTimeStr(date)); painter->restore(); } inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { return QSize(DECORATION_SIZE, DECORATION_SIZE); } int unit; const PlatformStyle *platformStyle; }; #include "overviewpage.moc" OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent) : QWidget(parent), timer(nullptr), ui(new Ui::OverviewPage), clientModel(0), walletModel(0), currentBalance(-1), currentUnconfirmedBalance(-1), currentImmatureBalance(-1), currentWatchOnlyBalance(-1), currentWatchUnconfBalance(-1), currentWatchImmatureBalance(-1), txdelegate(new TxViewDelegate(platformStyle, this)) { ui->setupUi(this); QString theme = GUIUtil::getThemeName(); // Recent transactions ui->listTransactions->setItemDelegate(txdelegate); ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE)); // Note: minimum height of listTransactions will be set later in updateAdvancedPSUI() to reflect actual settings ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false); connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex))); // init "out of sync" warning labels ui->labelWalletStatus->setText("(" + tr("out of sync") + ")"); ui->labelPrivateSendSyncStatus->setText("(" + tr("out of sync") + ")"); ui->labelTransactionsStatus->setText("(" + tr("out of sync") + ")"); // hide PS frame (helps to preserve saved size) // we'll setup and make it visible in updateAdvancedPSUI() later if we are not in litemode ui->framePrivateSend->setVisible(false); // start with displaying the "out of sync" warnings showOutOfSyncWarning(true); // that's it for litemode if(fLiteMode) return; // Disable any PS UI for masternode or when autobackup is disabled or failed for whatever reason if(fMasternodeMode || nWalletBackups <= 0){ DisablePrivateSendCompletely(); if (nWalletBackups <= 0) { ui->labelPrivateSendEnabled->setToolTip(tr("Automatic backups are disabled, no mixing available!")); } } else { if(!privateSendClient.fEnablePrivateSend){ ui->togglePrivateSend->setText(tr("Start Mixing")); } else { ui->togglePrivateSend->setText(tr("Stop Mixing")); } // Disable privateSendClient builtin support for automatic backups while we are in GUI, // we'll handle automatic backups and user warnings in privateSendStatus() privateSendClient.fCreateAutoBackups = false; timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(privateSendStatus())); timer->start(1000); } } void OverviewPage::handleTransactionClicked(const QModelIndex &index) { if(filter) Q_EMIT transactionClicked(filter->mapToSource(index)); } void OverviewPage::handleOutOfSyncWarningClicks() { Q_EMIT outOfSyncWarningClicked(); } OverviewPage::~OverviewPage() { if(timer) disconnect(timer, SIGNAL(timeout()), this, SLOT(privateSendStatus())); delete ui; } void OverviewPage::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& anonymizedBalance, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance) { currentBalance = balance; currentUnconfirmedBalance = unconfirmedBalance; currentImmatureBalance = immatureBalance; currentAnonymizedBalance = anonymizedBalance; currentWatchOnlyBalance = watchOnlyBalance; currentWatchUnconfBalance = watchUnconfBalance; currentWatchImmatureBalance = watchImmatureBalance; ui->labelBalance->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, balance, false, BitcoinUnits::separatorAlways)); ui->labelUnconfirmed->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, unconfirmedBalance, false, BitcoinUnits::separatorAlways)); ui->labelImmature->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, immatureBalance, false, BitcoinUnits::separatorAlways)); ui->labelAnonymized->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, anonymizedBalance, false, BitcoinUnits::separatorAlways)); ui->labelTotal->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, balance + unconfirmedBalance + immatureBalance, false, BitcoinUnits::separatorAlways)); ui->labelWatchAvailable->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, watchOnlyBalance, false, BitcoinUnits::separatorAlways)); ui->labelWatchPending->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, watchUnconfBalance, false, BitcoinUnits::separatorAlways)); ui->labelWatchImmature->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, watchImmatureBalance, false, BitcoinUnits::separatorAlways)); ui->labelWatchTotal->setText(BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, watchOnlyBalance + watchUnconfBalance + watchImmatureBalance, false, BitcoinUnits::separatorAlways)); // only show immature (newly mined) balance if it's non-zero, so as not to complicate things // for the non-mining users bool showImmature = immatureBalance != 0; bool showWatchOnlyImmature = watchImmatureBalance != 0; // for symmetry reasons also show immature label when the watch-only one is shown ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature); ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature); ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance updatePrivateSendProgress(); static int cachedTxLocks = 0; if(cachedTxLocks != nCompleteTXLocks){ cachedTxLocks = nCompleteTXLocks; ui->listTransactions->update(); } } // show/hide watch-only labels void OverviewPage::updateWatchOnlyLabels(bool showWatchOnly) { ui->labelSpendable->setVisible(showWatchOnly); // show spendable label (only when watch-only is active) ui->labelWatchonly->setVisible(showWatchOnly); // show watch-only label ui->lineWatchBalance->setVisible(showWatchOnly); // show watch-only balance separator line ui->labelWatchAvailable->setVisible(showWatchOnly); // show watch-only available balance ui->labelWatchPending->setVisible(showWatchOnly); // show watch-only pending balance ui->labelWatchTotal->setVisible(showWatchOnly); // show watch-only total balance if (!showWatchOnly){ ui->labelWatchImmature->hide(); } else{ ui->labelBalance->setIndent(20); ui->labelUnconfirmed->setIndent(20); ui->labelImmature->setIndent(20); ui->labelTotal->setIndent(20); } } void OverviewPage::setClientModel(ClientModel *model) { this->clientModel = model; if(model) { // Show warning if this is a prerelease version connect(model, SIGNAL(alertsChanged(QString)), this, SLOT(updateAlerts(QString))); updateAlerts(model->getStatusBarWarnings()); } } void OverviewPage::setWalletModel(WalletModel *model) { this->walletModel = model; if(model && model->getOptionsModel()) { // update the display unit, to not use the default ("ERP") updateDisplayUnit(); // Keep up to date with wallet setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getAnonymizedBalance(), model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance()); connect(model, SIGNAL(balanceChanged(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)), this, SLOT(setBalance(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount,CAmount))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); updateWatchOnlyLabels(model->haveWatchOnly()); connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyLabels(bool))); // explicitly update PS frame and transaction list to reflect actual settings updateAdvancedPSUI(model->getOptionsModel()->getShowAdvancedPSUI()); // that's it for litemode if(fLiteMode) return; connect(model->getOptionsModel(), SIGNAL(privateSendRoundsChanged()), this, SLOT(updatePrivateSendProgress())); connect(model->getOptionsModel(), SIGNAL(privateSentAmountChanged()), this, SLOT(updatePrivateSendProgress())); connect(model->getOptionsModel(), SIGNAL(advancedPSUIChanged(bool)), this, SLOT(updateAdvancedPSUI(bool))); connect(ui->privateSendAuto, SIGNAL(clicked()), this, SLOT(privateSendAuto())); connect(ui->privateSendReset, SIGNAL(clicked()), this, SLOT(privateSendReset())); connect(ui->privateSendInfo, SIGNAL(clicked()), this, SLOT(privateSendInfo())); connect(ui->togglePrivateSend, SIGNAL(clicked()), this, SLOT(togglePrivateSend())); // privatesend buttons will not react to spacebar must be clicked on ui->privateSendAuto->setFocusPolicy(Qt::NoFocus); ui->privateSendReset->setFocusPolicy(Qt::NoFocus); ui->privateSendInfo->setFocusPolicy(Qt::NoFocus); ui->togglePrivateSend->setFocusPolicy(Qt::NoFocus); } } void OverviewPage::updateDisplayUnit() { if(walletModel && walletModel->getOptionsModel()) { nDisplayUnit = walletModel->getOptionsModel()->getDisplayUnit(); if(currentBalance != -1) setBalance(currentBalance, currentUnconfirmedBalance, currentImmatureBalance, currentAnonymizedBalance, currentWatchOnlyBalance, currentWatchUnconfBalance, currentWatchImmatureBalance); // Update txdelegate->unit with the current unit txdelegate->unit = nDisplayUnit; ui->listTransactions->update(); } } void OverviewPage::updateAlerts(const QString &warnings) { this->ui->labelAlerts->setVisible(!warnings.isEmpty()); this->ui->labelAlerts->setText(warnings); } void OverviewPage::showOutOfSyncWarning(bool fShow) { ui->labelWalletStatus->setVisible(fShow); ui->labelPrivateSendSyncStatus->setVisible(fShow); ui->labelTransactionsStatus->setVisible(fShow); } void OverviewPage::updatePrivateSendProgress() { if(!masternodeSync.IsBlockchainSynced() || ShutdownRequested()) return; if(!pwalletMain) return; QString strAmountAndRounds; QString strPrivateSendAmount = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, privateSendClient.nPrivateSendAmount * COIN, false, BitcoinUnits::separatorAlways); if(currentBalance == 0) { ui->privateSendProgress->setValue(0); ui->privateSendProgress->setToolTip(tr("No inputs detected")); // when balance is zero just show info from settings strPrivateSendAmount = strPrivateSendAmount.remove(strPrivateSendAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); strAmountAndRounds = strPrivateSendAmount + " / " + tr("%n Rounds", "", privateSendClient.nPrivateSendRounds); ui->labelAmountRounds->setToolTip(tr("No inputs detected")); ui->labelAmountRounds->setText(strAmountAndRounds); return; } CAmount nAnonymizableBalance = pwalletMain->GetAnonymizableBalance(false, false); CAmount nMaxToAnonymize = nAnonymizableBalance + currentAnonymizedBalance; // If it's more than the anon threshold, limit to that. if(nMaxToAnonymize > privateSendClient.nPrivateSendAmount*COIN) nMaxToAnonymize = privateSendClient.nPrivateSendAmount*COIN; if(nMaxToAnonymize == 0) return; if(nMaxToAnonymize >= privateSendClient.nPrivateSendAmount * COIN) { ui->labelAmountRounds->setToolTip(tr("Found enough compatible inputs to anonymize %1") .arg(strPrivateSendAmount)); strPrivateSendAmount = strPrivateSendAmount.remove(strPrivateSendAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); strAmountAndRounds = strPrivateSendAmount + " / " + tr("%n Rounds", "", privateSendClient.nPrivateSendRounds); } else { QString strMaxToAnonymize = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nMaxToAnonymize, false, BitcoinUnits::separatorAlways); ui->labelAmountRounds->setToolTip(tr("Not enough compatible inputs to anonymize <span style='color:red;'>%1</span>,<br>" "will anonymize <span style='color:red;'>%2</span> instead") .arg(strPrivateSendAmount) .arg(strMaxToAnonymize)); strMaxToAnonymize = strMaxToAnonymize.remove(strMaxToAnonymize.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); strAmountAndRounds = "<span style='color:red;'>" + QString(BitcoinUnits::factor(nDisplayUnit) == 1 ? "" : "~") + strMaxToAnonymize + " / " + tr("%n Rounds", "", privateSendClient.nPrivateSendRounds) + "</span>"; } ui->labelAmountRounds->setText(strAmountAndRounds); if (!fShowAdvancedPSUI) return; CAmount nDenominatedConfirmedBalance; CAmount nDenominatedUnconfirmedBalance; CAmount nNormalizedAnonymizedBalance; float nAverageAnonymizedRounds; nDenominatedConfirmedBalance = pwalletMain->GetDenominatedBalance(); nDenominatedUnconfirmedBalance = pwalletMain->GetDenominatedBalance(true); nNormalizedAnonymizedBalance = pwalletMain->GetNormalizedAnonymizedBalance(); nAverageAnonymizedRounds = pwalletMain->GetAverageAnonymizedRounds(); // calculate parts of the progress, each of them shouldn't be higher than 1 // progress of denominating float denomPart = 0; // mixing progress of denominated balance float anonNormPart = 0; // completeness of full amount anonymization float anonFullPart = 0; CAmount denominatedBalance = nDenominatedConfirmedBalance + nDenominatedUnconfirmedBalance; denomPart = (float)denominatedBalance / nMaxToAnonymize; denomPart = denomPart > 1 ? 1 : denomPart; denomPart *= 100; anonNormPart = (float)nNormalizedAnonymizedBalance / nMaxToAnonymize; anonNormPart = anonNormPart > 1 ? 1 : anonNormPart; anonNormPart *= 100; anonFullPart = (float)currentAnonymizedBalance / nMaxToAnonymize; anonFullPart = anonFullPart > 1 ? 1 : anonFullPart; anonFullPart *= 100; // apply some weights to them ... float denomWeight = 1; float anonNormWeight = privateSendClient.nPrivateSendRounds; float anonFullWeight = 2; float fullWeight = denomWeight + anonNormWeight + anonFullWeight; // ... and calculate the whole progress float denomPartCalc = ceilf((denomPart * denomWeight / fullWeight) * 100) / 100; float anonNormPartCalc = ceilf((anonNormPart * anonNormWeight / fullWeight) * 100) / 100; float anonFullPartCalc = ceilf((anonFullPart * anonFullWeight / fullWeight) * 100) / 100; float progress = denomPartCalc + anonNormPartCalc + anonFullPartCalc; if(progress >= 100) progress = 100; ui->privateSendProgress->setValue(progress); QString strToolPip = ("<b>" + tr("Overall progress") + ": %1%</b><br/>" + tr("Denominated") + ": %2%<br/>" + tr("Mixed") + ": %3%<br/>" + tr("Anonymized") + ": %4%<br/>" + tr("Denominated inputs have %5 of %n rounds on average", "", privateSendClient.nPrivateSendRounds)) .arg(progress).arg(denomPart).arg(anonNormPart).arg(anonFullPart) .arg(nAverageAnonymizedRounds); ui->privateSendProgress->setToolTip(strToolPip); } void OverviewPage::updateAdvancedPSUI(bool fShowAdvancedPSUI) { this->fShowAdvancedPSUI = fShowAdvancedPSUI; int nNumItems = (fLiteMode || !fShowAdvancedPSUI) ? NUM_ITEMS : NUM_ITEMS_ADV; SetupTransactionList(nNumItems); if (fLiteMode) return; ui->framePrivateSend->setVisible(true); ui->labelCompletitionText->setVisible(fShowAdvancedPSUI); ui->privateSendProgress->setVisible(fShowAdvancedPSUI); ui->labelSubmittedDenomText->setVisible(fShowAdvancedPSUI); ui->labelSubmittedDenom->setVisible(fShowAdvancedPSUI); ui->privateSendAuto->setVisible(fShowAdvancedPSUI); ui->privateSendReset->setVisible(fShowAdvancedPSUI); ui->privateSendInfo->setVisible(true); ui->labelPrivateSendLastMessage->setVisible(fShowAdvancedPSUI); } void OverviewPage::privateSendStatus() { if(!masternodeSync.IsBlockchainSynced() || ShutdownRequested()) return; static int64_t nLastDSProgressBlockTime = 0; int nBestHeight = clientModel->getNumBlocks(); // We are processing more then 1 block per second, we'll just leave if(((nBestHeight - privateSendClient.nCachedNumBlocks) / (GetTimeMillis() - nLastDSProgressBlockTime + 1) > 1)) return; nLastDSProgressBlockTime = GetTimeMillis(); QString strKeysLeftText(tr("keys left: %1").arg(pwalletMain->nKeysLeftSinceAutoBackup)); if(pwalletMain->nKeysLeftSinceAutoBackup < PRIVATESEND_KEYS_THRESHOLD_WARNING) { strKeysLeftText = "<span style='color:red;'>" + strKeysLeftText + "</span>"; } ui->labelPrivateSendEnabled->setToolTip(strKeysLeftText); if (!privateSendClient.fEnablePrivateSend) { if (nBestHeight != privateSendClient.nCachedNumBlocks) { privateSendClient.nCachedNumBlocks = nBestHeight; updatePrivateSendProgress(); } ui->labelPrivateSendLastMessage->setText(""); ui->togglePrivateSend->setText(tr("Start Mixing")); QString strEnabled = tr("Disabled"); // Show how many keys left in advanced PS UI mode only if (fShowAdvancedPSUI) strEnabled += ", " + strKeysLeftText; ui->labelPrivateSendEnabled->setText(strEnabled); return; } // Warn user that wallet is running out of keys // NOTE: we do NOT warn user and do NOT create autobackups if mixing is not running if (nWalletBackups > 0 && pwalletMain->nKeysLeftSinceAutoBackup < PRIVATESEND_KEYS_THRESHOLD_WARNING) { QSettings settings; if(settings.value("fLowKeysWarning").toBool()) { QString strWarn = tr("Very low number of keys left since last automatic backup!") + "<br><br>" + tr("We are about to create a new automatic backup for you, however " "<span style='color:red;'> you should always make sure you have backups " "saved in some safe place</span>!") + "<br><br>" + tr("Note: You can turn this message off in options."); ui->labelPrivateSendEnabled->setToolTip(strWarn); LogPrintf("OverviewPage::privateSendStatus -- Very low number of keys left since last automatic backup, warning user and trying to create new backup...\n"); QMessageBox::warning(this, tr("PrivateSend"), strWarn, QMessageBox::Ok, QMessageBox::Ok); } else { LogPrintf("OverviewPage::privateSendStatus -- Very low number of keys left since last automatic backup, skipping warning and trying to create new backup...\n"); } std::string strBackupWarning; std::string strBackupError; if(!AutoBackupWallet(pwalletMain, "", strBackupWarning, strBackupError)) { if (!strBackupWarning.empty()) { // It's still more or less safe to continue but warn user anyway LogPrintf("OverviewPage::privateSendStatus -- WARNING! Something went wrong on automatic backup: %s\n", strBackupWarning); QMessageBox::warning(this, tr("PrivateSend"), tr("WARNING! Something went wrong on automatic backup") + ":<br><br>" + strBackupWarning.c_str(), QMessageBox::Ok, QMessageBox::Ok); } if (!strBackupError.empty()) { // Things are really broken, warn user and stop mixing immediately LogPrintf("OverviewPage::privateSendStatus -- ERROR! Failed to create automatic backup: %s\n", strBackupError); QMessageBox::warning(this, tr("PrivateSend"), tr("ERROR! Failed to create automatic backup") + ":<br><br>" + strBackupError.c_str() + "<br>" + tr("Mixing is disabled, please close your wallet and fix the issue!"), QMessageBox::Ok, QMessageBox::Ok); } } } QString strEnabled = privateSendClient.fEnablePrivateSend ? tr("Enabled") : tr("Disabled"); // Show how many keys left in advanced PS UI mode only if(fShowAdvancedPSUI) strEnabled += ", " + strKeysLeftText; ui->labelPrivateSendEnabled->setText(strEnabled); if(nWalletBackups == -1) { // Automatic backup failed, nothing else we can do until user fixes the issue manually DisablePrivateSendCompletely(); QString strError = tr("ERROR! Failed to create automatic backup") + ", " + tr("see debug.log for details.") + "<br><br>" + tr("Mixing is disabled, please close your wallet and fix the issue!"); ui->labelPrivateSendEnabled->setToolTip(strError); return; } else if(nWalletBackups == -2) { // We were able to create automatic backup but keypool was not replenished because wallet is locked. QString strWarning = tr("WARNING! Failed to replenish keypool, please unlock your wallet to do so."); ui->labelPrivateSendEnabled->setToolTip(strWarning); } // check darksend status and unlock if needed if(nBestHeight != privateSendClient.nCachedNumBlocks) { // Balance and number of transactions might have changed privateSendClient.nCachedNumBlocks = nBestHeight; updatePrivateSendProgress(); } QString strStatus = QString(privateSendClient.GetStatus().c_str()); QString s = tr("Last PrivateSend message:\n") + strStatus; if(s != ui->labelPrivateSendLastMessage->text()) LogPrintf("OverviewPage::privateSendStatus -- Last PrivateSend message: %s\n", strStatus.toStdString()); ui->labelPrivateSendLastMessage->setText(s); if(privateSendClient.nSessionDenom == 0){ ui->labelSubmittedDenom->setText(tr("N/A")); } else { QString strDenom(CPrivateSend::GetDenominationsToString(privateSendClient.nSessionDenom).c_str()); ui->labelSubmittedDenom->setText(strDenom); } } void OverviewPage::privateSendAuto(){ privateSendClient.DoAutomaticDenominating(*g_connman); } void OverviewPage::privateSendReset(){ privateSendClient.ResetPool(); QMessageBox::warning(this, tr("PrivateSend"), tr("PrivateSend was successfully reset."), QMessageBox::Ok, QMessageBox::Ok); } void OverviewPage::privateSendInfo(){ HelpMessageDialog dlg(this, HelpMessageDialog::pshelp); dlg.exec(); } void OverviewPage::togglePrivateSend(){ QSettings settings; // Popup some information on first mixing QString hasMixed = settings.value("hasMixed").toString(); if(hasMixed.isEmpty()){ QMessageBox::information(this, tr("PrivateSend"), tr("If you don't want to see internal PrivateSend fees/transactions select \"Most Common\" as Type on the \"Transactions\" tab."), QMessageBox::Ok, QMessageBox::Ok); settings.setValue("hasMixed", "hasMixed"); } if(!privateSendClient.fEnablePrivateSend){ const CAmount nMinAmount = CPrivateSend::GetSmallestDenomination() + CPrivateSend::GetMaxCollateralAmount(); if(currentBalance < nMinAmount){ QString strMinAmount(BitcoinUnits::formatWithUnit(nDisplayUnit, nMinAmount)); QMessageBox::warning(this, tr("PrivateSend"), tr("PrivateSend requires at least %1 to use.").arg(strMinAmount), QMessageBox::Ok, QMessageBox::Ok); return; } // if wallet is locked, ask for a passphrase if (walletModel->getEncryptionStatus() == WalletModel::Locked) { WalletModel::UnlockContext ctx(walletModel->requestUnlock(true)); if(!ctx.isValid()) { //unlock was cancelled privateSendClient.nCachedNumBlocks = std::numeric_limits<int>::max(); QMessageBox::warning(this, tr("PrivateSend"), tr("Wallet is locked and user declined to unlock. Disabling PrivateSend."), QMessageBox::Ok, QMessageBox::Ok); LogPrint("privatesend", "OverviewPage::togglePrivateSend -- Wallet is locked and user declined to unlock. Disabling PrivateSend.\n"); return; } } } privateSendClient.fEnablePrivateSend = !privateSendClient.fEnablePrivateSend; privateSendClient.nCachedNumBlocks = std::numeric_limits<int>::max(); if(!privateSendClient.fEnablePrivateSend){ ui->togglePrivateSend->setText(tr("Start Mixing")); privateSendClient.UnlockCoins(); } else { ui->togglePrivateSend->setText(tr("Stop Mixing")); /* show darksend configuration if client has defaults set */ if(privateSendClient.nPrivateSendAmount == 0){ DarksendConfig dlg(this); dlg.setModel(walletModel); dlg.exec(); } } } void OverviewPage::SetupTransactionList(int nNumItems) { ui->listTransactions->setMinimumHeight(nNumItems * (DECORATION_SIZE + 2)); if(walletModel && walletModel->getOptionsModel()) { // Set up transaction list filter.reset(new TransactionFilterProxy()); filter->setSourceModel(walletModel->getTransactionTableModel()); filter->setLimit(nNumItems); filter->setDynamicSortFilter(true); filter->setSortRole(Qt::EditRole); filter->setShowInactive(false); filter->sort(TransactionTableModel::Date, Qt::DescendingOrder); ui->listTransactions->setModel(filter.get()); ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress); } } void OverviewPage::DisablePrivateSendCompletely() { ui->togglePrivateSend->setText("(" + tr("Disabled") + ")"); ui->privateSendAuto->setText("(" + tr("Disabled") + ")"); ui->privateSendReset->setText("(" + tr("Disabled") + ")"); ui->framePrivateSend->setEnabled(false); if (nWalletBackups <= 0) { ui->labelPrivateSendEnabled->setText("<span style='color:red;'>(" + tr("Disabled") + ")</span>"); } privateSendClient.fEnablePrivateSend = false; }
/*************************************************************************** * Copyright (C) 2005 by * * Alejandro Perez Mendez alex@um.es * * Pedro J. Fernandez Ruiz pedroj@um.es * * * * This software may be modified and distributed under the terms * * of the Apache license. See the LICENSE file for details. * ***************************************************************************/ #include "authgeneratorbtns.h" namespace openikev2 { AuthGeneratorBtns::AuthGeneratorBtns( ) {} AuthGeneratorBtns::~AuthGeneratorBtns( ) {} auto_ptr< AuthGenerator > AuthGeneratorBtns::clone() const { return auto_ptr<AuthGenerator> ( new AuthGeneratorBtns( ) ); } auto_ptr< Payload_AUTH > AuthGeneratorBtns::generateAuthPayload( const IkeSa& ike_sa ) { auto_ptr<ByteArray> auth_field (new ByteArray ("BTNS", 4) ); return auto_ptr<Payload_AUTH> ( new Payload_AUTH( (Enums::AUTH_METHOD) 201, auth_field ) ); } AutoVector<Payload_CERT> AuthGeneratorBtns::generateCertificatePayloads( const IkeSa& ike_sa, const vector< Payload_CERT_REQ * > payload_cert_req_r ) { AutoVector<Payload_CERT> result; return result; } string AuthGeneratorBtns::toStringTab( uint8_t tabs ) const { ostringstream oss; oss << Printable::generateTabs( tabs ) << "<AUTH_GENERATOR_BTNS> {\n"; oss << Printable::generateTabs( tabs ) << "}\n"; return oss.str(); } }
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: base_gcmessages.proto #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include "base_gcmessages.pb.h" #include <algorithm> #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/once.h> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/wire_format_lite_inl.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> // @@protoc_insertion_point(includes) namespace { const ::google::protobuf::Descriptor* CGCStorePurchaseInit_LineItem_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CGCStorePurchaseInit_LineItem_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCStorePurchaseInit_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCStorePurchaseInit_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCStorePurchaseInitResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCStorePurchaseInitResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgSystemBroadcast_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgSystemBroadcast_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgClientPingData_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgClientPingData_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgInviteToParty_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgInviteToParty_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgInviteToLobby_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgInviteToLobby_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgInvitationCreated_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgInvitationCreated_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgPartyInviteResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgPartyInviteResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgLobbyInviteResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgLobbyInviteResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgKickFromParty_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgKickFromParty_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgLeaveParty_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgLeaveParty_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgCustomGameInstallStatus_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgCustomGameInstallStatus_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgServerAvailable_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgServerAvailable_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgLANServerAvailable_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgLANServerAvailable_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconGameAccountClient_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconGameAccountClient_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOItemCriteriaCondition_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOItemCriteriaCondition_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOItemCriteria_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOItemCriteria_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOItemRecipe_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOItemRecipe_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgApplyStrangePart_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgApplyStrangePart_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgApplyPennantUpgrade_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgApplyPennantUpgrade_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgApplyEggEssence_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgApplyEggEssence_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconItemAttribute_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconItemAttribute_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconItemEquipped_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconItemEquipped_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconItem_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconItem_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgSortItems_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgSortItems_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconClaimCode_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconClaimCode_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgStoreGetUserData_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgStoreGetUserData_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgStoreGetUserDataResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgStoreGetUserDataResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgUpdateItemSchema_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgUpdateItemSchema_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCError_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCError_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgRequestInventoryRefresh_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgRequestInventoryRefresh_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgConVarValue_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgConVarValue_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgReplicateConVars_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgReplicateConVars_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgConsumableExhausted_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgConsumableExhausted_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgItemAcknowledged_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgItemAcknowledged_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgSetItemPositions_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgSetItemPositions_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgSetItemPositions_ItemPosition_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgSetItemPositions_ItemPosition_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCNameItemNotification_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCNameItemNotification_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCClientDisplayNotification_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCClientDisplayNotification_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCShowItemsPickedUp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCShowItemsPickedUp_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCIncrementKillCountResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCIncrementKillCountResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconItemDropRateBonus_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconItemDropRateBonus_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconItemLeagueViewPass_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconItemLeagueViewPass_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconItemEventTicket_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconItemEventTicket_reflection_ = NULL; const ::google::protobuf::Descriptor* CSOEconItemTournamentPassport_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CSOEconItemTournamentPassport_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCStorePurchaseCancel_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCStorePurchaseCancel_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCStorePurchaseCancelResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCStorePurchaseCancelResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCStorePurchaseFinalize_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCStorePurchaseFinalize_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCStorePurchaseFinalizeResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCStorePurchaseFinalizeResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCBannedWordListRequest_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCBannedWordListRequest_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCBannedWord_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCBannedWord_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCBannedWordListResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCBannedWordListResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCToGCBannedWordListBroadcast_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCToGCBannedWordListBroadcast_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCToGCBannedWordListUpdated_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCToGCBannedWordListUpdated_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCToGCDirtySDOCache_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCToGCDirtySDOCache_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCToGCDirtyMultipleSDOCache_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCToGCDirtyMultipleSDOCache_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCToGCApplyLocalizationDiff_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCToGCApplyLocalizationDiff_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCToGCApplyLocalizationDiffResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCToGCApplyLocalizationDiffResponse_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCCollectItem_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCCollectItem_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgSDONoMemcached_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgSDONoMemcached_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCToGCUpdateSQLKeyValue_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCToGCUpdateSQLKeyValue_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCServerVersionUpdated_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCServerVersionUpdated_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCClientVersionUpdated_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCClientVersionUpdated_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCToGCWebAPIAccountChanged_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCToGCWebAPIAccountChanged_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgRecipeComponent_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgRecipeComponent_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgFulfillDynamicRecipeComponent_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgFulfillDynamicRecipeComponent_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCClientMarketDataRequest_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCClientMarketDataRequest_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCClientMarketDataEntry_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCClientMarketDataEntry_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgGCClientMarketData_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgGCClientMarketData_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgExtractGems_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgExtractGems_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgExtractGemsResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgExtractGemsResponse_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* CMsgExtractGemsResponse_EExtractGems_descriptor_ = NULL; const ::google::protobuf::Descriptor* CMsgAddSocket_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgAddSocket_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgAddSocketResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgAddSocketResponse_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* CMsgAddSocketResponse_EAddSocket_descriptor_ = NULL; const ::google::protobuf::Descriptor* CMsgAddItemToSocketData_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgAddItemToSocketData_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgAddItemToSocket_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgAddItemToSocket_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgAddItemToSocketResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgAddItemToSocketResponse_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* CMsgAddItemToSocketResponse_EAddGem_descriptor_ = NULL; const ::google::protobuf::Descriptor* CMsgResetStrangeGemCount_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgResetStrangeGemCount_reflection_ = NULL; const ::google::protobuf::Descriptor* CMsgResetStrangeGemCountResponse_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CMsgResetStrangeGemCountResponse_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* CMsgResetStrangeGemCountResponse_EResetGem_descriptor_ = NULL; const ::google::protobuf::EnumDescriptor* EGCBaseMsg_descriptor_ = NULL; const ::google::protobuf::EnumDescriptor* EGCBaseProtoObjectTypes_descriptor_ = NULL; const ::google::protobuf::EnumDescriptor* ECustomGameInstallStatus_descriptor_ = NULL; const ::google::protobuf::EnumDescriptor* GC_BannedWordType_descriptor_ = NULL; } // namespace void protobuf_AssignDesc_base_5fgcmessages_2eproto() { protobuf_AddDesc_base_5fgcmessages_2eproto(); const ::google::protobuf::FileDescriptor* file = ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( "base_gcmessages.proto"); GOOGLE_CHECK(file != NULL); CGCStorePurchaseInit_LineItem_descriptor_ = file->message_type(0); static const int CGCStorePurchaseInit_LineItem_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGCStorePurchaseInit_LineItem, item_def_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGCStorePurchaseInit_LineItem, quantity_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGCStorePurchaseInit_LineItem, cost_in_local_currency_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGCStorePurchaseInit_LineItem, purchase_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGCStorePurchaseInit_LineItem, source_reference_id_), }; CGCStorePurchaseInit_LineItem_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CGCStorePurchaseInit_LineItem_descriptor_, CGCStorePurchaseInit_LineItem::default_instance_, CGCStorePurchaseInit_LineItem_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGCStorePurchaseInit_LineItem, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CGCStorePurchaseInit_LineItem, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CGCStorePurchaseInit_LineItem)); CMsgGCStorePurchaseInit_descriptor_ = file->message_type(1); static const int CMsgGCStorePurchaseInit_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInit, country_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInit, language_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInit, currency_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInit, line_items_), }; CMsgGCStorePurchaseInit_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCStorePurchaseInit_descriptor_, CMsgGCStorePurchaseInit::default_instance_, CMsgGCStorePurchaseInit_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInit, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInit, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCStorePurchaseInit)); CMsgGCStorePurchaseInitResponse_descriptor_ = file->message_type(2); static const int CMsgGCStorePurchaseInitResponse_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInitResponse, result_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInitResponse, txn_id_), }; CMsgGCStorePurchaseInitResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCStorePurchaseInitResponse_descriptor_, CMsgGCStorePurchaseInitResponse::default_instance_, CMsgGCStorePurchaseInitResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInitResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseInitResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCStorePurchaseInitResponse)); CMsgSystemBroadcast_descriptor_ = file->message_type(3); static const int CMsgSystemBroadcast_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSystemBroadcast, message_), }; CMsgSystemBroadcast_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgSystemBroadcast_descriptor_, CMsgSystemBroadcast::default_instance_, CMsgSystemBroadcast_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSystemBroadcast, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSystemBroadcast, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgSystemBroadcast)); CMsgClientPingData_descriptor_ = file->message_type(4); static const int CMsgClientPingData_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgClientPingData, relay_codes_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgClientPingData, relay_pings_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgClientPingData, region_codes_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgClientPingData, region_pings_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgClientPingData, region_ping_failed_bitmask_), }; CMsgClientPingData_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgClientPingData_descriptor_, CMsgClientPingData::default_instance_, CMsgClientPingData_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgClientPingData, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgClientPingData, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgClientPingData)); CMsgInviteToParty_descriptor_ = file->message_type(5); static const int CMsgInviteToParty_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToParty, steam_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToParty, client_version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToParty, team_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToParty, as_coach_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToParty, ping_data_), }; CMsgInviteToParty_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgInviteToParty_descriptor_, CMsgInviteToParty::default_instance_, CMsgInviteToParty_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToParty, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToParty, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgInviteToParty)); CMsgInviteToLobby_descriptor_ = file->message_type(6); static const int CMsgInviteToLobby_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToLobby, steam_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToLobby, client_version_), }; CMsgInviteToLobby_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgInviteToLobby_descriptor_, CMsgInviteToLobby::default_instance_, CMsgInviteToLobby_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToLobby, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInviteToLobby, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgInviteToLobby)); CMsgInvitationCreated_descriptor_ = file->message_type(7); static const int CMsgInvitationCreated_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInvitationCreated, group_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInvitationCreated, steam_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInvitationCreated, user_offline_), }; CMsgInvitationCreated_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgInvitationCreated_descriptor_, CMsgInvitationCreated::default_instance_, CMsgInvitationCreated_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInvitationCreated, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgInvitationCreated, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgInvitationCreated)); CMsgPartyInviteResponse_descriptor_ = file->message_type(8); static const int CMsgPartyInviteResponse_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgPartyInviteResponse, party_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgPartyInviteResponse, accept_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgPartyInviteResponse, client_version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgPartyInviteResponse, ping_data_), }; CMsgPartyInviteResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgPartyInviteResponse_descriptor_, CMsgPartyInviteResponse::default_instance_, CMsgPartyInviteResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgPartyInviteResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgPartyInviteResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgPartyInviteResponse)); CMsgLobbyInviteResponse_descriptor_ = file->message_type(9); static const int CMsgLobbyInviteResponse_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLobbyInviteResponse, lobby_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLobbyInviteResponse, accept_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLobbyInviteResponse, client_version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLobbyInviteResponse, custom_game_crc_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLobbyInviteResponse, custom_game_timestamp_), }; CMsgLobbyInviteResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgLobbyInviteResponse_descriptor_, CMsgLobbyInviteResponse::default_instance_, CMsgLobbyInviteResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLobbyInviteResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLobbyInviteResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgLobbyInviteResponse)); CMsgKickFromParty_descriptor_ = file->message_type(10); static const int CMsgKickFromParty_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgKickFromParty, steam_id_), }; CMsgKickFromParty_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgKickFromParty_descriptor_, CMsgKickFromParty::default_instance_, CMsgKickFromParty_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgKickFromParty, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgKickFromParty, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgKickFromParty)); CMsgLeaveParty_descriptor_ = file->message_type(11); static const int CMsgLeaveParty_offsets_[1] = { }; CMsgLeaveParty_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgLeaveParty_descriptor_, CMsgLeaveParty::default_instance_, CMsgLeaveParty_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLeaveParty, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLeaveParty, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgLeaveParty)); CMsgCustomGameInstallStatus_descriptor_ = file->message_type(12); static const int CMsgCustomGameInstallStatus_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgCustomGameInstallStatus, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgCustomGameInstallStatus, message_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgCustomGameInstallStatus, latest_timestamp_from_steam_), }; CMsgCustomGameInstallStatus_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgCustomGameInstallStatus_descriptor_, CMsgCustomGameInstallStatus::default_instance_, CMsgCustomGameInstallStatus_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgCustomGameInstallStatus, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgCustomGameInstallStatus, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgCustomGameInstallStatus)); CMsgServerAvailable_descriptor_ = file->message_type(13); static const int CMsgServerAvailable_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgServerAvailable, custom_game_install_status_), }; CMsgServerAvailable_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgServerAvailable_descriptor_, CMsgServerAvailable::default_instance_, CMsgServerAvailable_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgServerAvailable, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgServerAvailable, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgServerAvailable)); CMsgLANServerAvailable_descriptor_ = file->message_type(14); static const int CMsgLANServerAvailable_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLANServerAvailable, lobby_id_), }; CMsgLANServerAvailable_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgLANServerAvailable_descriptor_, CMsgLANServerAvailable::default_instance_, CMsgLANServerAvailable_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLANServerAvailable, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgLANServerAvailable, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgLANServerAvailable)); CSOEconGameAccountClient_descriptor_ = file->message_type(15); static const int CSOEconGameAccountClient_offsets_[8] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, additional_backpack_slots_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, trial_account_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, eligible_for_online_play_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, need_to_choose_most_helpful_friend_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, in_coaches_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, trade_ban_expiration_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, duel_ban_expiration_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, made_first_purchase_), }; CSOEconGameAccountClient_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconGameAccountClient_descriptor_, CSOEconGameAccountClient::default_instance_, CSOEconGameAccountClient_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconGameAccountClient, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconGameAccountClient)); CSOItemCriteriaCondition_descriptor_ = file->message_type(16); static const int CSOItemCriteriaCondition_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteriaCondition, op_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteriaCondition, field_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteriaCondition, required_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteriaCondition, float_value_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteriaCondition, string_value_), }; CSOItemCriteriaCondition_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOItemCriteriaCondition_descriptor_, CSOItemCriteriaCondition::default_instance_, CSOItemCriteriaCondition_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteriaCondition, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteriaCondition, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOItemCriteriaCondition)); CSOItemCriteria_descriptor_ = file->message_type(17); static const int CSOItemCriteria_offsets_[9] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, item_level_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, item_quality_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, item_level_set_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, item_quality_set_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, initial_inventory_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, initial_quantity_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, ignore_enabled_flag_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, conditions_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, recent_only_), }; CSOItemCriteria_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOItemCriteria_descriptor_, CSOItemCriteria::default_instance_, CSOItemCriteria_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemCriteria, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOItemCriteria)); CSOItemRecipe_descriptor_ = file->message_type(18); static const int CSOItemRecipe_offsets_[19] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, def_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, n_a_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, desc_inputs_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, desc_outputs_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, di_a_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, di_b_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, di_c_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, do_a_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, do_b_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, do_c_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, requires_all_same_class_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, requires_all_same_slot_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, class_usage_for_output_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, slot_usage_for_output_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, set_for_output_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, input_items_criteria_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, output_items_criteria_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, input_item_dupe_counts_), }; CSOItemRecipe_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOItemRecipe_descriptor_, CSOItemRecipe::default_instance_, CSOItemRecipe_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOItemRecipe, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOItemRecipe)); CMsgApplyStrangePart_descriptor_ = file->message_type(19); static const int CMsgApplyStrangePart_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyStrangePart, strange_part_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyStrangePart, item_item_id_), }; CMsgApplyStrangePart_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgApplyStrangePart_descriptor_, CMsgApplyStrangePart::default_instance_, CMsgApplyStrangePart_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyStrangePart, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyStrangePart, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgApplyStrangePart)); CMsgApplyPennantUpgrade_descriptor_ = file->message_type(20); static const int CMsgApplyPennantUpgrade_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyPennantUpgrade, upgrade_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyPennantUpgrade, pennant_item_id_), }; CMsgApplyPennantUpgrade_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgApplyPennantUpgrade_descriptor_, CMsgApplyPennantUpgrade::default_instance_, CMsgApplyPennantUpgrade_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyPennantUpgrade, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyPennantUpgrade, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgApplyPennantUpgrade)); CMsgApplyEggEssence_descriptor_ = file->message_type(21); static const int CMsgApplyEggEssence_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyEggEssence, essence_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyEggEssence, egg_item_id_), }; CMsgApplyEggEssence_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgApplyEggEssence_descriptor_, CMsgApplyEggEssence::default_instance_, CMsgApplyEggEssence_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyEggEssence, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgApplyEggEssence, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgApplyEggEssence)); CSOEconItemAttribute_descriptor_ = file->message_type(22); static const int CSOEconItemAttribute_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemAttribute, def_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemAttribute, value_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemAttribute, value_bytes_), }; CSOEconItemAttribute_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconItemAttribute_descriptor_, CSOEconItemAttribute::default_instance_, CSOEconItemAttribute_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemAttribute, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemAttribute, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconItemAttribute)); CSOEconItemEquipped_descriptor_ = file->message_type(23); static const int CSOEconItemEquipped_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEquipped, new_class_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEquipped, new_slot_), }; CSOEconItemEquipped_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconItemEquipped_descriptor_, CSOEconItemEquipped::default_instance_, CSOEconItemEquipped_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEquipped, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEquipped, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconItemEquipped)); CSOEconItem_descriptor_ = file->message_type(24); static const int CSOEconItem_offsets_[15] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, account_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, inventory_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, def_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, quantity_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, level_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, quality_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, flags_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, origin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, attribute_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, interior_item_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, in_use_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, style_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, original_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, equipped_state_), }; CSOEconItem_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconItem_descriptor_, CSOEconItem::default_instance_, CSOEconItem_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItem, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconItem)); CMsgSortItems_descriptor_ = file->message_type(25); static const int CMsgSortItems_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSortItems, sort_type_), }; CMsgSortItems_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgSortItems_descriptor_, CMsgSortItems::default_instance_, CMsgSortItems_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSortItems, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSortItems, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgSortItems)); CSOEconClaimCode_descriptor_ = file->message_type(26); static const int CSOEconClaimCode_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconClaimCode, account_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconClaimCode, code_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconClaimCode, time_acquired_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconClaimCode, code_), }; CSOEconClaimCode_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconClaimCode_descriptor_, CSOEconClaimCode::default_instance_, CSOEconClaimCode_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconClaimCode, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconClaimCode, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconClaimCode)); CMsgStoreGetUserData_descriptor_ = file->message_type(27); static const int CMsgStoreGetUserData_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserData, price_sheet_version_), }; CMsgStoreGetUserData_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgStoreGetUserData_descriptor_, CMsgStoreGetUserData::default_instance_, CMsgStoreGetUserData_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserData, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserData, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgStoreGetUserData)); CMsgStoreGetUserDataResponse_descriptor_ = file->message_type(28); static const int CMsgStoreGetUserDataResponse_offsets_[10] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, result_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, currency_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, country_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, price_sheet_version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, experiment_data_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, featured_item_idx_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, show_hat_descriptions_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, price_sheet_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, default_item_sort_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, popular_items_), }; CMsgStoreGetUserDataResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgStoreGetUserDataResponse_descriptor_, CMsgStoreGetUserDataResponse::default_instance_, CMsgStoreGetUserDataResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgStoreGetUserDataResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgStoreGetUserDataResponse)); CMsgUpdateItemSchema_descriptor_ = file->message_type(29); static const int CMsgUpdateItemSchema_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgUpdateItemSchema, items_game_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgUpdateItemSchema, item_schema_version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgUpdateItemSchema, items_game_url_), }; CMsgUpdateItemSchema_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgUpdateItemSchema_descriptor_, CMsgUpdateItemSchema::default_instance_, CMsgUpdateItemSchema_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgUpdateItemSchema, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgUpdateItemSchema, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgUpdateItemSchema)); CMsgGCError_descriptor_ = file->message_type(30); static const int CMsgGCError_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCError, error_text_), }; CMsgGCError_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCError_descriptor_, CMsgGCError::default_instance_, CMsgGCError_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCError, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCError, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCError)); CMsgRequestInventoryRefresh_descriptor_ = file->message_type(31); static const int CMsgRequestInventoryRefresh_offsets_[1] = { }; CMsgRequestInventoryRefresh_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgRequestInventoryRefresh_descriptor_, CMsgRequestInventoryRefresh::default_instance_, CMsgRequestInventoryRefresh_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgRequestInventoryRefresh, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgRequestInventoryRefresh, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgRequestInventoryRefresh)); CMsgConVarValue_descriptor_ = file->message_type(32); static const int CMsgConVarValue_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgConVarValue, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgConVarValue, value_), }; CMsgConVarValue_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgConVarValue_descriptor_, CMsgConVarValue::default_instance_, CMsgConVarValue_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgConVarValue, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgConVarValue, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgConVarValue)); CMsgReplicateConVars_descriptor_ = file->message_type(33); static const int CMsgReplicateConVars_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgReplicateConVars, convars_), }; CMsgReplicateConVars_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgReplicateConVars_descriptor_, CMsgReplicateConVars::default_instance_, CMsgReplicateConVars_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgReplicateConVars, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgReplicateConVars, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgReplicateConVars)); CMsgConsumableExhausted_descriptor_ = file->message_type(34); static const int CMsgConsumableExhausted_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgConsumableExhausted, item_def_id_), }; CMsgConsumableExhausted_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgConsumableExhausted_descriptor_, CMsgConsumableExhausted::default_instance_, CMsgConsumableExhausted_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgConsumableExhausted, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgConsumableExhausted, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgConsumableExhausted)); CMsgItemAcknowledged_descriptor_ = file->message_type(35); static const int CMsgItemAcknowledged_offsets_[6] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgItemAcknowledged, account_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgItemAcknowledged, inventory_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgItemAcknowledged, def_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgItemAcknowledged, quality_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgItemAcknowledged, rarity_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgItemAcknowledged, origin_), }; CMsgItemAcknowledged_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgItemAcknowledged_descriptor_, CMsgItemAcknowledged::default_instance_, CMsgItemAcknowledged_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgItemAcknowledged, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgItemAcknowledged, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgItemAcknowledged)); CMsgSetItemPositions_descriptor_ = file->message_type(36); static const int CMsgSetItemPositions_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSetItemPositions, item_positions_), }; CMsgSetItemPositions_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgSetItemPositions_descriptor_, CMsgSetItemPositions::default_instance_, CMsgSetItemPositions_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSetItemPositions, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSetItemPositions, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgSetItemPositions)); CMsgSetItemPositions_ItemPosition_descriptor_ = CMsgSetItemPositions_descriptor_->nested_type(0); static const int CMsgSetItemPositions_ItemPosition_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSetItemPositions_ItemPosition, item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSetItemPositions_ItemPosition, position_), }; CMsgSetItemPositions_ItemPosition_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgSetItemPositions_ItemPosition_descriptor_, CMsgSetItemPositions_ItemPosition::default_instance_, CMsgSetItemPositions_ItemPosition_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSetItemPositions_ItemPosition, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSetItemPositions_ItemPosition, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgSetItemPositions_ItemPosition)); CMsgGCNameItemNotification_descriptor_ = file->message_type(37); static const int CMsgGCNameItemNotification_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCNameItemNotification, player_steamid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCNameItemNotification, item_def_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCNameItemNotification, item_name_custom_), }; CMsgGCNameItemNotification_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCNameItemNotification_descriptor_, CMsgGCNameItemNotification::default_instance_, CMsgGCNameItemNotification_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCNameItemNotification, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCNameItemNotification, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCNameItemNotification)); CMsgGCClientDisplayNotification_descriptor_ = file->message_type(38); static const int CMsgGCClientDisplayNotification_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientDisplayNotification, notification_title_localization_key_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientDisplayNotification, notification_body_localization_key_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientDisplayNotification, body_substring_keys_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientDisplayNotification, body_substring_values_), }; CMsgGCClientDisplayNotification_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCClientDisplayNotification_descriptor_, CMsgGCClientDisplayNotification::default_instance_, CMsgGCClientDisplayNotification_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientDisplayNotification, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientDisplayNotification, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCClientDisplayNotification)); CMsgGCShowItemsPickedUp_descriptor_ = file->message_type(39); static const int CMsgGCShowItemsPickedUp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCShowItemsPickedUp, player_steamid_), }; CMsgGCShowItemsPickedUp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCShowItemsPickedUp_descriptor_, CMsgGCShowItemsPickedUp::default_instance_, CMsgGCShowItemsPickedUp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCShowItemsPickedUp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCShowItemsPickedUp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCShowItemsPickedUp)); CMsgGCIncrementKillCountResponse_descriptor_ = file->message_type(40); static const int CMsgGCIncrementKillCountResponse_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCIncrementKillCountResponse, killer_account_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCIncrementKillCountResponse, num_kills_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCIncrementKillCountResponse, item_def_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCIncrementKillCountResponse, level_type_), }; CMsgGCIncrementKillCountResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCIncrementKillCountResponse_descriptor_, CMsgGCIncrementKillCountResponse::default_instance_, CMsgGCIncrementKillCountResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCIncrementKillCountResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCIncrementKillCountResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCIncrementKillCountResponse)); CSOEconItemDropRateBonus_descriptor_ = file->message_type(41); static const int CSOEconItemDropRateBonus_offsets_[8] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, account_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, expiration_date_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, bonus_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, bonus_count_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, def_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, seconds_left_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, booster_type_), }; CSOEconItemDropRateBonus_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconItemDropRateBonus_descriptor_, CSOEconItemDropRateBonus::default_instance_, CSOEconItemDropRateBonus_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemDropRateBonus, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconItemDropRateBonus)); CSOEconItemLeagueViewPass_descriptor_ = file->message_type(42); static const int CSOEconItemLeagueViewPass_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemLeagueViewPass, account_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemLeagueViewPass, league_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemLeagueViewPass, itemindex_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemLeagueViewPass, grant_reason_), }; CSOEconItemLeagueViewPass_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconItemLeagueViewPass_descriptor_, CSOEconItemLeagueViewPass::default_instance_, CSOEconItemLeagueViewPass_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemLeagueViewPass, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemLeagueViewPass, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconItemLeagueViewPass)); CSOEconItemEventTicket_descriptor_ = file->message_type(43); static const int CSOEconItemEventTicket_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEventTicket, account_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEventTicket, event_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEventTicket, item_id_), }; CSOEconItemEventTicket_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconItemEventTicket_descriptor_, CSOEconItemEventTicket::default_instance_, CSOEconItemEventTicket_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEventTicket, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemEventTicket, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconItemEventTicket)); CSOEconItemTournamentPassport_descriptor_ = file->message_type(44); static const int CSOEconItemTournamentPassport_offsets_[8] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, account_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, league_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, original_purchaser_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, passports_bought_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, def_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, reward_flags_), }; CSOEconItemTournamentPassport_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CSOEconItemTournamentPassport_descriptor_, CSOEconItemTournamentPassport::default_instance_, CSOEconItemTournamentPassport_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CSOEconItemTournamentPassport, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CSOEconItemTournamentPassport)); CMsgGCStorePurchaseCancel_descriptor_ = file->message_type(45); static const int CMsgGCStorePurchaseCancel_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseCancel, txn_id_), }; CMsgGCStorePurchaseCancel_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCStorePurchaseCancel_descriptor_, CMsgGCStorePurchaseCancel::default_instance_, CMsgGCStorePurchaseCancel_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseCancel, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseCancel, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCStorePurchaseCancel)); CMsgGCStorePurchaseCancelResponse_descriptor_ = file->message_type(46); static const int CMsgGCStorePurchaseCancelResponse_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseCancelResponse, result_), }; CMsgGCStorePurchaseCancelResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCStorePurchaseCancelResponse_descriptor_, CMsgGCStorePurchaseCancelResponse::default_instance_, CMsgGCStorePurchaseCancelResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseCancelResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseCancelResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCStorePurchaseCancelResponse)); CMsgGCStorePurchaseFinalize_descriptor_ = file->message_type(47); static const int CMsgGCStorePurchaseFinalize_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseFinalize, txn_id_), }; CMsgGCStorePurchaseFinalize_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCStorePurchaseFinalize_descriptor_, CMsgGCStorePurchaseFinalize::default_instance_, CMsgGCStorePurchaseFinalize_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseFinalize, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseFinalize, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCStorePurchaseFinalize)); CMsgGCStorePurchaseFinalizeResponse_descriptor_ = file->message_type(48); static const int CMsgGCStorePurchaseFinalizeResponse_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseFinalizeResponse, result_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseFinalizeResponse, item_ids_), }; CMsgGCStorePurchaseFinalizeResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCStorePurchaseFinalizeResponse_descriptor_, CMsgGCStorePurchaseFinalizeResponse::default_instance_, CMsgGCStorePurchaseFinalizeResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseFinalizeResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCStorePurchaseFinalizeResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCStorePurchaseFinalizeResponse)); CMsgGCBannedWordListRequest_descriptor_ = file->message_type(49); static const int CMsgGCBannedWordListRequest_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWordListRequest, ban_list_group_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWordListRequest, word_id_), }; CMsgGCBannedWordListRequest_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCBannedWordListRequest_descriptor_, CMsgGCBannedWordListRequest::default_instance_, CMsgGCBannedWordListRequest_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWordListRequest, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWordListRequest, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCBannedWordListRequest)); CMsgGCBannedWord_descriptor_ = file->message_type(50); static const int CMsgGCBannedWord_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWord, word_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWord, word_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWord, word_), }; CMsgGCBannedWord_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCBannedWord_descriptor_, CMsgGCBannedWord::default_instance_, CMsgGCBannedWord_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWord, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWord, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCBannedWord)); CMsgGCBannedWordListResponse_descriptor_ = file->message_type(51); static const int CMsgGCBannedWordListResponse_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWordListResponse, ban_list_group_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWordListResponse, word_list_), }; CMsgGCBannedWordListResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCBannedWordListResponse_descriptor_, CMsgGCBannedWordListResponse::default_instance_, CMsgGCBannedWordListResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWordListResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCBannedWordListResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCBannedWordListResponse)); CMsgGCToGCBannedWordListBroadcast_descriptor_ = file->message_type(52); static const int CMsgGCToGCBannedWordListBroadcast_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCBannedWordListBroadcast, broadcast_), }; CMsgGCToGCBannedWordListBroadcast_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCToGCBannedWordListBroadcast_descriptor_, CMsgGCToGCBannedWordListBroadcast::default_instance_, CMsgGCToGCBannedWordListBroadcast_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCBannedWordListBroadcast, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCBannedWordListBroadcast, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCToGCBannedWordListBroadcast)); CMsgGCToGCBannedWordListUpdated_descriptor_ = file->message_type(53); static const int CMsgGCToGCBannedWordListUpdated_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCBannedWordListUpdated, group_id_), }; CMsgGCToGCBannedWordListUpdated_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCToGCBannedWordListUpdated_descriptor_, CMsgGCToGCBannedWordListUpdated::default_instance_, CMsgGCToGCBannedWordListUpdated_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCBannedWordListUpdated, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCBannedWordListUpdated, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCToGCBannedWordListUpdated)); CMsgGCToGCDirtySDOCache_descriptor_ = file->message_type(54); static const int CMsgGCToGCDirtySDOCache_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCDirtySDOCache, sdo_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCDirtySDOCache, key_uint64_), }; CMsgGCToGCDirtySDOCache_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCToGCDirtySDOCache_descriptor_, CMsgGCToGCDirtySDOCache::default_instance_, CMsgGCToGCDirtySDOCache_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCDirtySDOCache, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCDirtySDOCache, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCToGCDirtySDOCache)); CMsgGCToGCDirtyMultipleSDOCache_descriptor_ = file->message_type(55); static const int CMsgGCToGCDirtyMultipleSDOCache_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCDirtyMultipleSDOCache, sdo_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCDirtyMultipleSDOCache, key_uint64_), }; CMsgGCToGCDirtyMultipleSDOCache_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCToGCDirtyMultipleSDOCache_descriptor_, CMsgGCToGCDirtyMultipleSDOCache::default_instance_, CMsgGCToGCDirtyMultipleSDOCache_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCDirtyMultipleSDOCache, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCDirtyMultipleSDOCache, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCToGCDirtyMultipleSDOCache)); CMsgGCToGCApplyLocalizationDiff_descriptor_ = file->message_type(56); static const int CMsgGCToGCApplyLocalizationDiff_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCApplyLocalizationDiff, language_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCApplyLocalizationDiff, packed_diff_), }; CMsgGCToGCApplyLocalizationDiff_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCToGCApplyLocalizationDiff_descriptor_, CMsgGCToGCApplyLocalizationDiff::default_instance_, CMsgGCToGCApplyLocalizationDiff_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCApplyLocalizationDiff, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCApplyLocalizationDiff, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCToGCApplyLocalizationDiff)); CMsgGCToGCApplyLocalizationDiffResponse_descriptor_ = file->message_type(57); static const int CMsgGCToGCApplyLocalizationDiffResponse_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCApplyLocalizationDiffResponse, success_), }; CMsgGCToGCApplyLocalizationDiffResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCToGCApplyLocalizationDiffResponse_descriptor_, CMsgGCToGCApplyLocalizationDiffResponse::default_instance_, CMsgGCToGCApplyLocalizationDiffResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCApplyLocalizationDiffResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCApplyLocalizationDiffResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCToGCApplyLocalizationDiffResponse)); CMsgGCCollectItem_descriptor_ = file->message_type(58); static const int CMsgGCCollectItem_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCCollectItem, collection_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCCollectItem, subject_item_id_), }; CMsgGCCollectItem_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCCollectItem_descriptor_, CMsgGCCollectItem::default_instance_, CMsgGCCollectItem_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCCollectItem, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCCollectItem, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCCollectItem)); CMsgSDONoMemcached_descriptor_ = file->message_type(59); static const int CMsgSDONoMemcached_offsets_[1] = { }; CMsgSDONoMemcached_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgSDONoMemcached_descriptor_, CMsgSDONoMemcached::default_instance_, CMsgSDONoMemcached_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSDONoMemcached, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgSDONoMemcached, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgSDONoMemcached)); CMsgGCToGCUpdateSQLKeyValue_descriptor_ = file->message_type(60); static const int CMsgGCToGCUpdateSQLKeyValue_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCUpdateSQLKeyValue, key_name_), }; CMsgGCToGCUpdateSQLKeyValue_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCToGCUpdateSQLKeyValue_descriptor_, CMsgGCToGCUpdateSQLKeyValue::default_instance_, CMsgGCToGCUpdateSQLKeyValue_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCUpdateSQLKeyValue, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCUpdateSQLKeyValue, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCToGCUpdateSQLKeyValue)); CMsgGCServerVersionUpdated_descriptor_ = file->message_type(61); static const int CMsgGCServerVersionUpdated_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCServerVersionUpdated, server_version_), }; CMsgGCServerVersionUpdated_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCServerVersionUpdated_descriptor_, CMsgGCServerVersionUpdated::default_instance_, CMsgGCServerVersionUpdated_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCServerVersionUpdated, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCServerVersionUpdated, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCServerVersionUpdated)); CMsgGCClientVersionUpdated_descriptor_ = file->message_type(62); static const int CMsgGCClientVersionUpdated_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientVersionUpdated, client_version_), }; CMsgGCClientVersionUpdated_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCClientVersionUpdated_descriptor_, CMsgGCClientVersionUpdated::default_instance_, CMsgGCClientVersionUpdated_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientVersionUpdated, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientVersionUpdated, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCClientVersionUpdated)); CMsgGCToGCWebAPIAccountChanged_descriptor_ = file->message_type(63); static const int CMsgGCToGCWebAPIAccountChanged_offsets_[1] = { }; CMsgGCToGCWebAPIAccountChanged_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCToGCWebAPIAccountChanged_descriptor_, CMsgGCToGCWebAPIAccountChanged::default_instance_, CMsgGCToGCWebAPIAccountChanged_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCWebAPIAccountChanged, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCToGCWebAPIAccountChanged, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCToGCWebAPIAccountChanged)); CMsgRecipeComponent_descriptor_ = file->message_type(64); static const int CMsgRecipeComponent_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgRecipeComponent, subject_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgRecipeComponent, attribute_index_), }; CMsgRecipeComponent_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgRecipeComponent_descriptor_, CMsgRecipeComponent::default_instance_, CMsgRecipeComponent_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgRecipeComponent, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgRecipeComponent, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgRecipeComponent)); CMsgFulfillDynamicRecipeComponent_descriptor_ = file->message_type(65); static const int CMsgFulfillDynamicRecipeComponent_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgFulfillDynamicRecipeComponent, tool_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgFulfillDynamicRecipeComponent, consumption_components_), }; CMsgFulfillDynamicRecipeComponent_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgFulfillDynamicRecipeComponent_descriptor_, CMsgFulfillDynamicRecipeComponent::default_instance_, CMsgFulfillDynamicRecipeComponent_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgFulfillDynamicRecipeComponent, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgFulfillDynamicRecipeComponent, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgFulfillDynamicRecipeComponent)); CMsgGCClientMarketDataRequest_descriptor_ = file->message_type(66); static const int CMsgGCClientMarketDataRequest_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataRequest, user_currency_), }; CMsgGCClientMarketDataRequest_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCClientMarketDataRequest_descriptor_, CMsgGCClientMarketDataRequest::default_instance_, CMsgGCClientMarketDataRequest_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataRequest, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataRequest, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCClientMarketDataRequest)); CMsgGCClientMarketDataEntry_descriptor_ = file->message_type(67); static const int CMsgGCClientMarketDataEntry_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataEntry, item_def_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataEntry, item_quality_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataEntry, item_sell_listings_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataEntry, price_in_local_currency_), }; CMsgGCClientMarketDataEntry_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCClientMarketDataEntry_descriptor_, CMsgGCClientMarketDataEntry::default_instance_, CMsgGCClientMarketDataEntry_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataEntry, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketDataEntry, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCClientMarketDataEntry)); CMsgGCClientMarketData_descriptor_ = file->message_type(68); static const int CMsgGCClientMarketData_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketData, entries_), }; CMsgGCClientMarketData_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgGCClientMarketData_descriptor_, CMsgGCClientMarketData::default_instance_, CMsgGCClientMarketData_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketData, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgGCClientMarketData, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgGCClientMarketData)); CMsgExtractGems_descriptor_ = file->message_type(69); static const int CMsgExtractGems_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGems, tool_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGems, item_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGems, item_socket_id_), }; CMsgExtractGems_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgExtractGems_descriptor_, CMsgExtractGems::default_instance_, CMsgExtractGems_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGems, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGems, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgExtractGems)); CMsgExtractGemsResponse_descriptor_ = file->message_type(70); static const int CMsgExtractGemsResponse_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGemsResponse, item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGemsResponse, response_), }; CMsgExtractGemsResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgExtractGemsResponse_descriptor_, CMsgExtractGemsResponse::default_instance_, CMsgExtractGemsResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGemsResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgExtractGemsResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgExtractGemsResponse)); CMsgExtractGemsResponse_EExtractGems_descriptor_ = CMsgExtractGemsResponse_descriptor_->enum_type(0); CMsgAddSocket_descriptor_ = file->message_type(71); static const int CMsgAddSocket_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocket, tool_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocket, item_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocket, unusual_), }; CMsgAddSocket_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgAddSocket_descriptor_, CMsgAddSocket::default_instance_, CMsgAddSocket_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocket, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocket, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgAddSocket)); CMsgAddSocketResponse_descriptor_ = file->message_type(72); static const int CMsgAddSocketResponse_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocketResponse, item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocketResponse, updated_socket_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocketResponse, response_), }; CMsgAddSocketResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgAddSocketResponse_descriptor_, CMsgAddSocketResponse::default_instance_, CMsgAddSocketResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocketResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddSocketResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgAddSocketResponse)); CMsgAddSocketResponse_EAddSocket_descriptor_ = CMsgAddSocketResponse_descriptor_->enum_type(0); CMsgAddItemToSocketData_descriptor_ = file->message_type(73); static const int CMsgAddItemToSocketData_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketData, gem_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketData, socket_index_), }; CMsgAddItemToSocketData_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgAddItemToSocketData_descriptor_, CMsgAddItemToSocketData::default_instance_, CMsgAddItemToSocketData_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketData, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketData, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgAddItemToSocketData)); CMsgAddItemToSocket_descriptor_ = file->message_type(74); static const int CMsgAddItemToSocket_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocket, item_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocket, gems_to_socket_), }; CMsgAddItemToSocket_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgAddItemToSocket_descriptor_, CMsgAddItemToSocket::default_instance_, CMsgAddItemToSocket_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocket, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocket, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgAddItemToSocket)); CMsgAddItemToSocketResponse_descriptor_ = file->message_type(75); static const int CMsgAddItemToSocketResponse_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketResponse, item_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketResponse, updated_socket_index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketResponse, response_), }; CMsgAddItemToSocketResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgAddItemToSocketResponse_descriptor_, CMsgAddItemToSocketResponse::default_instance_, CMsgAddItemToSocketResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgAddItemToSocketResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgAddItemToSocketResponse)); CMsgAddItemToSocketResponse_EAddGem_descriptor_ = CMsgAddItemToSocketResponse_descriptor_->enum_type(0); CMsgResetStrangeGemCount_descriptor_ = file->message_type(76); static const int CMsgResetStrangeGemCount_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgResetStrangeGemCount, item_item_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgResetStrangeGemCount, socket_index_), }; CMsgResetStrangeGemCount_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgResetStrangeGemCount_descriptor_, CMsgResetStrangeGemCount::default_instance_, CMsgResetStrangeGemCount_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgResetStrangeGemCount, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgResetStrangeGemCount, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgResetStrangeGemCount)); CMsgResetStrangeGemCountResponse_descriptor_ = file->message_type(77); static const int CMsgResetStrangeGemCountResponse_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgResetStrangeGemCountResponse, response_), }; CMsgResetStrangeGemCountResponse_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CMsgResetStrangeGemCountResponse_descriptor_, CMsgResetStrangeGemCountResponse::default_instance_, CMsgResetStrangeGemCountResponse_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgResetStrangeGemCountResponse, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CMsgResetStrangeGemCountResponse, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CMsgResetStrangeGemCountResponse)); CMsgResetStrangeGemCountResponse_EResetGem_descriptor_ = CMsgResetStrangeGemCountResponse_descriptor_->enum_type(0); EGCBaseMsg_descriptor_ = file->enum_type(0); EGCBaseProtoObjectTypes_descriptor_ = file->enum_type(1); ECustomGameInstallStatus_descriptor_ = file->enum_type(2); GC_BannedWordType_descriptor_ = file->enum_type(3); } namespace { GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); inline void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, &protobuf_AssignDesc_base_5fgcmessages_2eproto); } void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CGCStorePurchaseInit_LineItem_descriptor_, &CGCStorePurchaseInit_LineItem::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCStorePurchaseInit_descriptor_, &CMsgGCStorePurchaseInit::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCStorePurchaseInitResponse_descriptor_, &CMsgGCStorePurchaseInitResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgSystemBroadcast_descriptor_, &CMsgSystemBroadcast::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgClientPingData_descriptor_, &CMsgClientPingData::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgInviteToParty_descriptor_, &CMsgInviteToParty::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgInviteToLobby_descriptor_, &CMsgInviteToLobby::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgInvitationCreated_descriptor_, &CMsgInvitationCreated::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgPartyInviteResponse_descriptor_, &CMsgPartyInviteResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgLobbyInviteResponse_descriptor_, &CMsgLobbyInviteResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgKickFromParty_descriptor_, &CMsgKickFromParty::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgLeaveParty_descriptor_, &CMsgLeaveParty::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgCustomGameInstallStatus_descriptor_, &CMsgCustomGameInstallStatus::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgServerAvailable_descriptor_, &CMsgServerAvailable::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgLANServerAvailable_descriptor_, &CMsgLANServerAvailable::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconGameAccountClient_descriptor_, &CSOEconGameAccountClient::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOItemCriteriaCondition_descriptor_, &CSOItemCriteriaCondition::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOItemCriteria_descriptor_, &CSOItemCriteria::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOItemRecipe_descriptor_, &CSOItemRecipe::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgApplyStrangePart_descriptor_, &CMsgApplyStrangePart::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgApplyPennantUpgrade_descriptor_, &CMsgApplyPennantUpgrade::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgApplyEggEssence_descriptor_, &CMsgApplyEggEssence::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconItemAttribute_descriptor_, &CSOEconItemAttribute::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconItemEquipped_descriptor_, &CSOEconItemEquipped::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconItem_descriptor_, &CSOEconItem::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgSortItems_descriptor_, &CMsgSortItems::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconClaimCode_descriptor_, &CSOEconClaimCode::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgStoreGetUserData_descriptor_, &CMsgStoreGetUserData::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgStoreGetUserDataResponse_descriptor_, &CMsgStoreGetUserDataResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgUpdateItemSchema_descriptor_, &CMsgUpdateItemSchema::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCError_descriptor_, &CMsgGCError::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgRequestInventoryRefresh_descriptor_, &CMsgRequestInventoryRefresh::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgConVarValue_descriptor_, &CMsgConVarValue::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgReplicateConVars_descriptor_, &CMsgReplicateConVars::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgConsumableExhausted_descriptor_, &CMsgConsumableExhausted::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgItemAcknowledged_descriptor_, &CMsgItemAcknowledged::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgSetItemPositions_descriptor_, &CMsgSetItemPositions::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgSetItemPositions_ItemPosition_descriptor_, &CMsgSetItemPositions_ItemPosition::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCNameItemNotification_descriptor_, &CMsgGCNameItemNotification::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCClientDisplayNotification_descriptor_, &CMsgGCClientDisplayNotification::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCShowItemsPickedUp_descriptor_, &CMsgGCShowItemsPickedUp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCIncrementKillCountResponse_descriptor_, &CMsgGCIncrementKillCountResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconItemDropRateBonus_descriptor_, &CSOEconItemDropRateBonus::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconItemLeagueViewPass_descriptor_, &CSOEconItemLeagueViewPass::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconItemEventTicket_descriptor_, &CSOEconItemEventTicket::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CSOEconItemTournamentPassport_descriptor_, &CSOEconItemTournamentPassport::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCStorePurchaseCancel_descriptor_, &CMsgGCStorePurchaseCancel::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCStorePurchaseCancelResponse_descriptor_, &CMsgGCStorePurchaseCancelResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCStorePurchaseFinalize_descriptor_, &CMsgGCStorePurchaseFinalize::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCStorePurchaseFinalizeResponse_descriptor_, &CMsgGCStorePurchaseFinalizeResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCBannedWordListRequest_descriptor_, &CMsgGCBannedWordListRequest::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCBannedWord_descriptor_, &CMsgGCBannedWord::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCBannedWordListResponse_descriptor_, &CMsgGCBannedWordListResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCToGCBannedWordListBroadcast_descriptor_, &CMsgGCToGCBannedWordListBroadcast::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCToGCBannedWordListUpdated_descriptor_, &CMsgGCToGCBannedWordListUpdated::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCToGCDirtySDOCache_descriptor_, &CMsgGCToGCDirtySDOCache::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCToGCDirtyMultipleSDOCache_descriptor_, &CMsgGCToGCDirtyMultipleSDOCache::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCToGCApplyLocalizationDiff_descriptor_, &CMsgGCToGCApplyLocalizationDiff::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCToGCApplyLocalizationDiffResponse_descriptor_, &CMsgGCToGCApplyLocalizationDiffResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCCollectItem_descriptor_, &CMsgGCCollectItem::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgSDONoMemcached_descriptor_, &CMsgSDONoMemcached::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCToGCUpdateSQLKeyValue_descriptor_, &CMsgGCToGCUpdateSQLKeyValue::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCServerVersionUpdated_descriptor_, &CMsgGCServerVersionUpdated::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCClientVersionUpdated_descriptor_, &CMsgGCClientVersionUpdated::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCToGCWebAPIAccountChanged_descriptor_, &CMsgGCToGCWebAPIAccountChanged::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgRecipeComponent_descriptor_, &CMsgRecipeComponent::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgFulfillDynamicRecipeComponent_descriptor_, &CMsgFulfillDynamicRecipeComponent::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCClientMarketDataRequest_descriptor_, &CMsgGCClientMarketDataRequest::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCClientMarketDataEntry_descriptor_, &CMsgGCClientMarketDataEntry::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgGCClientMarketData_descriptor_, &CMsgGCClientMarketData::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgExtractGems_descriptor_, &CMsgExtractGems::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgExtractGemsResponse_descriptor_, &CMsgExtractGemsResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgAddSocket_descriptor_, &CMsgAddSocket::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgAddSocketResponse_descriptor_, &CMsgAddSocketResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgAddItemToSocketData_descriptor_, &CMsgAddItemToSocketData::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgAddItemToSocket_descriptor_, &CMsgAddItemToSocket::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgAddItemToSocketResponse_descriptor_, &CMsgAddItemToSocketResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgResetStrangeGemCount_descriptor_, &CMsgResetStrangeGemCount::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CMsgResetStrangeGemCountResponse_descriptor_, &CMsgResetStrangeGemCountResponse::default_instance()); } } // namespace void protobuf_ShutdownFile_base_5fgcmessages_2eproto() { delete CGCStorePurchaseInit_LineItem::default_instance_; delete CGCStorePurchaseInit_LineItem_reflection_; delete CMsgGCStorePurchaseInit::default_instance_; delete CMsgGCStorePurchaseInit_reflection_; delete CMsgGCStorePurchaseInitResponse::default_instance_; delete CMsgGCStorePurchaseInitResponse_reflection_; delete CMsgSystemBroadcast::default_instance_; delete CMsgSystemBroadcast_reflection_; delete CMsgClientPingData::default_instance_; delete CMsgClientPingData_reflection_; delete CMsgInviteToParty::default_instance_; delete CMsgInviteToParty_reflection_; delete CMsgInviteToLobby::default_instance_; delete CMsgInviteToLobby_reflection_; delete CMsgInvitationCreated::default_instance_; delete CMsgInvitationCreated_reflection_; delete CMsgPartyInviteResponse::default_instance_; delete CMsgPartyInviteResponse_reflection_; delete CMsgLobbyInviteResponse::default_instance_; delete CMsgLobbyInviteResponse_reflection_; delete CMsgKickFromParty::default_instance_; delete CMsgKickFromParty_reflection_; delete CMsgLeaveParty::default_instance_; delete CMsgLeaveParty_reflection_; delete CMsgCustomGameInstallStatus::default_instance_; delete CMsgCustomGameInstallStatus_reflection_; delete CMsgServerAvailable::default_instance_; delete CMsgServerAvailable_reflection_; delete CMsgLANServerAvailable::default_instance_; delete CMsgLANServerAvailable_reflection_; delete CSOEconGameAccountClient::default_instance_; delete CSOEconGameAccountClient_reflection_; delete CSOItemCriteriaCondition::default_instance_; delete CSOItemCriteriaCondition_reflection_; delete CSOItemCriteria::default_instance_; delete CSOItemCriteria_reflection_; delete CSOItemRecipe::default_instance_; delete CSOItemRecipe_reflection_; delete CMsgApplyStrangePart::default_instance_; delete CMsgApplyStrangePart_reflection_; delete CMsgApplyPennantUpgrade::default_instance_; delete CMsgApplyPennantUpgrade_reflection_; delete CMsgApplyEggEssence::default_instance_; delete CMsgApplyEggEssence_reflection_; delete CSOEconItemAttribute::default_instance_; delete CSOEconItemAttribute_reflection_; delete CSOEconItemEquipped::default_instance_; delete CSOEconItemEquipped_reflection_; delete CSOEconItem::default_instance_; delete CSOEconItem_reflection_; delete CMsgSortItems::default_instance_; delete CMsgSortItems_reflection_; delete CSOEconClaimCode::default_instance_; delete CSOEconClaimCode_reflection_; delete CMsgStoreGetUserData::default_instance_; delete CMsgStoreGetUserData_reflection_; delete CMsgStoreGetUserDataResponse::default_instance_; delete CMsgStoreGetUserDataResponse_reflection_; delete CMsgUpdateItemSchema::default_instance_; delete CMsgUpdateItemSchema_reflection_; delete CMsgGCError::default_instance_; delete CMsgGCError_reflection_; delete CMsgRequestInventoryRefresh::default_instance_; delete CMsgRequestInventoryRefresh_reflection_; delete CMsgConVarValue::default_instance_; delete CMsgConVarValue_reflection_; delete CMsgReplicateConVars::default_instance_; delete CMsgReplicateConVars_reflection_; delete CMsgConsumableExhausted::default_instance_; delete CMsgConsumableExhausted_reflection_; delete CMsgItemAcknowledged::default_instance_; delete CMsgItemAcknowledged_reflection_; delete CMsgSetItemPositions::default_instance_; delete CMsgSetItemPositions_reflection_; delete CMsgSetItemPositions_ItemPosition::default_instance_; delete CMsgSetItemPositions_ItemPosition_reflection_; delete CMsgGCNameItemNotification::default_instance_; delete CMsgGCNameItemNotification_reflection_; delete CMsgGCClientDisplayNotification::default_instance_; delete CMsgGCClientDisplayNotification_reflection_; delete CMsgGCShowItemsPickedUp::default_instance_; delete CMsgGCShowItemsPickedUp_reflection_; delete CMsgGCIncrementKillCountResponse::default_instance_; delete CMsgGCIncrementKillCountResponse_reflection_; delete CSOEconItemDropRateBonus::default_instance_; delete CSOEconItemDropRateBonus_reflection_; delete CSOEconItemLeagueViewPass::default_instance_; delete CSOEconItemLeagueViewPass_reflection_; delete CSOEconItemEventTicket::default_instance_; delete CSOEconItemEventTicket_reflection_; delete CSOEconItemTournamentPassport::default_instance_; delete CSOEconItemTournamentPassport_reflection_; delete CMsgGCStorePurchaseCancel::default_instance_; delete CMsgGCStorePurchaseCancel_reflection_; delete CMsgGCStorePurchaseCancelResponse::default_instance_; delete CMsgGCStorePurchaseCancelResponse_reflection_; delete CMsgGCStorePurchaseFinalize::default_instance_; delete CMsgGCStorePurchaseFinalize_reflection_; delete CMsgGCStorePurchaseFinalizeResponse::default_instance_; delete CMsgGCStorePurchaseFinalizeResponse_reflection_; delete CMsgGCBannedWordListRequest::default_instance_; delete CMsgGCBannedWordListRequest_reflection_; delete CMsgGCBannedWord::default_instance_; delete CMsgGCBannedWord_reflection_; delete CMsgGCBannedWordListResponse::default_instance_; delete CMsgGCBannedWordListResponse_reflection_; delete CMsgGCToGCBannedWordListBroadcast::default_instance_; delete CMsgGCToGCBannedWordListBroadcast_reflection_; delete CMsgGCToGCBannedWordListUpdated::default_instance_; delete CMsgGCToGCBannedWordListUpdated_reflection_; delete CMsgGCToGCDirtySDOCache::default_instance_; delete CMsgGCToGCDirtySDOCache_reflection_; delete CMsgGCToGCDirtyMultipleSDOCache::default_instance_; delete CMsgGCToGCDirtyMultipleSDOCache_reflection_; delete CMsgGCToGCApplyLocalizationDiff::default_instance_; delete CMsgGCToGCApplyLocalizationDiff_reflection_; delete CMsgGCToGCApplyLocalizationDiffResponse::default_instance_; delete CMsgGCToGCApplyLocalizationDiffResponse_reflection_; delete CMsgGCCollectItem::default_instance_; delete CMsgGCCollectItem_reflection_; delete CMsgSDONoMemcached::default_instance_; delete CMsgSDONoMemcached_reflection_; delete CMsgGCToGCUpdateSQLKeyValue::default_instance_; delete CMsgGCToGCUpdateSQLKeyValue_reflection_; delete CMsgGCServerVersionUpdated::default_instance_; delete CMsgGCServerVersionUpdated_reflection_; delete CMsgGCClientVersionUpdated::default_instance_; delete CMsgGCClientVersionUpdated_reflection_; delete CMsgGCToGCWebAPIAccountChanged::default_instance_; delete CMsgGCToGCWebAPIAccountChanged_reflection_; delete CMsgRecipeComponent::default_instance_; delete CMsgRecipeComponent_reflection_; delete CMsgFulfillDynamicRecipeComponent::default_instance_; delete CMsgFulfillDynamicRecipeComponent_reflection_; delete CMsgGCClientMarketDataRequest::default_instance_; delete CMsgGCClientMarketDataRequest_reflection_; delete CMsgGCClientMarketDataEntry::default_instance_; delete CMsgGCClientMarketDataEntry_reflection_; delete CMsgGCClientMarketData::default_instance_; delete CMsgGCClientMarketData_reflection_; delete CMsgExtractGems::default_instance_; delete CMsgExtractGems_reflection_; delete CMsgExtractGemsResponse::default_instance_; delete CMsgExtractGemsResponse_reflection_; delete CMsgAddSocket::default_instance_; delete CMsgAddSocket_reflection_; delete CMsgAddSocketResponse::default_instance_; delete CMsgAddSocketResponse_reflection_; delete CMsgAddItemToSocketData::default_instance_; delete CMsgAddItemToSocketData_reflection_; delete CMsgAddItemToSocket::default_instance_; delete CMsgAddItemToSocket_reflection_; delete CMsgAddItemToSocketResponse::default_instance_; delete CMsgAddItemToSocketResponse_reflection_; delete CMsgResetStrangeGemCount::default_instance_; delete CMsgResetStrangeGemCount_reflection_; delete CMsgResetStrangeGemCountResponse::default_instance_; delete CMsgResetStrangeGemCountResponse_reflection_; } void protobuf_AddDesc_base_5fgcmessages_2eproto() { static bool already_here = false; if (already_here) return; already_here = true; GOOGLE_PROTOBUF_VERIFY_VERSION; ::protobuf_AddDesc_steammessages_2eproto(); ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( "\n\025base_gcmessages.proto\032\023steammessages.p" "roto\"\232\001\n\035CGCStorePurchaseInit_LineItem\022\023" "\n\013item_def_id\030\001 \001(\r\022\020\n\010quantity\030\002 \001(\r\022\036\n" "\026cost_in_local_currency\030\003 \001(\r\022\025\n\rpurchas" "e_type\030\004 \001(\r\022\033\n\023source_reference_id\030\005 \001(" "\004\"\202\001\n\027CMsgGCStorePurchaseInit\022\017\n\007country" "\030\001 \001(\t\022\020\n\010language\030\002 \001(\005\022\020\n\010currency\030\003 \001" "(\005\0222\n\nline_items\030\004 \003(\0132\036.CGCStorePurchas" "eInit_LineItem\"A\n\037CMsgGCStorePurchaseIni" "tResponse\022\016\n\006result\030\001 \001(\005\022\016\n\006txn_id\030\002 \001(" "\004\"&\n\023CMsgSystemBroadcast\022\017\n\007message\030\001 \001(" "\t\"\236\001\n\022CMsgClientPingData\022\027\n\013relay_codes\030" "\004 \003(\007B\002\020\001\022\027\n\013relay_pings\030\005 \003(\rB\002\020\001\022\030\n\014re" "gion_codes\030\010 \003(\rB\002\020\001\022\030\n\014region_pings\030\t \003" "(\rB\002\020\001\022\"\n\032region_ping_failed_bitmask\030\n \001" "(\r\"\210\001\n\021CMsgInviteToParty\022\020\n\010steam_id\030\001 \001" "(\006\022\026\n\016client_version\030\002 \001(\r\022\017\n\007team_id\030\003 " "\001(\r\022\020\n\010as_coach\030\004 \001(\010\022&\n\tping_data\030\005 \001(\013" "2\023.CMsgClientPingData\"=\n\021CMsgInviteToLob" "by\022\020\n\010steam_id\030\001 \001(\006\022\026\n\016client_version\030\002" " \001(\r\"Q\n\025CMsgInvitationCreated\022\020\n\010group_i" "d\030\001 \001(\004\022\020\n\010steam_id\030\002 \001(\006\022\024\n\014user_offlin" "e\030\003 \001(\010\"{\n\027CMsgPartyInviteResponse\022\020\n\010pa" "rty_id\030\001 \001(\004\022\016\n\006accept\030\002 \001(\010\022\026\n\016client_v" "ersion\030\003 \001(\r\022&\n\tping_data\030\010 \001(\0132\023.CMsgCl" "ientPingData\"\213\001\n\027CMsgLobbyInviteResponse" "\022\020\n\010lobby_id\030\001 \001(\006\022\016\n\006accept\030\002 \001(\010\022\026\n\016cl" "ient_version\030\003 \001(\r\022\027\n\017custom_game_crc\030\006 " "\001(\006\022\035\n\025custom_game_timestamp\030\007 \001(\007\"%\n\021CM" "sgKickFromParty\022\020\n\010steam_id\030\001 \001(\006\"\020\n\016CMs" "gLeaveParty\"\242\001\n\033CMsgCustomGameInstallSta" "tus\022M\n\006status\030\001 \001(\0162\031.ECustomGameInstall" "Status:\"k_ECustomGameInstallStatus_Unkno" "wn\022\017\n\007message\030\002 \001(\t\022#\n\033latest_timestamp_" "from_steam\030\003 \001(\007\"W\n\023CMsgServerAvailable\022" "@\n\032custom_game_install_status\030\001 \001(\0132\034.CM" "sgCustomGameInstallStatus\"*\n\026CMsgLANServ" "erAvailable\022\020\n\010lobby_id\030\001 \001(\006\"\252\002\n\030CSOEco" "nGameAccountClient\022$\n\031additional_backpac" "k_slots\030\001 \001(\r:\0010\022\034\n\rtrial_account\030\002 \001(\010:" "\005false\022&\n\030eligible_for_online_play\030\003 \001(\010" ":\004true\022*\n\"need_to_choose_most_helpful_fr" "iend\030\004 \001(\010\022\027\n\017in_coaches_list\030\005 \001(\010\022\034\n\024t" "rade_ban_expiration\030\006 \001(\007\022\033\n\023duel_ban_ex" "piration\030\007 \001(\007\022\"\n\023made_first_purchase\030\t " "\001(\010:\005false\"r\n\030CSOItemCriteriaCondition\022\n" "\n\002op\030\001 \001(\005\022\r\n\005field\030\002 \001(\t\022\020\n\010required\030\003 " "\001(\010\022\023\n\013float_value\030\004 \001(\002\022\024\n\014string_value" "\030\005 \001(\t\"\203\002\n\017CSOItemCriteria\022\022\n\nitem_level" "\030\001 \001(\r\022\024\n\014item_quality\030\002 \001(\005\022\026\n\016item_lev" "el_set\030\003 \001(\010\022\030\n\020item_quality_set\030\004 \001(\010\022\031" "\n\021initial_inventory\030\005 \001(\r\022\030\n\020initial_qua" "ntity\030\006 \001(\r\022\033\n\023ignore_enabled_flag\030\010 \001(\010" "\022-\n\nconditions\030\t \003(\0132\031.CSOItemCriteriaCo" "ndition\022\023\n\013recent_only\030\n \001(\010\"\325\003\n\rCSOItem" "Recipe\022\021\n\tdef_index\030\001 \001(\r\022\014\n\004name\030\002 \001(\t\022" "\013\n\003n_a\030\003 \001(\t\022\023\n\013desc_inputs\030\004 \001(\t\022\024\n\014des" "c_outputs\030\005 \001(\t\022\014\n\004di_a\030\006 \001(\t\022\014\n\004di_b\030\007 " "\001(\t\022\014\n\004di_c\030\010 \001(\t\022\014\n\004do_a\030\t \001(\t\022\014\n\004do_b\030" "\n \001(\t\022\014\n\004do_c\030\013 \001(\t\022\037\n\027requires_all_same" "_class\030\014 \001(\010\022\036\n\026requires_all_same_slot\030\r" " \001(\010\022\036\n\026class_usage_for_output\030\016 \001(\005\022\035\n\025" "slot_usage_for_output\030\017 \001(\005\022\026\n\016set_for_o" "utput\030\020 \001(\005\022.\n\024input_items_criteria\030\024 \003(" "\0132\020.CSOItemCriteria\022/\n\025output_items_crit" "eria\030\025 \003(\0132\020.CSOItemCriteria\022\036\n\026input_it" "em_dupe_counts\030\026 \003(\r\"J\n\024CMsgApplyStrange" "Part\022\034\n\024strange_part_item_id\030\001 \001(\004\022\024\n\014it" "em_item_id\030\002 \001(\004\"K\n\027CMsgApplyPennantUpgr" "ade\022\027\n\017upgrade_item_id\030\001 \001(\004\022\027\n\017pennant_" "item_id\030\002 \001(\004\"C\n\023CMsgApplyEggEssence\022\027\n\017" "essence_item_id\030\001 \001(\004\022\023\n\013egg_item_id\030\002 \001" "(\004\"M\n\024CSOEconItemAttribute\022\021\n\tdef_index\030" "\001 \001(\r\022\r\n\005value\030\002 \001(\r\022\023\n\013value_bytes\030\003 \001(" "\014\":\n\023CSOEconItemEquipped\022\021\n\tnew_class\030\001 " "\001(\r\022\020\n\010new_slot\030\002 \001(\r\"\361\002\n\013CSOEconItem\022\n\n" "\002id\030\001 \001(\004\022\022\n\naccount_id\030\002 \001(\r\022\021\n\tinvento" "ry\030\003 \001(\r\022\021\n\tdef_index\030\004 \001(\r\022\023\n\010quantity\030" "\005 \001(\r:\0011\022\020\n\005level\030\006 \001(\r:\0011\022\022\n\007quality\030\007 " "\001(\r:\0014\022\020\n\005flags\030\010 \001(\r:\0010\022\021\n\006origin\030\t \001(\r" ":\0010\022(\n\tattribute\030\014 \003(\0132\025.CSOEconItemAttr" "ibute\022#\n\rinterior_item\030\r \001(\0132\014.CSOEconIt" "em\022\025\n\006in_use\030\016 \001(\010:\005false\022\020\n\005style\030\017 \001(\r" ":\0010\022\026\n\013original_id\030\020 \001(\004:\0010\022,\n\016equipped_" "state\030\022 \003(\0132\024.CSOEconItemEquipped\"\"\n\rCMs" "gSortItems\022\021\n\tsort_type\030\001 \001(\r\"^\n\020CSOEcon" "ClaimCode\022\022\n\naccount_id\030\001 \001(\r\022\021\n\tcode_ty" "pe\030\002 \001(\r\022\025\n\rtime_acquired\030\003 \001(\r\022\014\n\004code\030" "\004 \001(\t\"3\n\024CMsgStoreGetUserData\022\033\n\023price_s" "heet_version\030\001 \001(\007\"\224\002\n\034CMsgStoreGetUserD" "ataResponse\022\016\n\006result\030\001 \001(\005\022\020\n\010currency\030" "\002 \001(\005\022\017\n\007country\030\003 \001(\t\022\033\n\023price_sheet_ve" "rsion\030\004 \001(\007\022\032\n\017experiment_data\030\005 \001(\004:\0010\022" "\031\n\021featured_item_idx\030\006 \001(\005\022#\n\025show_hat_d" "escriptions\030\007 \001(\010:\004true\022\023\n\013price_sheet\030\010" " \001(\014\022\034\n\021default_item_sort\030\t \001(\005:\0010\022\025\n\rpo" "pular_items\030\n \003(\r\"_\n\024CMsgUpdateItemSchem" "a\022\022\n\nitems_game\030\001 \001(\014\022\033\n\023item_schema_ver" "sion\030\002 \001(\007\022\026\n\016items_game_url\030\003 \001(\t\"!\n\013CM" "sgGCError\022\022\n\nerror_text\030\001 \001(\t\"\035\n\033CMsgReq" "uestInventoryRefresh\".\n\017CMsgConVarValue\022" "\014\n\004name\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"9\n\024CMsgRepl" "icateConVars\022!\n\007convars\030\001 \003(\0132\020.CMsgConV" "arValue\".\n\027CMsgConsumableExhausted\022\023\n\013it" "em_def_id\030\001 \001(\005\"\201\001\n\024CMsgItemAcknowledged" "\022\022\n\naccount_id\030\001 \001(\r\022\021\n\tinventory\030\002 \001(\r\022" "\021\n\tdef_index\030\003 \001(\r\022\017\n\007quality\030\004 \001(\r\022\016\n\006r" "arity\030\005 \001(\r\022\016\n\006origin\030\006 \001(\r\"\205\001\n\024CMsgSetI" "temPositions\022:\n\016item_positions\030\001 \003(\0132\".C" "MsgSetItemPositions.ItemPosition\0321\n\014Item" "Position\022\017\n\007item_id\030\001 \001(\004\022\020\n\010position\030\002 " "\001(\r\"f\n\032CMsgGCNameItemNotification\022\026\n\016pla" "yer_steamid\030\001 \001(\006\022\026\n\016item_def_index\030\002 \001(" "\r\022\030\n\020item_name_custom\030\003 \001(\t\"\266\001\n\037CMsgGCCl" "ientDisplayNotification\022+\n#notification_" "title_localization_key\030\001 \001(\t\022*\n\"notifica" "tion_body_localization_key\030\002 \001(\t\022\033\n\023body" "_substring_keys\030\003 \003(\t\022\035\n\025body_substring_" "values\030\004 \003(\t\"1\n\027CMsgGCShowItemsPickedUp\022" "\026\n\016player_steamid\030\001 \001(\006\"|\n CMsgGCIncreme" "ntKillCountResponse\022\037\n\021killer_account_id" "\030\001 \001(\rB\004\200\246\035\001\022\021\n\tnum_kills\030\002 \001(\r\022\020\n\010item_" "def\030\003 \001(\r\022\022\n\nlevel_type\030\004 \001(\r\"\315\001\n\030CSOEco" "nItemDropRateBonus\022\030\n\naccount_id\030\001 \001(\rB\004" "\200\246\035\001\022\027\n\017expiration_date\030\002 \001(\007\022\023\n\005bonus\030\003" " \001(\002B\004\200\246\035\001\022\023\n\013bonus_count\030\004 \001(\r\022\017\n\007item_" "id\030\005 \001(\004\022\021\n\tdef_index\030\006 \001(\r\022\024\n\014seconds_l" "eft\030\007 \001(\r\022\032\n\014booster_type\030\010 \001(\rB\004\200\246\035\001\"w\n" "\031CSOEconItemLeagueViewPass\022\030\n\naccount_id" "\030\001 \001(\rB\004\200\246\035\001\022\027\n\tleague_id\030\002 \001(\rB\004\200\246\035\001\022\021\n" "\titemindex\030\004 \001(\r\022\024\n\014grant_reason\030\005 \001(\r\"O" "\n\026CSOEconItemEventTicket\022\022\n\naccount_id\030\001" " \001(\r\022\020\n\010event_id\030\002 \001(\r\022\017\n\007item_id\030\003 \001(\004\"" "\312\001\n\035CSOEconItemTournamentPassport\022\022\n\nacc" "ount_id\030\001 \001(\r\022\021\n\tleague_id\030\002 \001(\r\022\017\n\007item" "_id\030\003 \001(\004\022\035\n\025original_purchaser_id\030\004 \001(\r" "\022\030\n\020passports_bought\030\005 \001(\r\022\017\n\007version\030\006 " "\001(\r\022\021\n\tdef_index\030\007 \001(\r\022\024\n\014reward_flags\030\010" " \001(\r\"+\n\031CMsgGCStorePurchaseCancel\022\016\n\006txn" "_id\030\001 \001(\004\"3\n!CMsgGCStorePurchaseCancelRe" "sponse\022\016\n\006result\030\001 \001(\r\"-\n\033CMsgGCStorePur" "chaseFinalize\022\016\n\006txn_id\030\001 \001(\004\"G\n#CMsgGCS" "torePurchaseFinalizeResponse\022\016\n\006result\030\001" " \001(\r\022\020\n\010item_ids\030\002 \003(\004\"I\n\033CMsgGCBannedWo" "rdListRequest\022\031\n\021ban_list_group_id\030\001 \001(\r" "\022\017\n\007word_id\030\002 \001(\r\"u\n\020CMsgGCBannedWord\022\017\n" "\007word_id\030\001 \001(\r\022B\n\tword_type\030\002 \001(\0162\022.GC_B" "annedWordType:\033GC_BANNED_WORD_DISABLE_WO" "RD\022\014\n\004word\030\003 \001(\t\"_\n\034CMsgGCBannedWordList" "Response\022\031\n\021ban_list_group_id\030\001 \001(\r\022$\n\tw" "ord_list\030\002 \003(\0132\021.CMsgGCBannedWord\"U\n!CMs" "gGCToGCBannedWordListBroadcast\0220\n\tbroadc" "ast\030\001 \001(\0132\035.CMsgGCBannedWordListResponse" "\"3\n\037CMsgGCToGCBannedWordListUpdated\022\020\n\010g" "roup_id\030\001 \001(\r\"\?\n\027CMsgGCToGCDirtySDOCache" "\022\020\n\010sdo_type\030\001 \001(\r\022\022\n\nkey_uint64\030\002 \001(\004\"G" "\n\037CMsgGCToGCDirtyMultipleSDOCache\022\020\n\010sdo" "_type\030\001 \001(\r\022\022\n\nkey_uint64\030\002 \003(\004\"H\n\037CMsgG" "CToGCApplyLocalizationDiff\022\020\n\010language\030\001" " \001(\r\022\023\n\013packed_diff\030\002 \001(\t\":\n\'CMsgGCToGCA" "pplyLocalizationDiffResponse\022\017\n\007success\030" "\001 \001(\010\"H\n\021CMsgGCCollectItem\022\032\n\022collection" "_item_id\030\001 \001(\004\022\027\n\017subject_item_id\030\002 \001(\004\"" "\024\n\022CMsgSDONoMemcached\"/\n\033CMsgGCToGCUpdat" "eSQLKeyValue\022\020\n\010key_name\030\001 \001(\t\"4\n\032CMsgGC" "ServerVersionUpdated\022\026\n\016server_version\030\001" " \001(\r\"4\n\032CMsgGCClientVersionUpdated\022\026\n\016cl" "ient_version\030\001 \001(\r\" \n\036CMsgGCToGCWebAPIAc" "countChanged\"G\n\023CMsgRecipeComponent\022\027\n\017s" "ubject_item_id\030\001 \001(\004\022\027\n\017attribute_index\030" "\002 \001(\004\"o\n!CMsgFulfillDynamicRecipeCompone" "nt\022\024\n\014tool_item_id\030\001 \001(\004\0224\n\026consumption_" "components\030\002 \003(\0132\024.CMsgRecipeComponent\"6" "\n\035CMsgGCClientMarketDataRequest\022\025\n\ruser_" "currency\030\001 \001(\r\"\210\001\n\033CMsgGCClientMarketDat" "aEntry\022\026\n\016item_def_index\030\001 \001(\r\022\024\n\014item_q" "uality\030\002 \001(\r\022\032\n\022item_sell_listings\030\003 \001(\r" "\022\037\n\027price_in_local_currency\030\004 \001(\r\"G\n\026CMs" "gGCClientMarketData\022-\n\007entries\030\001 \003(\0132\034.C" "MsgGCClientMarketDataEntry\"\\\n\017CMsgExtrac" "tGems\022\024\n\014tool_item_id\030\001 \001(\004\022\024\n\014item_item" "_id\030\002 \001(\004\022\035\n\016item_socket_id\030\003 \001(\r:\00565535" "\"\324\002\n\027CMsgExtractGemsResponse\022\017\n\007item_id\030" "\001 \001(\004\022P\n\010response\030\002 \001(\0162%.CMsgExtractGem" "sResponse.EExtractGems:\027k_ExtractGems_Su" "cceeded\"\325\001\n\014EExtractGems\022\033\n\027k_ExtractGem" "s_Succeeded\020\000\022&\n\"k_ExtractGems_Failed_To" "olIsInvalid\020\001\022&\n\"k_ExtractGems_Failed_It" "emIsInvalid\020\002\022,\n(k_ExtractGems_Failed_To" "olCannotRemoveGem\020\003\022*\n&k_ExtractGems_Fai" "led_FailedToRemoveGem\020\004\"L\n\rCMsgAddSocket" "\022\024\n\014tool_item_id\030\001 \001(\004\022\024\n\014item_item_id\030\002" " \001(\004\022\017\n\007unusual\030\003 \001(\010\"\271\002\n\025CMsgAddSocketR" "esponse\022\017\n\007item_id\030\001 \001(\004\022\034\n\024updated_sock" "et_index\030\002 \003(\r\022J\n\010response\030\003 \001(\0162!.CMsgA" "ddSocketResponse.EAddSocket:\025k_AddSocket" "_Succeeded\"\244\001\n\nEAddSocket\022\031\n\025k_AddSocket" "_Succeeded\020\000\022$\n k_AddSocket_Failed_ToolI" "sInvalid\020\001\022+\n\'k_AddSocket_Failed_ItemCan" "notBeSocketed\020\002\022(\n$k_AddSocket_Failed_Fa" "iledToAddSocket\020\003\"D\n\027CMsgAddItemToSocket" "Data\022\023\n\013gem_item_id\030\001 \001(\004\022\024\n\014socket_inde" "x\030\002 \001(\r\"]\n\023CMsgAddItemToSocket\022\024\n\014item_i" "tem_id\030\001 \001(\004\0220\n\016gems_to_socket\030\002 \003(\0132\030.C" "MsgAddItemToSocketData\"\337\003\n\033CMsgAddItemTo" "SocketResponse\022\024\n\014item_item_id\030\001 \001(\004\022\034\n\024" "updated_socket_index\030\002 \003(\r\022J\n\010response\030\003" " \001(\0162$.CMsgAddItemToSocketResponse.EAddG" "em:\022k_AddGem_Succeeded\"\277\002\n\007EAddGem\022\026\n\022k_" "AddGem_Succeeded\020\000\022 \n\034k_AddGem_Failed_Ge" "mIsInvalid\020\001\022!\n\035k_AddGem_Failed_ItemIsIn" "valid\020\002\022\"\n\036k_AddGem_Failed_FailedToAddGe" "m\020\003\022+\n\'k_AddGem_Failed_InvalidGemTypeFor" "Socket\020\004\022)\n%k_AddGem_Failed_InvalidGemTy" "peForHero\020\005\022)\n%k_AddGem_Failed_InvalidGe" "mTypeForSlot\020\006\0220\n,k_AddGem_Failed_Socket" "ContainsUnremovableGem\020\007\"F\n\030CMsgResetStr" "angeGemCount\022\024\n\014item_item_id\030\001 \001(\004\022\024\n\014so" "cket_index\030\002 \001(\r\"\276\002\n CMsgResetStrangeGem" "CountResponse\022S\n\010response\030\001 \001(\0162+.CMsgRe" "setStrangeGemCountResponse.EResetGem:\024k_" "ResetGem_Succeeded\"\304\001\n\tEResetGem\022\030\n\024k_Re" "setGem_Succeeded\020\000\022&\n\"k_ResetGem_Failed_" "FailedToResetGem\020\001\022#\n\037k_ResetGem_Failed_" "ItemIsInvalid\020\002\022%\n!k_ResetGem_Failed_Inv" "alidSocketId\020\003\022)\n%k_ResetGem_Failed_Sock" "etCannotBeReset\020\004*\310\003\n\nEGCBaseMsg\022\032\n\025k_EM" "sgGCSystemMessage\020\241\037\022\035\n\030k_EMsgGCReplicat" "eConVars\020\242\037\022\032\n\025k_EMsgGCConVarUpdated\020\243\037\022" "\032\n\025k_EMsgGCInviteToParty\020\225#\022\036\n\031k_EMsgGCI" "nvitationCreated\020\226#\022 \n\033k_EMsgGCPartyInvi" "teResponse\020\227#\022\032\n\025k_EMsgGCKickFromParty\020\230" "#\022\027\n\022k_EMsgGCLeaveParty\020\231#\022\034\n\027k_EMsgGCSe" "rverAvailable\020\232#\022\"\n\035k_EMsgGCClientConnec" "tToServer\020\233#\022\033\n\026k_EMsgGCGameServerInfo\020\234" "#\022\022\n\rk_EMsgGCError\020\235#\022\037\n\032k_EMsgGCLANServ" "erAvailable\020\237#\022\032\n\025k_EMsgGCInviteToLobby\020" "\240#\022 \n\033k_EMsgGCLobbyInviteResponse\020\241#*Y\n\027" "EGCBaseProtoObjectTypes\022\036\n\031k_EProtoObjec" "tPartyInvite\020\351\007\022\036\n\031k_EProtoObjectLobbyIn" "vite\020\352\007*\350\003\n\030ECustomGameInstallStatus\022&\n\"" "k_ECustomGameInstallStatus_Unknown\020\000\022$\n " "k_ECustomGameInstallStatus_Ready\020\001\022#\n\037k_" "ECustomGameInstallStatus_Busy\020\002\022,\n(k_ECu" "stomGameInstallStatus_FailedGeneric\020e\0222\n" ".k_ECustomGameInstallStatus_FailedIntern" "alError\020f\0227\n3k_ECustomGameInstallStatus_" "RequestedTimestampTooOld\020g\0227\n3k_ECustomG" "ameInstallStatus_RequestedTimestampTooNe" "w\020h\022*\n&k_ECustomGameInstallStatus_CRCMis" "match\020i\022*\n&k_ECustomGameInstallStatus_Fa" "iledSteam\020j\022-\n)k_ECustomGameInstallStatu" "s_FailedCanceled\020k*T\n\021GC_BannedWordType\022" "\037\n\033GC_BANNED_WORD_DISABLE_WORD\020\000\022\036\n\032GC_B" "ANNED_WORD_ENABLE_WORD\020\001B\005H\001\200\001\000", 10191); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "base_gcmessages.proto", &protobuf_RegisterTypes); CGCStorePurchaseInit_LineItem::default_instance_ = new CGCStorePurchaseInit_LineItem(); CMsgGCStorePurchaseInit::default_instance_ = new CMsgGCStorePurchaseInit(); CMsgGCStorePurchaseInitResponse::default_instance_ = new CMsgGCStorePurchaseInitResponse(); CMsgSystemBroadcast::default_instance_ = new CMsgSystemBroadcast(); CMsgClientPingData::default_instance_ = new CMsgClientPingData(); CMsgInviteToParty::default_instance_ = new CMsgInviteToParty(); CMsgInviteToLobby::default_instance_ = new CMsgInviteToLobby(); CMsgInvitationCreated::default_instance_ = new CMsgInvitationCreated(); CMsgPartyInviteResponse::default_instance_ = new CMsgPartyInviteResponse(); CMsgLobbyInviteResponse::default_instance_ = new CMsgLobbyInviteResponse(); CMsgKickFromParty::default_instance_ = new CMsgKickFromParty(); CMsgLeaveParty::default_instance_ = new CMsgLeaveParty(); CMsgCustomGameInstallStatus::default_instance_ = new CMsgCustomGameInstallStatus(); CMsgServerAvailable::default_instance_ = new CMsgServerAvailable(); CMsgLANServerAvailable::default_instance_ = new CMsgLANServerAvailable(); CSOEconGameAccountClient::default_instance_ = new CSOEconGameAccountClient(); CSOItemCriteriaCondition::default_instance_ = new CSOItemCriteriaCondition(); CSOItemCriteria::default_instance_ = new CSOItemCriteria(); CSOItemRecipe::default_instance_ = new CSOItemRecipe(); CMsgApplyStrangePart::default_instance_ = new CMsgApplyStrangePart(); CMsgApplyPennantUpgrade::default_instance_ = new CMsgApplyPennantUpgrade(); CMsgApplyEggEssence::default_instance_ = new CMsgApplyEggEssence(); CSOEconItemAttribute::default_instance_ = new CSOEconItemAttribute(); CSOEconItemEquipped::default_instance_ = new CSOEconItemEquipped(); CSOEconItem::default_instance_ = new CSOEconItem(); CMsgSortItems::default_instance_ = new CMsgSortItems(); CSOEconClaimCode::default_instance_ = new CSOEconClaimCode(); CMsgStoreGetUserData::default_instance_ = new CMsgStoreGetUserData(); CMsgStoreGetUserDataResponse::default_instance_ = new CMsgStoreGetUserDataResponse(); CMsgUpdateItemSchema::default_instance_ = new CMsgUpdateItemSchema(); CMsgGCError::default_instance_ = new CMsgGCError(); CMsgRequestInventoryRefresh::default_instance_ = new CMsgRequestInventoryRefresh(); CMsgConVarValue::default_instance_ = new CMsgConVarValue(); CMsgReplicateConVars::default_instance_ = new CMsgReplicateConVars(); CMsgConsumableExhausted::default_instance_ = new CMsgConsumableExhausted(); CMsgItemAcknowledged::default_instance_ = new CMsgItemAcknowledged(); CMsgSetItemPositions::default_instance_ = new CMsgSetItemPositions(); CMsgSetItemPositions_ItemPosition::default_instance_ = new CMsgSetItemPositions_ItemPosition(); CMsgGCNameItemNotification::default_instance_ = new CMsgGCNameItemNotification(); CMsgGCClientDisplayNotification::default_instance_ = new CMsgGCClientDisplayNotification(); CMsgGCShowItemsPickedUp::default_instance_ = new CMsgGCShowItemsPickedUp(); CMsgGCIncrementKillCountResponse::default_instance_ = new CMsgGCIncrementKillCountResponse(); CSOEconItemDropRateBonus::default_instance_ = new CSOEconItemDropRateBonus(); CSOEconItemLeagueViewPass::default_instance_ = new CSOEconItemLeagueViewPass(); CSOEconItemEventTicket::default_instance_ = new CSOEconItemEventTicket(); CSOEconItemTournamentPassport::default_instance_ = new CSOEconItemTournamentPassport(); CMsgGCStorePurchaseCancel::default_instance_ = new CMsgGCStorePurchaseCancel(); CMsgGCStorePurchaseCancelResponse::default_instance_ = new CMsgGCStorePurchaseCancelResponse(); CMsgGCStorePurchaseFinalize::default_instance_ = new CMsgGCStorePurchaseFinalize(); CMsgGCStorePurchaseFinalizeResponse::default_instance_ = new CMsgGCStorePurchaseFinalizeResponse(); CMsgGCBannedWordListRequest::default_instance_ = new CMsgGCBannedWordListRequest(); CMsgGCBannedWord::default_instance_ = new CMsgGCBannedWord(); CMsgGCBannedWordListResponse::default_instance_ = new CMsgGCBannedWordListResponse(); CMsgGCToGCBannedWordListBroadcast::default_instance_ = new CMsgGCToGCBannedWordListBroadcast(); CMsgGCToGCBannedWordListUpdated::default_instance_ = new CMsgGCToGCBannedWordListUpdated(); CMsgGCToGCDirtySDOCache::default_instance_ = new CMsgGCToGCDirtySDOCache(); CMsgGCToGCDirtyMultipleSDOCache::default_instance_ = new CMsgGCToGCDirtyMultipleSDOCache(); CMsgGCToGCApplyLocalizationDiff::default_instance_ = new CMsgGCToGCApplyLocalizationDiff(); CMsgGCToGCApplyLocalizationDiffResponse::default_instance_ = new CMsgGCToGCApplyLocalizationDiffResponse(); CMsgGCCollectItem::default_instance_ = new CMsgGCCollectItem(); CMsgSDONoMemcached::default_instance_ = new CMsgSDONoMemcached(); CMsgGCToGCUpdateSQLKeyValue::default_instance_ = new CMsgGCToGCUpdateSQLKeyValue(); CMsgGCServerVersionUpdated::default_instance_ = new CMsgGCServerVersionUpdated(); CMsgGCClientVersionUpdated::default_instance_ = new CMsgGCClientVersionUpdated(); CMsgGCToGCWebAPIAccountChanged::default_instance_ = new CMsgGCToGCWebAPIAccountChanged(); CMsgRecipeComponent::default_instance_ = new CMsgRecipeComponent(); CMsgFulfillDynamicRecipeComponent::default_instance_ = new CMsgFulfillDynamicRecipeComponent(); CMsgGCClientMarketDataRequest::default_instance_ = new CMsgGCClientMarketDataRequest(); CMsgGCClientMarketDataEntry::default_instance_ = new CMsgGCClientMarketDataEntry(); CMsgGCClientMarketData::default_instance_ = new CMsgGCClientMarketData(); CMsgExtractGems::default_instance_ = new CMsgExtractGems(); CMsgExtractGemsResponse::default_instance_ = new CMsgExtractGemsResponse(); CMsgAddSocket::default_instance_ = new CMsgAddSocket(); CMsgAddSocketResponse::default_instance_ = new CMsgAddSocketResponse(); CMsgAddItemToSocketData::default_instance_ = new CMsgAddItemToSocketData(); CMsgAddItemToSocket::default_instance_ = new CMsgAddItemToSocket(); CMsgAddItemToSocketResponse::default_instance_ = new CMsgAddItemToSocketResponse(); CMsgResetStrangeGemCount::default_instance_ = new CMsgResetStrangeGemCount(); CMsgResetStrangeGemCountResponse::default_instance_ = new CMsgResetStrangeGemCountResponse(); CGCStorePurchaseInit_LineItem::default_instance_->InitAsDefaultInstance(); CMsgGCStorePurchaseInit::default_instance_->InitAsDefaultInstance(); CMsgGCStorePurchaseInitResponse::default_instance_->InitAsDefaultInstance(); CMsgSystemBroadcast::default_instance_->InitAsDefaultInstance(); CMsgClientPingData::default_instance_->InitAsDefaultInstance(); CMsgInviteToParty::default_instance_->InitAsDefaultInstance(); CMsgInviteToLobby::default_instance_->InitAsDefaultInstance(); CMsgInvitationCreated::default_instance_->InitAsDefaultInstance(); CMsgPartyInviteResponse::default_instance_->InitAsDefaultInstance(); CMsgLobbyInviteResponse::default_instance_->InitAsDefaultInstance(); CMsgKickFromParty::default_instance_->InitAsDefaultInstance(); CMsgLeaveParty::default_instance_->InitAsDefaultInstance(); CMsgCustomGameInstallStatus::default_instance_->InitAsDefaultInstance(); CMsgServerAvailable::default_instance_->InitAsDefaultInstance(); CMsgLANServerAvailable::default_instance_->InitAsDefaultInstance(); CSOEconGameAccountClient::default_instance_->InitAsDefaultInstance(); CSOItemCriteriaCondition::default_instance_->InitAsDefaultInstance(); CSOItemCriteria::default_instance_->InitAsDefaultInstance(); CSOItemRecipe::default_instance_->InitAsDefaultInstance(); CMsgApplyStrangePart::default_instance_->InitAsDefaultInstance(); CMsgApplyPennantUpgrade::default_instance_->InitAsDefaultInstance(); CMsgApplyEggEssence::default_instance_->InitAsDefaultInstance(); CSOEconItemAttribute::default_instance_->InitAsDefaultInstance(); CSOEconItemEquipped::default_instance_->InitAsDefaultInstance(); CSOEconItem::default_instance_->InitAsDefaultInstance(); CMsgSortItems::default_instance_->InitAsDefaultInstance(); CSOEconClaimCode::default_instance_->InitAsDefaultInstance(); CMsgStoreGetUserData::default_instance_->InitAsDefaultInstance(); CMsgStoreGetUserDataResponse::default_instance_->InitAsDefaultInstance(); CMsgUpdateItemSchema::default_instance_->InitAsDefaultInstance(); CMsgGCError::default_instance_->InitAsDefaultInstance(); CMsgRequestInventoryRefresh::default_instance_->InitAsDefaultInstance(); CMsgConVarValue::default_instance_->InitAsDefaultInstance(); CMsgReplicateConVars::default_instance_->InitAsDefaultInstance(); CMsgConsumableExhausted::default_instance_->InitAsDefaultInstance(); CMsgItemAcknowledged::default_instance_->InitAsDefaultInstance(); CMsgSetItemPositions::default_instance_->InitAsDefaultInstance(); CMsgSetItemPositions_ItemPosition::default_instance_->InitAsDefaultInstance(); CMsgGCNameItemNotification::default_instance_->InitAsDefaultInstance(); CMsgGCClientDisplayNotification::default_instance_->InitAsDefaultInstance(); CMsgGCShowItemsPickedUp::default_instance_->InitAsDefaultInstance(); CMsgGCIncrementKillCountResponse::default_instance_->InitAsDefaultInstance(); CSOEconItemDropRateBonus::default_instance_->InitAsDefaultInstance(); CSOEconItemLeagueViewPass::default_instance_->InitAsDefaultInstance(); CSOEconItemEventTicket::default_instance_->InitAsDefaultInstance(); CSOEconItemTournamentPassport::default_instance_->InitAsDefaultInstance(); CMsgGCStorePurchaseCancel::default_instance_->InitAsDefaultInstance(); CMsgGCStorePurchaseCancelResponse::default_instance_->InitAsDefaultInstance(); CMsgGCStorePurchaseFinalize::default_instance_->InitAsDefaultInstance(); CMsgGCStorePurchaseFinalizeResponse::default_instance_->InitAsDefaultInstance(); CMsgGCBannedWordListRequest::default_instance_->InitAsDefaultInstance(); CMsgGCBannedWord::default_instance_->InitAsDefaultInstance(); CMsgGCBannedWordListResponse::default_instance_->InitAsDefaultInstance(); CMsgGCToGCBannedWordListBroadcast::default_instance_->InitAsDefaultInstance(); CMsgGCToGCBannedWordListUpdated::default_instance_->InitAsDefaultInstance(); CMsgGCToGCDirtySDOCache::default_instance_->InitAsDefaultInstance(); CMsgGCToGCDirtyMultipleSDOCache::default_instance_->InitAsDefaultInstance(); CMsgGCToGCApplyLocalizationDiff::default_instance_->InitAsDefaultInstance(); CMsgGCToGCApplyLocalizationDiffResponse::default_instance_->InitAsDefaultInstance(); CMsgGCCollectItem::default_instance_->InitAsDefaultInstance(); CMsgSDONoMemcached::default_instance_->InitAsDefaultInstance(); CMsgGCToGCUpdateSQLKeyValue::default_instance_->InitAsDefaultInstance(); CMsgGCServerVersionUpdated::default_instance_->InitAsDefaultInstance(); CMsgGCClientVersionUpdated::default_instance_->InitAsDefaultInstance(); CMsgGCToGCWebAPIAccountChanged::default_instance_->InitAsDefaultInstance(); CMsgRecipeComponent::default_instance_->InitAsDefaultInstance(); CMsgFulfillDynamicRecipeComponent::default_instance_->InitAsDefaultInstance(); CMsgGCClientMarketDataRequest::default_instance_->InitAsDefaultInstance(); CMsgGCClientMarketDataEntry::default_instance_->InitAsDefaultInstance(); CMsgGCClientMarketData::default_instance_->InitAsDefaultInstance(); CMsgExtractGems::default_instance_->InitAsDefaultInstance(); CMsgExtractGemsResponse::default_instance_->InitAsDefaultInstance(); CMsgAddSocket::default_instance_->InitAsDefaultInstance(); CMsgAddSocketResponse::default_instance_->InitAsDefaultInstance(); CMsgAddItemToSocketData::default_instance_->InitAsDefaultInstance(); CMsgAddItemToSocket::default_instance_->InitAsDefaultInstance(); CMsgAddItemToSocketResponse::default_instance_->InitAsDefaultInstance(); CMsgResetStrangeGemCount::default_instance_->InitAsDefaultInstance(); CMsgResetStrangeGemCountResponse::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_base_5fgcmessages_2eproto); } // Force AddDescriptors() to be called at static initialization time. struct StaticDescriptorInitializer_base_5fgcmessages_2eproto { StaticDescriptorInitializer_base_5fgcmessages_2eproto() { protobuf_AddDesc_base_5fgcmessages_2eproto(); } } static_descriptor_initializer_base_5fgcmessages_2eproto_; const ::google::protobuf::EnumDescriptor* EGCBaseMsg_descriptor() { protobuf_AssignDescriptorsOnce(); return EGCBaseMsg_descriptor_; } bool EGCBaseMsg_IsValid(int value) { switch(value) { case 4001: case 4002: case 4003: case 4501: case 4502: case 4503: case 4504: case 4505: case 4506: case 4507: case 4508: case 4509: case 4511: case 4512: case 4513: return true; default: return false; } } const ::google::protobuf::EnumDescriptor* EGCBaseProtoObjectTypes_descriptor() { protobuf_AssignDescriptorsOnce(); return EGCBaseProtoObjectTypes_descriptor_; } bool EGCBaseProtoObjectTypes_IsValid(int value) { switch(value) { case 1001: case 1002: return true; default: return false; } } const ::google::protobuf::EnumDescriptor* ECustomGameInstallStatus_descriptor() { protobuf_AssignDescriptorsOnce(); return ECustomGameInstallStatus_descriptor_; } bool ECustomGameInstallStatus_IsValid(int value) { switch(value) { case 0: case 1: case 2: case 101: case 102: case 103: case 104: case 105: case 106: case 107: return true; default: return false; } } const ::google::protobuf::EnumDescriptor* GC_BannedWordType_descriptor() { protobuf_AssignDescriptorsOnce(); return GC_BannedWordType_descriptor_; } bool GC_BannedWordType_IsValid(int value) { switch(value) { case 0: case 1: return true; default: return false; } } // =================================================================== #ifndef _MSC_VER const int CGCStorePurchaseInit_LineItem::kItemDefIdFieldNumber; const int CGCStorePurchaseInit_LineItem::kQuantityFieldNumber; const int CGCStorePurchaseInit_LineItem::kCostInLocalCurrencyFieldNumber; const int CGCStorePurchaseInit_LineItem::kPurchaseTypeFieldNumber; const int CGCStorePurchaseInit_LineItem::kSourceReferenceIdFieldNumber; #endif // !_MSC_VER CGCStorePurchaseInit_LineItem::CGCStorePurchaseInit_LineItem() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CGCStorePurchaseInit_LineItem) } void CGCStorePurchaseInit_LineItem::InitAsDefaultInstance() { } CGCStorePurchaseInit_LineItem::CGCStorePurchaseInit_LineItem(const CGCStorePurchaseInit_LineItem& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CGCStorePurchaseInit_LineItem) } void CGCStorePurchaseInit_LineItem::SharedCtor() { _cached_size_ = 0; item_def_id_ = 0u; quantity_ = 0u; cost_in_local_currency_ = 0u; purchase_type_ = 0u; source_reference_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CGCStorePurchaseInit_LineItem::~CGCStorePurchaseInit_LineItem() { // @@protoc_insertion_point(destructor:CGCStorePurchaseInit_LineItem) SharedDtor(); } void CGCStorePurchaseInit_LineItem::SharedDtor() { if (this != default_instance_) { } } void CGCStorePurchaseInit_LineItem::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CGCStorePurchaseInit_LineItem::descriptor() { protobuf_AssignDescriptorsOnce(); return CGCStorePurchaseInit_LineItem_descriptor_; } const CGCStorePurchaseInit_LineItem& CGCStorePurchaseInit_LineItem::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CGCStorePurchaseInit_LineItem* CGCStorePurchaseInit_LineItem::default_instance_ = NULL; CGCStorePurchaseInit_LineItem* CGCStorePurchaseInit_LineItem::New() const { return new CGCStorePurchaseInit_LineItem; } void CGCStorePurchaseInit_LineItem::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CGCStorePurchaseInit_LineItem*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 31) { ZR_(item_def_id_, source_reference_id_); } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CGCStorePurchaseInit_LineItem::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CGCStorePurchaseInit_LineItem) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 item_def_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &item_def_id_))); set_has_item_def_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_quantity; break; } // optional uint32 quantity = 2; case 2: { if (tag == 16) { parse_quantity: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &quantity_))); set_has_quantity(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_cost_in_local_currency; break; } // optional uint32 cost_in_local_currency = 3; case 3: { if (tag == 24) { parse_cost_in_local_currency: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &cost_in_local_currency_))); set_has_cost_in_local_currency(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_purchase_type; break; } // optional uint32 purchase_type = 4; case 4: { if (tag == 32) { parse_purchase_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &purchase_type_))); set_has_purchase_type(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_source_reference_id; break; } // optional uint64 source_reference_id = 5; case 5: { if (tag == 40) { parse_source_reference_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &source_reference_id_))); set_has_source_reference_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CGCStorePurchaseInit_LineItem) return true; failure: // @@protoc_insertion_point(parse_failure:CGCStorePurchaseInit_LineItem) return false; #undef DO_ } void CGCStorePurchaseInit_LineItem::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CGCStorePurchaseInit_LineItem) // optional uint32 item_def_id = 1; if (has_item_def_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->item_def_id(), output); } // optional uint32 quantity = 2; if (has_quantity()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->quantity(), output); } // optional uint32 cost_in_local_currency = 3; if (has_cost_in_local_currency()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->cost_in_local_currency(), output); } // optional uint32 purchase_type = 4; if (has_purchase_type()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->purchase_type(), output); } // optional uint64 source_reference_id = 5; if (has_source_reference_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->source_reference_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CGCStorePurchaseInit_LineItem) } ::google::protobuf::uint8* CGCStorePurchaseInit_LineItem::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CGCStorePurchaseInit_LineItem) // optional uint32 item_def_id = 1; if (has_item_def_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->item_def_id(), target); } // optional uint32 quantity = 2; if (has_quantity()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->quantity(), target); } // optional uint32 cost_in_local_currency = 3; if (has_cost_in_local_currency()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->cost_in_local_currency(), target); } // optional uint32 purchase_type = 4; if (has_purchase_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->purchase_type(), target); } // optional uint64 source_reference_id = 5; if (has_source_reference_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->source_reference_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CGCStorePurchaseInit_LineItem) return target; } int CGCStorePurchaseInit_LineItem::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 item_def_id = 1; if (has_item_def_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->item_def_id()); } // optional uint32 quantity = 2; if (has_quantity()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->quantity()); } // optional uint32 cost_in_local_currency = 3; if (has_cost_in_local_currency()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->cost_in_local_currency()); } // optional uint32 purchase_type = 4; if (has_purchase_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->purchase_type()); } // optional uint64 source_reference_id = 5; if (has_source_reference_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->source_reference_id()); } } 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; } void CGCStorePurchaseInit_LineItem::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CGCStorePurchaseInit_LineItem* source = ::google::protobuf::internal::dynamic_cast_if_available<const CGCStorePurchaseInit_LineItem*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CGCStorePurchaseInit_LineItem::MergeFrom(const CGCStorePurchaseInit_LineItem& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_def_id()) { set_item_def_id(from.item_def_id()); } if (from.has_quantity()) { set_quantity(from.quantity()); } if (from.has_cost_in_local_currency()) { set_cost_in_local_currency(from.cost_in_local_currency()); } if (from.has_purchase_type()) { set_purchase_type(from.purchase_type()); } if (from.has_source_reference_id()) { set_source_reference_id(from.source_reference_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CGCStorePurchaseInit_LineItem::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CGCStorePurchaseInit_LineItem::CopyFrom(const CGCStorePurchaseInit_LineItem& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CGCStorePurchaseInit_LineItem::IsInitialized() const { return true; } void CGCStorePurchaseInit_LineItem::Swap(CGCStorePurchaseInit_LineItem* other) { if (other != this) { std::swap(item_def_id_, other->item_def_id_); std::swap(quantity_, other->quantity_); std::swap(cost_in_local_currency_, other->cost_in_local_currency_); std::swap(purchase_type_, other->purchase_type_); std::swap(source_reference_id_, other->source_reference_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CGCStorePurchaseInit_LineItem::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CGCStorePurchaseInit_LineItem_descriptor_; metadata.reflection = CGCStorePurchaseInit_LineItem_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCStorePurchaseInit::kCountryFieldNumber; const int CMsgGCStorePurchaseInit::kLanguageFieldNumber; const int CMsgGCStorePurchaseInit::kCurrencyFieldNumber; const int CMsgGCStorePurchaseInit::kLineItemsFieldNumber; #endif // !_MSC_VER CMsgGCStorePurchaseInit::CMsgGCStorePurchaseInit() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCStorePurchaseInit) } void CMsgGCStorePurchaseInit::InitAsDefaultInstance() { } CMsgGCStorePurchaseInit::CMsgGCStorePurchaseInit(const CMsgGCStorePurchaseInit& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCStorePurchaseInit) } void CMsgGCStorePurchaseInit::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; country_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); language_ = 0; currency_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCStorePurchaseInit::~CMsgGCStorePurchaseInit() { // @@protoc_insertion_point(destructor:CMsgGCStorePurchaseInit) SharedDtor(); } void CMsgGCStorePurchaseInit::SharedDtor() { if (country_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete country_; } if (this != default_instance_) { } } void CMsgGCStorePurchaseInit::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCStorePurchaseInit::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCStorePurchaseInit_descriptor_; } const CMsgGCStorePurchaseInit& CMsgGCStorePurchaseInit::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCStorePurchaseInit* CMsgGCStorePurchaseInit::default_instance_ = NULL; CMsgGCStorePurchaseInit* CMsgGCStorePurchaseInit::New() const { return new CMsgGCStorePurchaseInit; } void CMsgGCStorePurchaseInit::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgGCStorePurchaseInit*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 7) { ZR_(language_, currency_); if (has_country()) { if (country_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { country_->clear(); } } } #undef OFFSET_OF_FIELD_ #undef ZR_ line_items_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCStorePurchaseInit::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCStorePurchaseInit) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string country = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_country())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->country().data(), this->country().length(), ::google::protobuf::internal::WireFormat::PARSE, "country"); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_language; break; } // optional int32 language = 2; case 2: { if (tag == 16) { parse_language: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &language_))); set_has_language(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_currency; break; } // optional int32 currency = 3; case 3: { if (tag == 24) { parse_currency: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &currency_))); set_has_currency(); } else { goto handle_unusual; } if (input->ExpectTag(34)) goto parse_line_items; break; } // repeated .CGCStorePurchaseInit_LineItem line_items = 4; case 4: { if (tag == 34) { parse_line_items: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_line_items())); } else { goto handle_unusual; } if (input->ExpectTag(34)) goto parse_line_items; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCStorePurchaseInit) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCStorePurchaseInit) return false; #undef DO_ } void CMsgGCStorePurchaseInit::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCStorePurchaseInit) // optional string country = 1; if (has_country()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->country().data(), this->country().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "country"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->country(), output); } // optional int32 language = 2; if (has_language()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->language(), output); } // optional int32 currency = 3; if (has_currency()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->currency(), output); } // repeated .CGCStorePurchaseInit_LineItem line_items = 4; for (int i = 0; i < this->line_items_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 4, this->line_items(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCStorePurchaseInit) } ::google::protobuf::uint8* CMsgGCStorePurchaseInit::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCStorePurchaseInit) // optional string country = 1; if (has_country()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->country().data(), this->country().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "country"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->country(), target); } // optional int32 language = 2; if (has_language()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->language(), target); } // optional int32 currency = 3; if (has_currency()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->currency(), target); } // repeated .CGCStorePurchaseInit_LineItem line_items = 4; for (int i = 0; i < this->line_items_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 4, this->line_items(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCStorePurchaseInit) return target; } int CMsgGCStorePurchaseInit::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string country = 1; if (has_country()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->country()); } // optional int32 language = 2; if (has_language()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->language()); } // optional int32 currency = 3; if (has_currency()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->currency()); } } // repeated .CGCStorePurchaseInit_LineItem line_items = 4; total_size += 1 * this->line_items_size(); for (int i = 0; i < this->line_items_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->line_items(i)); } 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; } void CMsgGCStorePurchaseInit::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCStorePurchaseInit* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCStorePurchaseInit*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCStorePurchaseInit::MergeFrom(const CMsgGCStorePurchaseInit& from) { GOOGLE_CHECK_NE(&from, this); line_items_.MergeFrom(from.line_items_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_country()) { set_country(from.country()); } if (from.has_language()) { set_language(from.language()); } if (from.has_currency()) { set_currency(from.currency()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCStorePurchaseInit::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCStorePurchaseInit::CopyFrom(const CMsgGCStorePurchaseInit& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCStorePurchaseInit::IsInitialized() const { return true; } void CMsgGCStorePurchaseInit::Swap(CMsgGCStorePurchaseInit* other) { if (other != this) { std::swap(country_, other->country_); std::swap(language_, other->language_); std::swap(currency_, other->currency_); line_items_.Swap(&other->line_items_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCStorePurchaseInit::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCStorePurchaseInit_descriptor_; metadata.reflection = CMsgGCStorePurchaseInit_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCStorePurchaseInitResponse::kResultFieldNumber; const int CMsgGCStorePurchaseInitResponse::kTxnIdFieldNumber; #endif // !_MSC_VER CMsgGCStorePurchaseInitResponse::CMsgGCStorePurchaseInitResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCStorePurchaseInitResponse) } void CMsgGCStorePurchaseInitResponse::InitAsDefaultInstance() { } CMsgGCStorePurchaseInitResponse::CMsgGCStorePurchaseInitResponse(const CMsgGCStorePurchaseInitResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCStorePurchaseInitResponse) } void CMsgGCStorePurchaseInitResponse::SharedCtor() { _cached_size_ = 0; result_ = 0; txn_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCStorePurchaseInitResponse::~CMsgGCStorePurchaseInitResponse() { // @@protoc_insertion_point(destructor:CMsgGCStorePurchaseInitResponse) SharedDtor(); } void CMsgGCStorePurchaseInitResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgGCStorePurchaseInitResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCStorePurchaseInitResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCStorePurchaseInitResponse_descriptor_; } const CMsgGCStorePurchaseInitResponse& CMsgGCStorePurchaseInitResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCStorePurchaseInitResponse* CMsgGCStorePurchaseInitResponse::default_instance_ = NULL; CMsgGCStorePurchaseInitResponse* CMsgGCStorePurchaseInitResponse::New() const { return new CMsgGCStorePurchaseInitResponse; } void CMsgGCStorePurchaseInitResponse::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgGCStorePurchaseInitResponse*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(txn_id_, result_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCStorePurchaseInitResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCStorePurchaseInitResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 result = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &result_))); set_has_result(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_txn_id; break; } // optional uint64 txn_id = 2; case 2: { if (tag == 16) { parse_txn_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &txn_id_))); set_has_txn_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCStorePurchaseInitResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCStorePurchaseInitResponse) return false; #undef DO_ } void CMsgGCStorePurchaseInitResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCStorePurchaseInitResponse) // optional int32 result = 1; if (has_result()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->result(), output); } // optional uint64 txn_id = 2; if (has_txn_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->txn_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCStorePurchaseInitResponse) } ::google::protobuf::uint8* CMsgGCStorePurchaseInitResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCStorePurchaseInitResponse) // optional int32 result = 1; if (has_result()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->result(), target); } // optional uint64 txn_id = 2; if (has_txn_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->txn_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCStorePurchaseInitResponse) return target; } int CMsgGCStorePurchaseInitResponse::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()); } // optional uint64 txn_id = 2; if (has_txn_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->txn_id()); } } 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; } void CMsgGCStorePurchaseInitResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCStorePurchaseInitResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCStorePurchaseInitResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCStorePurchaseInitResponse::MergeFrom(const CMsgGCStorePurchaseInitResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_result()) { set_result(from.result()); } if (from.has_txn_id()) { set_txn_id(from.txn_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCStorePurchaseInitResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCStorePurchaseInitResponse::CopyFrom(const CMsgGCStorePurchaseInitResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCStorePurchaseInitResponse::IsInitialized() const { return true; } void CMsgGCStorePurchaseInitResponse::Swap(CMsgGCStorePurchaseInitResponse* other) { if (other != this) { std::swap(result_, other->result_); std::swap(txn_id_, other->txn_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCStorePurchaseInitResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCStorePurchaseInitResponse_descriptor_; metadata.reflection = CMsgGCStorePurchaseInitResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgSystemBroadcast::kMessageFieldNumber; #endif // !_MSC_VER CMsgSystemBroadcast::CMsgSystemBroadcast() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgSystemBroadcast) } void CMsgSystemBroadcast::InitAsDefaultInstance() { } CMsgSystemBroadcast::CMsgSystemBroadcast(const CMsgSystemBroadcast& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgSystemBroadcast) } void CMsgSystemBroadcast::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; message_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgSystemBroadcast::~CMsgSystemBroadcast() { // @@protoc_insertion_point(destructor:CMsgSystemBroadcast) SharedDtor(); } void CMsgSystemBroadcast::SharedDtor() { if (message_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete message_; } if (this != default_instance_) { } } void CMsgSystemBroadcast::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgSystemBroadcast::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgSystemBroadcast_descriptor_; } const CMsgSystemBroadcast& CMsgSystemBroadcast::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgSystemBroadcast* CMsgSystemBroadcast::default_instance_ = NULL; CMsgSystemBroadcast* CMsgSystemBroadcast::New() const { return new CMsgSystemBroadcast; } void CMsgSystemBroadcast::Clear() { if (has_message()) { if (message_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { message_->clear(); } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgSystemBroadcast::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgSystemBroadcast) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string message = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_message())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->message().data(), this->message().length(), ::google::protobuf::internal::WireFormat::PARSE, "message"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgSystemBroadcast) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgSystemBroadcast) return false; #undef DO_ } void CMsgSystemBroadcast::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgSystemBroadcast) // optional string message = 1; if (has_message()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->message().data(), this->message().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "message"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->message(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgSystemBroadcast) } ::google::protobuf::uint8* CMsgSystemBroadcast::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgSystemBroadcast) // optional string message = 1; if (has_message()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->message().data(), this->message().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "message"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->message(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgSystemBroadcast) return target; } int CMsgSystemBroadcast::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string message = 1; if (has_message()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->message()); } } 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; } void CMsgSystemBroadcast::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgSystemBroadcast* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgSystemBroadcast*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgSystemBroadcast::MergeFrom(const CMsgSystemBroadcast& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_message()) { set_message(from.message()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgSystemBroadcast::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgSystemBroadcast::CopyFrom(const CMsgSystemBroadcast& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgSystemBroadcast::IsInitialized() const { return true; } void CMsgSystemBroadcast::Swap(CMsgSystemBroadcast* other) { if (other != this) { std::swap(message_, other->message_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgSystemBroadcast::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgSystemBroadcast_descriptor_; metadata.reflection = CMsgSystemBroadcast_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgClientPingData::kRelayCodesFieldNumber; const int CMsgClientPingData::kRelayPingsFieldNumber; const int CMsgClientPingData::kRegionCodesFieldNumber; const int CMsgClientPingData::kRegionPingsFieldNumber; const int CMsgClientPingData::kRegionPingFailedBitmaskFieldNumber; #endif // !_MSC_VER CMsgClientPingData::CMsgClientPingData() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgClientPingData) } void CMsgClientPingData::InitAsDefaultInstance() { } CMsgClientPingData::CMsgClientPingData(const CMsgClientPingData& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgClientPingData) } void CMsgClientPingData::SharedCtor() { _cached_size_ = 0; region_ping_failed_bitmask_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgClientPingData::~CMsgClientPingData() { // @@protoc_insertion_point(destructor:CMsgClientPingData) SharedDtor(); } void CMsgClientPingData::SharedDtor() { if (this != default_instance_) { } } void CMsgClientPingData::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgClientPingData::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgClientPingData_descriptor_; } const CMsgClientPingData& CMsgClientPingData::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgClientPingData* CMsgClientPingData::default_instance_ = NULL; CMsgClientPingData* CMsgClientPingData::New() const { return new CMsgClientPingData; } void CMsgClientPingData::Clear() { region_ping_failed_bitmask_ = 0u; relay_codes_.Clear(); relay_pings_.Clear(); region_codes_.Clear(); region_pings_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgClientPingData::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgClientPingData) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated fixed32 relay_codes = 4 [packed = true]; case 4: { if (tag == 34) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, this->mutable_relay_codes()))); } else if (tag == 37) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( 1, 34, input, this->mutable_relay_codes()))); } else { goto handle_unusual; } if (input->ExpectTag(42)) goto parse_relay_pings; break; } // repeated uint32 relay_pings = 5 [packed = true]; case 5: { if (tag == 42) { parse_relay_pings: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, this->mutable_relay_pings()))); } else if (tag == 40) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1, 42, input, this->mutable_relay_pings()))); } else { goto handle_unusual; } if (input->ExpectTag(66)) goto parse_region_codes; break; } // repeated uint32 region_codes = 8 [packed = true]; case 8: { if (tag == 66) { parse_region_codes: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, this->mutable_region_codes()))); } else if (tag == 64) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1, 66, input, this->mutable_region_codes()))); } else { goto handle_unusual; } if (input->ExpectTag(74)) goto parse_region_pings; break; } // repeated uint32 region_pings = 9 [packed = true]; case 9: { if (tag == 74) { parse_region_pings: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, this->mutable_region_pings()))); } else if (tag == 72) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1, 74, input, this->mutable_region_pings()))); } else { goto handle_unusual; } if (input->ExpectTag(80)) goto parse_region_ping_failed_bitmask; break; } // optional uint32 region_ping_failed_bitmask = 10; case 10: { if (tag == 80) { parse_region_ping_failed_bitmask: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &region_ping_failed_bitmask_))); set_has_region_ping_failed_bitmask(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgClientPingData) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgClientPingData) return false; #undef DO_ } void CMsgClientPingData::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgClientPingData) // repeated fixed32 relay_codes = 4 [packed = true]; if (this->relay_codes_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_relay_codes_cached_byte_size_); } for (int i = 0; i < this->relay_codes_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteFixed32NoTag( this->relay_codes(i), output); } // repeated uint32 relay_pings = 5 [packed = true]; if (this->relay_pings_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_relay_pings_cached_byte_size_); } for (int i = 0; i < this->relay_pings_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( this->relay_pings(i), output); } // repeated uint32 region_codes = 8 [packed = true]; if (this->region_codes_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_region_codes_cached_byte_size_); } for (int i = 0; i < this->region_codes_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( this->region_codes(i), output); } // repeated uint32 region_pings = 9 [packed = true]; if (this->region_pings_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_region_pings_cached_byte_size_); } for (int i = 0; i < this->region_pings_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( this->region_pings(i), output); } // optional uint32 region_ping_failed_bitmask = 10; if (has_region_ping_failed_bitmask()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->region_ping_failed_bitmask(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgClientPingData) } ::google::protobuf::uint8* CMsgClientPingData::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgClientPingData) // repeated fixed32 relay_codes = 4 [packed = true]; if (this->relay_codes_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _relay_codes_cached_byte_size_, target); } for (int i = 0; i < this->relay_codes_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteFixed32NoTagToArray(this->relay_codes(i), target); } // repeated uint32 relay_pings = 5 [packed = true]; if (this->relay_pings_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _relay_pings_cached_byte_size_, target); } for (int i = 0; i < this->relay_pings_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt32NoTagToArray(this->relay_pings(i), target); } // repeated uint32 region_codes = 8 [packed = true]; if (this->region_codes_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _region_codes_cached_byte_size_, target); } for (int i = 0; i < this->region_codes_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt32NoTagToArray(this->region_codes(i), target); } // repeated uint32 region_pings = 9 [packed = true]; if (this->region_pings_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _region_pings_cached_byte_size_, target); } for (int i = 0; i < this->region_pings_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt32NoTagToArray(this->region_pings(i), target); } // optional uint32 region_ping_failed_bitmask = 10; if (has_region_ping_failed_bitmask()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->region_ping_failed_bitmask(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgClientPingData) return target; } int CMsgClientPingData::ByteSize() const { int total_size = 0; if (_has_bits_[4 / 32] & (0xffu << (4 % 32))) { // optional uint32 region_ping_failed_bitmask = 10; if (has_region_ping_failed_bitmask()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->region_ping_failed_bitmask()); } } // repeated fixed32 relay_codes = 4 [packed = true]; { int data_size = 0; data_size = 4 * this->relay_codes_size(); if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _relay_codes_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated uint32 relay_pings = 5 [packed = true]; { int data_size = 0; for (int i = 0; i < this->relay_pings_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt32Size(this->relay_pings(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _relay_pings_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated uint32 region_codes = 8 [packed = true]; { int data_size = 0; for (int i = 0; i < this->region_codes_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt32Size(this->region_codes(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _region_codes_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated uint32 region_pings = 9 [packed = true]; { int data_size = 0; for (int i = 0; i < this->region_pings_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt32Size(this->region_pings(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _region_pings_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } 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; } void CMsgClientPingData::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgClientPingData* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgClientPingData*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgClientPingData::MergeFrom(const CMsgClientPingData& from) { GOOGLE_CHECK_NE(&from, this); relay_codes_.MergeFrom(from.relay_codes_); relay_pings_.MergeFrom(from.relay_pings_); region_codes_.MergeFrom(from.region_codes_); region_pings_.MergeFrom(from.region_pings_); if (from._has_bits_[4 / 32] & (0xffu << (4 % 32))) { if (from.has_region_ping_failed_bitmask()) { set_region_ping_failed_bitmask(from.region_ping_failed_bitmask()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgClientPingData::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgClientPingData::CopyFrom(const CMsgClientPingData& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgClientPingData::IsInitialized() const { return true; } void CMsgClientPingData::Swap(CMsgClientPingData* other) { if (other != this) { relay_codes_.Swap(&other->relay_codes_); relay_pings_.Swap(&other->relay_pings_); region_codes_.Swap(&other->region_codes_); region_pings_.Swap(&other->region_pings_); std::swap(region_ping_failed_bitmask_, other->region_ping_failed_bitmask_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgClientPingData::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgClientPingData_descriptor_; metadata.reflection = CMsgClientPingData_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgInviteToParty::kSteamIdFieldNumber; const int CMsgInviteToParty::kClientVersionFieldNumber; const int CMsgInviteToParty::kTeamIdFieldNumber; const int CMsgInviteToParty::kAsCoachFieldNumber; const int CMsgInviteToParty::kPingDataFieldNumber; #endif // !_MSC_VER CMsgInviteToParty::CMsgInviteToParty() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgInviteToParty) } void CMsgInviteToParty::InitAsDefaultInstance() { ping_data_ = const_cast< ::CMsgClientPingData*>(&::CMsgClientPingData::default_instance()); } CMsgInviteToParty::CMsgInviteToParty(const CMsgInviteToParty& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgInviteToParty) } void CMsgInviteToParty::SharedCtor() { _cached_size_ = 0; steam_id_ = GOOGLE_ULONGLONG(0); client_version_ = 0u; team_id_ = 0u; as_coach_ = false; ping_data_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgInviteToParty::~CMsgInviteToParty() { // @@protoc_insertion_point(destructor:CMsgInviteToParty) SharedDtor(); } void CMsgInviteToParty::SharedDtor() { if (this != default_instance_) { delete ping_data_; } } void CMsgInviteToParty::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgInviteToParty::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgInviteToParty_descriptor_; } const CMsgInviteToParty& CMsgInviteToParty::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgInviteToParty* CMsgInviteToParty::default_instance_ = NULL; CMsgInviteToParty* CMsgInviteToParty::New() const { return new CMsgInviteToParty; } void CMsgInviteToParty::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgInviteToParty*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 31) { ZR_(steam_id_, team_id_); as_coach_ = false; if (has_ping_data()) { if (ping_data_ != NULL) ping_data_->::CMsgClientPingData::Clear(); } } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgInviteToParty::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgInviteToParty) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional fixed64 steam_id = 1; case 1: { if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &steam_id_))); set_has_steam_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_client_version; break; } // optional uint32 client_version = 2; case 2: { if (tag == 16) { parse_client_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &client_version_))); set_has_client_version(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_team_id; break; } // optional uint32 team_id = 3; case 3: { if (tag == 24) { parse_team_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &team_id_))); set_has_team_id(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_as_coach; break; } // optional bool as_coach = 4; case 4: { if (tag == 32) { parse_as_coach: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &as_coach_))); set_has_as_coach(); } else { goto handle_unusual; } if (input->ExpectTag(42)) goto parse_ping_data; break; } // optional .CMsgClientPingData ping_data = 5; case 5: { if (tag == 42) { parse_ping_data: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_ping_data())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgInviteToParty) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgInviteToParty) return false; #undef DO_ } void CMsgInviteToParty::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgInviteToParty) // optional fixed64 steam_id = 1; if (has_steam_id()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(1, this->steam_id(), output); } // optional uint32 client_version = 2; if (has_client_version()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->client_version(), output); } // optional uint32 team_id = 3; if (has_team_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->team_id(), output); } // optional bool as_coach = 4; if (has_as_coach()) { ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->as_coach(), output); } // optional .CMsgClientPingData ping_data = 5; if (has_ping_data()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 5, this->ping_data(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgInviteToParty) } ::google::protobuf::uint8* CMsgInviteToParty::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgInviteToParty) // optional fixed64 steam_id = 1; if (has_steam_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(1, this->steam_id(), target); } // optional uint32 client_version = 2; if (has_client_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->client_version(), target); } // optional uint32 team_id = 3; if (has_team_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->team_id(), target); } // optional bool as_coach = 4; if (has_as_coach()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->as_coach(), target); } // optional .CMsgClientPingData ping_data = 5; if (has_ping_data()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 5, this->ping_data(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgInviteToParty) return target; } int CMsgInviteToParty::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional fixed64 steam_id = 1; if (has_steam_id()) { total_size += 1 + 8; } // optional uint32 client_version = 2; if (has_client_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->client_version()); } // optional uint32 team_id = 3; if (has_team_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->team_id()); } // optional bool as_coach = 4; if (has_as_coach()) { total_size += 1 + 1; } // optional .CMsgClientPingData ping_data = 5; if (has_ping_data()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->ping_data()); } } 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; } void CMsgInviteToParty::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgInviteToParty* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgInviteToParty*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgInviteToParty::MergeFrom(const CMsgInviteToParty& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_steam_id()) { set_steam_id(from.steam_id()); } if (from.has_client_version()) { set_client_version(from.client_version()); } if (from.has_team_id()) { set_team_id(from.team_id()); } if (from.has_as_coach()) { set_as_coach(from.as_coach()); } if (from.has_ping_data()) { mutable_ping_data()->::CMsgClientPingData::MergeFrom(from.ping_data()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgInviteToParty::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgInviteToParty::CopyFrom(const CMsgInviteToParty& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgInviteToParty::IsInitialized() const { return true; } void CMsgInviteToParty::Swap(CMsgInviteToParty* other) { if (other != this) { std::swap(steam_id_, other->steam_id_); std::swap(client_version_, other->client_version_); std::swap(team_id_, other->team_id_); std::swap(as_coach_, other->as_coach_); std::swap(ping_data_, other->ping_data_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgInviteToParty::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgInviteToParty_descriptor_; metadata.reflection = CMsgInviteToParty_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgInviteToLobby::kSteamIdFieldNumber; const int CMsgInviteToLobby::kClientVersionFieldNumber; #endif // !_MSC_VER CMsgInviteToLobby::CMsgInviteToLobby() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgInviteToLobby) } void CMsgInviteToLobby::InitAsDefaultInstance() { } CMsgInviteToLobby::CMsgInviteToLobby(const CMsgInviteToLobby& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgInviteToLobby) } void CMsgInviteToLobby::SharedCtor() { _cached_size_ = 0; steam_id_ = GOOGLE_ULONGLONG(0); client_version_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgInviteToLobby::~CMsgInviteToLobby() { // @@protoc_insertion_point(destructor:CMsgInviteToLobby) SharedDtor(); } void CMsgInviteToLobby::SharedDtor() { if (this != default_instance_) { } } void CMsgInviteToLobby::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgInviteToLobby::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgInviteToLobby_descriptor_; } const CMsgInviteToLobby& CMsgInviteToLobby::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgInviteToLobby* CMsgInviteToLobby::default_instance_ = NULL; CMsgInviteToLobby* CMsgInviteToLobby::New() const { return new CMsgInviteToLobby; } void CMsgInviteToLobby::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgInviteToLobby*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(steam_id_, client_version_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgInviteToLobby::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgInviteToLobby) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional fixed64 steam_id = 1; case 1: { if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &steam_id_))); set_has_steam_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_client_version; break; } // optional uint32 client_version = 2; case 2: { if (tag == 16) { parse_client_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &client_version_))); set_has_client_version(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgInviteToLobby) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgInviteToLobby) return false; #undef DO_ } void CMsgInviteToLobby::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgInviteToLobby) // optional fixed64 steam_id = 1; if (has_steam_id()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(1, this->steam_id(), output); } // optional uint32 client_version = 2; if (has_client_version()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->client_version(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgInviteToLobby) } ::google::protobuf::uint8* CMsgInviteToLobby::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgInviteToLobby) // optional fixed64 steam_id = 1; if (has_steam_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(1, this->steam_id(), target); } // optional uint32 client_version = 2; if (has_client_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->client_version(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgInviteToLobby) return target; } int CMsgInviteToLobby::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional fixed64 steam_id = 1; if (has_steam_id()) { total_size += 1 + 8; } // optional uint32 client_version = 2; if (has_client_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->client_version()); } } 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; } void CMsgInviteToLobby::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgInviteToLobby* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgInviteToLobby*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgInviteToLobby::MergeFrom(const CMsgInviteToLobby& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_steam_id()) { set_steam_id(from.steam_id()); } if (from.has_client_version()) { set_client_version(from.client_version()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgInviteToLobby::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgInviteToLobby::CopyFrom(const CMsgInviteToLobby& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgInviteToLobby::IsInitialized() const { return true; } void CMsgInviteToLobby::Swap(CMsgInviteToLobby* other) { if (other != this) { std::swap(steam_id_, other->steam_id_); std::swap(client_version_, other->client_version_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgInviteToLobby::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgInviteToLobby_descriptor_; metadata.reflection = CMsgInviteToLobby_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgInvitationCreated::kGroupIdFieldNumber; const int CMsgInvitationCreated::kSteamIdFieldNumber; const int CMsgInvitationCreated::kUserOfflineFieldNumber; #endif // !_MSC_VER CMsgInvitationCreated::CMsgInvitationCreated() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgInvitationCreated) } void CMsgInvitationCreated::InitAsDefaultInstance() { } CMsgInvitationCreated::CMsgInvitationCreated(const CMsgInvitationCreated& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgInvitationCreated) } void CMsgInvitationCreated::SharedCtor() { _cached_size_ = 0; group_id_ = GOOGLE_ULONGLONG(0); steam_id_ = GOOGLE_ULONGLONG(0); user_offline_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgInvitationCreated::~CMsgInvitationCreated() { // @@protoc_insertion_point(destructor:CMsgInvitationCreated) SharedDtor(); } void CMsgInvitationCreated::SharedDtor() { if (this != default_instance_) { } } void CMsgInvitationCreated::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgInvitationCreated::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgInvitationCreated_descriptor_; } const CMsgInvitationCreated& CMsgInvitationCreated::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgInvitationCreated* CMsgInvitationCreated::default_instance_ = NULL; CMsgInvitationCreated* CMsgInvitationCreated::New() const { return new CMsgInvitationCreated; } void CMsgInvitationCreated::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgInvitationCreated*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(group_id_, user_offline_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgInvitationCreated::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgInvitationCreated) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 group_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &group_id_))); set_has_group_id(); } else { goto handle_unusual; } if (input->ExpectTag(17)) goto parse_steam_id; break; } // optional fixed64 steam_id = 2; case 2: { if (tag == 17) { parse_steam_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &steam_id_))); set_has_steam_id(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_user_offline; break; } // optional bool user_offline = 3; case 3: { if (tag == 24) { parse_user_offline: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &user_offline_))); set_has_user_offline(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgInvitationCreated) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgInvitationCreated) return false; #undef DO_ } void CMsgInvitationCreated::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgInvitationCreated) // optional uint64 group_id = 1; if (has_group_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->group_id(), output); } // optional fixed64 steam_id = 2; if (has_steam_id()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(2, this->steam_id(), output); } // optional bool user_offline = 3; if (has_user_offline()) { ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->user_offline(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgInvitationCreated) } ::google::protobuf::uint8* CMsgInvitationCreated::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgInvitationCreated) // optional uint64 group_id = 1; if (has_group_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->group_id(), target); } // optional fixed64 steam_id = 2; if (has_steam_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(2, this->steam_id(), target); } // optional bool user_offline = 3; if (has_user_offline()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->user_offline(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgInvitationCreated) return target; } int CMsgInvitationCreated::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 group_id = 1; if (has_group_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->group_id()); } // optional fixed64 steam_id = 2; if (has_steam_id()) { total_size += 1 + 8; } // optional bool user_offline = 3; if (has_user_offline()) { total_size += 1 + 1; } } 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; } void CMsgInvitationCreated::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgInvitationCreated* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgInvitationCreated*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgInvitationCreated::MergeFrom(const CMsgInvitationCreated& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_group_id()) { set_group_id(from.group_id()); } if (from.has_steam_id()) { set_steam_id(from.steam_id()); } if (from.has_user_offline()) { set_user_offline(from.user_offline()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgInvitationCreated::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgInvitationCreated::CopyFrom(const CMsgInvitationCreated& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgInvitationCreated::IsInitialized() const { return true; } void CMsgInvitationCreated::Swap(CMsgInvitationCreated* other) { if (other != this) { std::swap(group_id_, other->group_id_); std::swap(steam_id_, other->steam_id_); std::swap(user_offline_, other->user_offline_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgInvitationCreated::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgInvitationCreated_descriptor_; metadata.reflection = CMsgInvitationCreated_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgPartyInviteResponse::kPartyIdFieldNumber; const int CMsgPartyInviteResponse::kAcceptFieldNumber; const int CMsgPartyInviteResponse::kClientVersionFieldNumber; const int CMsgPartyInviteResponse::kPingDataFieldNumber; #endif // !_MSC_VER CMsgPartyInviteResponse::CMsgPartyInviteResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgPartyInviteResponse) } void CMsgPartyInviteResponse::InitAsDefaultInstance() { ping_data_ = const_cast< ::CMsgClientPingData*>(&::CMsgClientPingData::default_instance()); } CMsgPartyInviteResponse::CMsgPartyInviteResponse(const CMsgPartyInviteResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgPartyInviteResponse) } void CMsgPartyInviteResponse::SharedCtor() { _cached_size_ = 0; party_id_ = GOOGLE_ULONGLONG(0); accept_ = false; client_version_ = 0u; ping_data_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgPartyInviteResponse::~CMsgPartyInviteResponse() { // @@protoc_insertion_point(destructor:CMsgPartyInviteResponse) SharedDtor(); } void CMsgPartyInviteResponse::SharedDtor() { if (this != default_instance_) { delete ping_data_; } } void CMsgPartyInviteResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgPartyInviteResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgPartyInviteResponse_descriptor_; } const CMsgPartyInviteResponse& CMsgPartyInviteResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgPartyInviteResponse* CMsgPartyInviteResponse::default_instance_ = NULL; CMsgPartyInviteResponse* CMsgPartyInviteResponse::New() const { return new CMsgPartyInviteResponse; } void CMsgPartyInviteResponse::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgPartyInviteResponse*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 15) { ZR_(party_id_, client_version_); if (has_ping_data()) { if (ping_data_ != NULL) ping_data_->::CMsgClientPingData::Clear(); } } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgPartyInviteResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgPartyInviteResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 party_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &party_id_))); set_has_party_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_accept; break; } // optional bool accept = 2; case 2: { if (tag == 16) { parse_accept: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &accept_))); set_has_accept(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_client_version; break; } // optional uint32 client_version = 3; case 3: { if (tag == 24) { parse_client_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &client_version_))); set_has_client_version(); } else { goto handle_unusual; } if (input->ExpectTag(66)) goto parse_ping_data; break; } // optional .CMsgClientPingData ping_data = 8; case 8: { if (tag == 66) { parse_ping_data: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_ping_data())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgPartyInviteResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgPartyInviteResponse) return false; #undef DO_ } void CMsgPartyInviteResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgPartyInviteResponse) // optional uint64 party_id = 1; if (has_party_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->party_id(), output); } // optional bool accept = 2; if (has_accept()) { ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->accept(), output); } // optional uint32 client_version = 3; if (has_client_version()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->client_version(), output); } // optional .CMsgClientPingData ping_data = 8; if (has_ping_data()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 8, this->ping_data(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgPartyInviteResponse) } ::google::protobuf::uint8* CMsgPartyInviteResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgPartyInviteResponse) // optional uint64 party_id = 1; if (has_party_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->party_id(), target); } // optional bool accept = 2; if (has_accept()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->accept(), target); } // optional uint32 client_version = 3; if (has_client_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->client_version(), target); } // optional .CMsgClientPingData ping_data = 8; if (has_ping_data()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 8, this->ping_data(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgPartyInviteResponse) return target; } int CMsgPartyInviteResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 party_id = 1; if (has_party_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->party_id()); } // optional bool accept = 2; if (has_accept()) { total_size += 1 + 1; } // optional uint32 client_version = 3; if (has_client_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->client_version()); } // optional .CMsgClientPingData ping_data = 8; if (has_ping_data()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->ping_data()); } } 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; } void CMsgPartyInviteResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgPartyInviteResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgPartyInviteResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgPartyInviteResponse::MergeFrom(const CMsgPartyInviteResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_party_id()) { set_party_id(from.party_id()); } if (from.has_accept()) { set_accept(from.accept()); } if (from.has_client_version()) { set_client_version(from.client_version()); } if (from.has_ping_data()) { mutable_ping_data()->::CMsgClientPingData::MergeFrom(from.ping_data()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgPartyInviteResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgPartyInviteResponse::CopyFrom(const CMsgPartyInviteResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgPartyInviteResponse::IsInitialized() const { return true; } void CMsgPartyInviteResponse::Swap(CMsgPartyInviteResponse* other) { if (other != this) { std::swap(party_id_, other->party_id_); std::swap(accept_, other->accept_); std::swap(client_version_, other->client_version_); std::swap(ping_data_, other->ping_data_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgPartyInviteResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgPartyInviteResponse_descriptor_; metadata.reflection = CMsgPartyInviteResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgLobbyInviteResponse::kLobbyIdFieldNumber; const int CMsgLobbyInviteResponse::kAcceptFieldNumber; const int CMsgLobbyInviteResponse::kClientVersionFieldNumber; const int CMsgLobbyInviteResponse::kCustomGameCrcFieldNumber; const int CMsgLobbyInviteResponse::kCustomGameTimestampFieldNumber; #endif // !_MSC_VER CMsgLobbyInviteResponse::CMsgLobbyInviteResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgLobbyInviteResponse) } void CMsgLobbyInviteResponse::InitAsDefaultInstance() { } CMsgLobbyInviteResponse::CMsgLobbyInviteResponse(const CMsgLobbyInviteResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgLobbyInviteResponse) } void CMsgLobbyInviteResponse::SharedCtor() { _cached_size_ = 0; lobby_id_ = GOOGLE_ULONGLONG(0); accept_ = false; client_version_ = 0u; custom_game_crc_ = GOOGLE_ULONGLONG(0); custom_game_timestamp_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgLobbyInviteResponse::~CMsgLobbyInviteResponse() { // @@protoc_insertion_point(destructor:CMsgLobbyInviteResponse) SharedDtor(); } void CMsgLobbyInviteResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgLobbyInviteResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgLobbyInviteResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgLobbyInviteResponse_descriptor_; } const CMsgLobbyInviteResponse& CMsgLobbyInviteResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgLobbyInviteResponse* CMsgLobbyInviteResponse::default_instance_ = NULL; CMsgLobbyInviteResponse* CMsgLobbyInviteResponse::New() const { return new CMsgLobbyInviteResponse; } void CMsgLobbyInviteResponse::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgLobbyInviteResponse*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 31) { ZR_(lobby_id_, custom_game_timestamp_); } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgLobbyInviteResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgLobbyInviteResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional fixed64 lobby_id = 1; case 1: { if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &lobby_id_))); set_has_lobby_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_accept; break; } // optional bool accept = 2; case 2: { if (tag == 16) { parse_accept: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &accept_))); set_has_accept(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_client_version; break; } // optional uint32 client_version = 3; case 3: { if (tag == 24) { parse_client_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &client_version_))); set_has_client_version(); } else { goto handle_unusual; } if (input->ExpectTag(49)) goto parse_custom_game_crc; break; } // optional fixed64 custom_game_crc = 6; case 6: { if (tag == 49) { parse_custom_game_crc: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &custom_game_crc_))); set_has_custom_game_crc(); } else { goto handle_unusual; } if (input->ExpectTag(61)) goto parse_custom_game_timestamp; break; } // optional fixed32 custom_game_timestamp = 7; case 7: { if (tag == 61) { parse_custom_game_timestamp: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &custom_game_timestamp_))); set_has_custom_game_timestamp(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgLobbyInviteResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgLobbyInviteResponse) return false; #undef DO_ } void CMsgLobbyInviteResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgLobbyInviteResponse) // optional fixed64 lobby_id = 1; if (has_lobby_id()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(1, this->lobby_id(), output); } // optional bool accept = 2; if (has_accept()) { ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->accept(), output); } // optional uint32 client_version = 3; if (has_client_version()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->client_version(), output); } // optional fixed64 custom_game_crc = 6; if (has_custom_game_crc()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(6, this->custom_game_crc(), output); } // optional fixed32 custom_game_timestamp = 7; if (has_custom_game_timestamp()) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(7, this->custom_game_timestamp(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgLobbyInviteResponse) } ::google::protobuf::uint8* CMsgLobbyInviteResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgLobbyInviteResponse) // optional fixed64 lobby_id = 1; if (has_lobby_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(1, this->lobby_id(), target); } // optional bool accept = 2; if (has_accept()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->accept(), target); } // optional uint32 client_version = 3; if (has_client_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->client_version(), target); } // optional fixed64 custom_game_crc = 6; if (has_custom_game_crc()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(6, this->custom_game_crc(), target); } // optional fixed32 custom_game_timestamp = 7; if (has_custom_game_timestamp()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(7, this->custom_game_timestamp(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgLobbyInviteResponse) return target; } int CMsgLobbyInviteResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional fixed64 lobby_id = 1; if (has_lobby_id()) { total_size += 1 + 8; } // optional bool accept = 2; if (has_accept()) { total_size += 1 + 1; } // optional uint32 client_version = 3; if (has_client_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->client_version()); } // optional fixed64 custom_game_crc = 6; if (has_custom_game_crc()) { total_size += 1 + 8; } // optional fixed32 custom_game_timestamp = 7; if (has_custom_game_timestamp()) { total_size += 1 + 4; } } 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; } void CMsgLobbyInviteResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgLobbyInviteResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgLobbyInviteResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgLobbyInviteResponse::MergeFrom(const CMsgLobbyInviteResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_lobby_id()) { set_lobby_id(from.lobby_id()); } if (from.has_accept()) { set_accept(from.accept()); } if (from.has_client_version()) { set_client_version(from.client_version()); } if (from.has_custom_game_crc()) { set_custom_game_crc(from.custom_game_crc()); } if (from.has_custom_game_timestamp()) { set_custom_game_timestamp(from.custom_game_timestamp()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgLobbyInviteResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgLobbyInviteResponse::CopyFrom(const CMsgLobbyInviteResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgLobbyInviteResponse::IsInitialized() const { return true; } void CMsgLobbyInviteResponse::Swap(CMsgLobbyInviteResponse* other) { if (other != this) { std::swap(lobby_id_, other->lobby_id_); std::swap(accept_, other->accept_); std::swap(client_version_, other->client_version_); std::swap(custom_game_crc_, other->custom_game_crc_); std::swap(custom_game_timestamp_, other->custom_game_timestamp_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgLobbyInviteResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgLobbyInviteResponse_descriptor_; metadata.reflection = CMsgLobbyInviteResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgKickFromParty::kSteamIdFieldNumber; #endif // !_MSC_VER CMsgKickFromParty::CMsgKickFromParty() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgKickFromParty) } void CMsgKickFromParty::InitAsDefaultInstance() { } CMsgKickFromParty::CMsgKickFromParty(const CMsgKickFromParty& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgKickFromParty) } void CMsgKickFromParty::SharedCtor() { _cached_size_ = 0; steam_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgKickFromParty::~CMsgKickFromParty() { // @@protoc_insertion_point(destructor:CMsgKickFromParty) SharedDtor(); } void CMsgKickFromParty::SharedDtor() { if (this != default_instance_) { } } void CMsgKickFromParty::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgKickFromParty::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgKickFromParty_descriptor_; } const CMsgKickFromParty& CMsgKickFromParty::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgKickFromParty* CMsgKickFromParty::default_instance_ = NULL; CMsgKickFromParty* CMsgKickFromParty::New() const { return new CMsgKickFromParty; } void CMsgKickFromParty::Clear() { steam_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgKickFromParty::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgKickFromParty) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional fixed64 steam_id = 1; case 1: { if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &steam_id_))); set_has_steam_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgKickFromParty) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgKickFromParty) return false; #undef DO_ } void CMsgKickFromParty::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgKickFromParty) // optional fixed64 steam_id = 1; if (has_steam_id()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(1, this->steam_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgKickFromParty) } ::google::protobuf::uint8* CMsgKickFromParty::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgKickFromParty) // optional fixed64 steam_id = 1; if (has_steam_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(1, this->steam_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgKickFromParty) return target; } int CMsgKickFromParty::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional fixed64 steam_id = 1; if (has_steam_id()) { total_size += 1 + 8; } } 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; } void CMsgKickFromParty::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgKickFromParty* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgKickFromParty*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgKickFromParty::MergeFrom(const CMsgKickFromParty& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_steam_id()) { set_steam_id(from.steam_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgKickFromParty::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgKickFromParty::CopyFrom(const CMsgKickFromParty& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgKickFromParty::IsInitialized() const { return true; } void CMsgKickFromParty::Swap(CMsgKickFromParty* other) { if (other != this) { std::swap(steam_id_, other->steam_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgKickFromParty::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgKickFromParty_descriptor_; metadata.reflection = CMsgKickFromParty_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER CMsgLeaveParty::CMsgLeaveParty() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgLeaveParty) } void CMsgLeaveParty::InitAsDefaultInstance() { } CMsgLeaveParty::CMsgLeaveParty(const CMsgLeaveParty& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgLeaveParty) } void CMsgLeaveParty::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgLeaveParty::~CMsgLeaveParty() { // @@protoc_insertion_point(destructor:CMsgLeaveParty) SharedDtor(); } void CMsgLeaveParty::SharedDtor() { if (this != default_instance_) { } } void CMsgLeaveParty::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgLeaveParty::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgLeaveParty_descriptor_; } const CMsgLeaveParty& CMsgLeaveParty::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgLeaveParty* CMsgLeaveParty::default_instance_ = NULL; CMsgLeaveParty* CMsgLeaveParty::New() const { return new CMsgLeaveParty; } void CMsgLeaveParty::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgLeaveParty::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgLeaveParty) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } success: // @@protoc_insertion_point(parse_success:CMsgLeaveParty) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgLeaveParty) return false; #undef DO_ } void CMsgLeaveParty::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgLeaveParty) if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgLeaveParty) } ::google::protobuf::uint8* CMsgLeaveParty::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgLeaveParty) if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgLeaveParty) return target; } int CMsgLeaveParty::ByteSize() const { int total_size = 0; 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; } void CMsgLeaveParty::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgLeaveParty* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgLeaveParty*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgLeaveParty::MergeFrom(const CMsgLeaveParty& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgLeaveParty::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgLeaveParty::CopyFrom(const CMsgLeaveParty& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgLeaveParty::IsInitialized() const { return true; } void CMsgLeaveParty::Swap(CMsgLeaveParty* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgLeaveParty::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgLeaveParty_descriptor_; metadata.reflection = CMsgLeaveParty_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgCustomGameInstallStatus::kStatusFieldNumber; const int CMsgCustomGameInstallStatus::kMessageFieldNumber; const int CMsgCustomGameInstallStatus::kLatestTimestampFromSteamFieldNumber; #endif // !_MSC_VER CMsgCustomGameInstallStatus::CMsgCustomGameInstallStatus() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgCustomGameInstallStatus) } void CMsgCustomGameInstallStatus::InitAsDefaultInstance() { } CMsgCustomGameInstallStatus::CMsgCustomGameInstallStatus(const CMsgCustomGameInstallStatus& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgCustomGameInstallStatus) } void CMsgCustomGameInstallStatus::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; status_ = 0; message_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); latest_timestamp_from_steam_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgCustomGameInstallStatus::~CMsgCustomGameInstallStatus() { // @@protoc_insertion_point(destructor:CMsgCustomGameInstallStatus) SharedDtor(); } void CMsgCustomGameInstallStatus::SharedDtor() { if (message_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete message_; } if (this != default_instance_) { } } void CMsgCustomGameInstallStatus::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgCustomGameInstallStatus::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgCustomGameInstallStatus_descriptor_; } const CMsgCustomGameInstallStatus& CMsgCustomGameInstallStatus::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgCustomGameInstallStatus* CMsgCustomGameInstallStatus::default_instance_ = NULL; CMsgCustomGameInstallStatus* CMsgCustomGameInstallStatus::New() const { return new CMsgCustomGameInstallStatus; } void CMsgCustomGameInstallStatus::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgCustomGameInstallStatus*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 7) { ZR_(status_, latest_timestamp_from_steam_); if (has_message()) { if (message_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { message_->clear(); } } } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgCustomGameInstallStatus::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgCustomGameInstallStatus) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .ECustomGameInstallStatus status = 1 [default = k_ECustomGameInstallStatus_Unknown]; case 1: { if (tag == 8) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::ECustomGameInstallStatus_IsValid(value)) { set_status(static_cast< ::ECustomGameInstallStatus >(value)); } else { mutable_unknown_fields()->AddVarint(1, value); } } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_message; break; } // optional string message = 2; case 2: { if (tag == 18) { parse_message: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_message())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->message().data(), this->message().length(), ::google::protobuf::internal::WireFormat::PARSE, "message"); } else { goto handle_unusual; } if (input->ExpectTag(29)) goto parse_latest_timestamp_from_steam; break; } // optional fixed32 latest_timestamp_from_steam = 3; case 3: { if (tag == 29) { parse_latest_timestamp_from_steam: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &latest_timestamp_from_steam_))); set_has_latest_timestamp_from_steam(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgCustomGameInstallStatus) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgCustomGameInstallStatus) return false; #undef DO_ } void CMsgCustomGameInstallStatus::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgCustomGameInstallStatus) // optional .ECustomGameInstallStatus status = 1 [default = k_ECustomGameInstallStatus_Unknown]; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 1, this->status(), output); } // optional string message = 2; if (has_message()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->message().data(), this->message().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "message"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->message(), output); } // optional fixed32 latest_timestamp_from_steam = 3; if (has_latest_timestamp_from_steam()) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(3, this->latest_timestamp_from_steam(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgCustomGameInstallStatus) } ::google::protobuf::uint8* CMsgCustomGameInstallStatus::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgCustomGameInstallStatus) // optional .ECustomGameInstallStatus status = 1 [default = k_ECustomGameInstallStatus_Unknown]; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 1, this->status(), target); } // optional string message = 2; if (has_message()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->message().data(), this->message().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "message"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->message(), target); } // optional fixed32 latest_timestamp_from_steam = 3; if (has_latest_timestamp_from_steam()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(3, this->latest_timestamp_from_steam(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgCustomGameInstallStatus) return target; } int CMsgCustomGameInstallStatus::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional .ECustomGameInstallStatus status = 1 [default = k_ECustomGameInstallStatus_Unknown]; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->status()); } // optional string message = 2; if (has_message()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->message()); } // optional fixed32 latest_timestamp_from_steam = 3; if (has_latest_timestamp_from_steam()) { total_size += 1 + 4; } } 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; } void CMsgCustomGameInstallStatus::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgCustomGameInstallStatus* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgCustomGameInstallStatus*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgCustomGameInstallStatus::MergeFrom(const CMsgCustomGameInstallStatus& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_status()) { set_status(from.status()); } if (from.has_message()) { set_message(from.message()); } if (from.has_latest_timestamp_from_steam()) { set_latest_timestamp_from_steam(from.latest_timestamp_from_steam()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgCustomGameInstallStatus::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgCustomGameInstallStatus::CopyFrom(const CMsgCustomGameInstallStatus& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgCustomGameInstallStatus::IsInitialized() const { return true; } void CMsgCustomGameInstallStatus::Swap(CMsgCustomGameInstallStatus* other) { if (other != this) { std::swap(status_, other->status_); std::swap(message_, other->message_); std::swap(latest_timestamp_from_steam_, other->latest_timestamp_from_steam_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgCustomGameInstallStatus::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgCustomGameInstallStatus_descriptor_; metadata.reflection = CMsgCustomGameInstallStatus_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgServerAvailable::kCustomGameInstallStatusFieldNumber; #endif // !_MSC_VER CMsgServerAvailable::CMsgServerAvailable() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgServerAvailable) } void CMsgServerAvailable::InitAsDefaultInstance() { custom_game_install_status_ = const_cast< ::CMsgCustomGameInstallStatus*>(&::CMsgCustomGameInstallStatus::default_instance()); } CMsgServerAvailable::CMsgServerAvailable(const CMsgServerAvailable& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgServerAvailable) } void CMsgServerAvailable::SharedCtor() { _cached_size_ = 0; custom_game_install_status_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgServerAvailable::~CMsgServerAvailable() { // @@protoc_insertion_point(destructor:CMsgServerAvailable) SharedDtor(); } void CMsgServerAvailable::SharedDtor() { if (this != default_instance_) { delete custom_game_install_status_; } } void CMsgServerAvailable::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgServerAvailable::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgServerAvailable_descriptor_; } const CMsgServerAvailable& CMsgServerAvailable::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgServerAvailable* CMsgServerAvailable::default_instance_ = NULL; CMsgServerAvailable* CMsgServerAvailable::New() const { return new CMsgServerAvailable; } void CMsgServerAvailable::Clear() { if (has_custom_game_install_status()) { if (custom_game_install_status_ != NULL) custom_game_install_status_->::CMsgCustomGameInstallStatus::Clear(); } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgServerAvailable::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgServerAvailable) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .CMsgCustomGameInstallStatus custom_game_install_status = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_custom_game_install_status())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgServerAvailable) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgServerAvailable) return false; #undef DO_ } void CMsgServerAvailable::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgServerAvailable) // optional .CMsgCustomGameInstallStatus custom_game_install_status = 1; if (has_custom_game_install_status()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1, this->custom_game_install_status(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgServerAvailable) } ::google::protobuf::uint8* CMsgServerAvailable::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgServerAvailable) // optional .CMsgCustomGameInstallStatus custom_game_install_status = 1; if (has_custom_game_install_status()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 1, this->custom_game_install_status(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgServerAvailable) return target; } int CMsgServerAvailable::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional .CMsgCustomGameInstallStatus custom_game_install_status = 1; if (has_custom_game_install_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->custom_game_install_status()); } } 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; } void CMsgServerAvailable::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgServerAvailable* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgServerAvailable*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgServerAvailable::MergeFrom(const CMsgServerAvailable& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_custom_game_install_status()) { mutable_custom_game_install_status()->::CMsgCustomGameInstallStatus::MergeFrom(from.custom_game_install_status()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgServerAvailable::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgServerAvailable::CopyFrom(const CMsgServerAvailable& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgServerAvailable::IsInitialized() const { return true; } void CMsgServerAvailable::Swap(CMsgServerAvailable* other) { if (other != this) { std::swap(custom_game_install_status_, other->custom_game_install_status_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgServerAvailable::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgServerAvailable_descriptor_; metadata.reflection = CMsgServerAvailable_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgLANServerAvailable::kLobbyIdFieldNumber; #endif // !_MSC_VER CMsgLANServerAvailable::CMsgLANServerAvailable() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgLANServerAvailable) } void CMsgLANServerAvailable::InitAsDefaultInstance() { } CMsgLANServerAvailable::CMsgLANServerAvailable(const CMsgLANServerAvailable& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgLANServerAvailable) } void CMsgLANServerAvailable::SharedCtor() { _cached_size_ = 0; lobby_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgLANServerAvailable::~CMsgLANServerAvailable() { // @@protoc_insertion_point(destructor:CMsgLANServerAvailable) SharedDtor(); } void CMsgLANServerAvailable::SharedDtor() { if (this != default_instance_) { } } void CMsgLANServerAvailable::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgLANServerAvailable::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgLANServerAvailable_descriptor_; } const CMsgLANServerAvailable& CMsgLANServerAvailable::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgLANServerAvailable* CMsgLANServerAvailable::default_instance_ = NULL; CMsgLANServerAvailable* CMsgLANServerAvailable::New() const { return new CMsgLANServerAvailable; } void CMsgLANServerAvailable::Clear() { lobby_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgLANServerAvailable::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgLANServerAvailable) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional fixed64 lobby_id = 1; case 1: { if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &lobby_id_))); set_has_lobby_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgLANServerAvailable) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgLANServerAvailable) return false; #undef DO_ } void CMsgLANServerAvailable::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgLANServerAvailable) // optional fixed64 lobby_id = 1; if (has_lobby_id()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(1, this->lobby_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgLANServerAvailable) } ::google::protobuf::uint8* CMsgLANServerAvailable::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgLANServerAvailable) // optional fixed64 lobby_id = 1; if (has_lobby_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(1, this->lobby_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgLANServerAvailable) return target; } int CMsgLANServerAvailable::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional fixed64 lobby_id = 1; if (has_lobby_id()) { total_size += 1 + 8; } } 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; } void CMsgLANServerAvailable::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgLANServerAvailable* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgLANServerAvailable*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgLANServerAvailable::MergeFrom(const CMsgLANServerAvailable& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_lobby_id()) { set_lobby_id(from.lobby_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgLANServerAvailable::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgLANServerAvailable::CopyFrom(const CMsgLANServerAvailable& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgLANServerAvailable::IsInitialized() const { return true; } void CMsgLANServerAvailable::Swap(CMsgLANServerAvailable* other) { if (other != this) { std::swap(lobby_id_, other->lobby_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgLANServerAvailable::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgLANServerAvailable_descriptor_; metadata.reflection = CMsgLANServerAvailable_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconGameAccountClient::kAdditionalBackpackSlotsFieldNumber; const int CSOEconGameAccountClient::kTrialAccountFieldNumber; const int CSOEconGameAccountClient::kEligibleForOnlinePlayFieldNumber; const int CSOEconGameAccountClient::kNeedToChooseMostHelpfulFriendFieldNumber; const int CSOEconGameAccountClient::kInCoachesListFieldNumber; const int CSOEconGameAccountClient::kTradeBanExpirationFieldNumber; const int CSOEconGameAccountClient::kDuelBanExpirationFieldNumber; const int CSOEconGameAccountClient::kMadeFirstPurchaseFieldNumber; #endif // !_MSC_VER CSOEconGameAccountClient::CSOEconGameAccountClient() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconGameAccountClient) } void CSOEconGameAccountClient::InitAsDefaultInstance() { } CSOEconGameAccountClient::CSOEconGameAccountClient(const CSOEconGameAccountClient& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconGameAccountClient) } void CSOEconGameAccountClient::SharedCtor() { _cached_size_ = 0; additional_backpack_slots_ = 0u; trial_account_ = false; eligible_for_online_play_ = true; need_to_choose_most_helpful_friend_ = false; in_coaches_list_ = false; trade_ban_expiration_ = 0u; duel_ban_expiration_ = 0u; made_first_purchase_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconGameAccountClient::~CSOEconGameAccountClient() { // @@protoc_insertion_point(destructor:CSOEconGameAccountClient) SharedDtor(); } void CSOEconGameAccountClient::SharedDtor() { if (this != default_instance_) { } } void CSOEconGameAccountClient::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconGameAccountClient::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconGameAccountClient_descriptor_; } const CSOEconGameAccountClient& CSOEconGameAccountClient::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconGameAccountClient* CSOEconGameAccountClient::default_instance_ = NULL; CSOEconGameAccountClient* CSOEconGameAccountClient::New() const { return new CSOEconGameAccountClient; } void CSOEconGameAccountClient::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconGameAccountClient*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 255) { ZR_(additional_backpack_slots_, trial_account_); ZR_(need_to_choose_most_helpful_friend_, made_first_purchase_); eligible_for_online_play_ = true; } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconGameAccountClient::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconGameAccountClient) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 additional_backpack_slots = 1 [default = 0]; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &additional_backpack_slots_))); set_has_additional_backpack_slots(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_trial_account; break; } // optional bool trial_account = 2 [default = false]; case 2: { if (tag == 16) { parse_trial_account: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &trial_account_))); set_has_trial_account(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_eligible_for_online_play; break; } // optional bool eligible_for_online_play = 3 [default = true]; case 3: { if (tag == 24) { parse_eligible_for_online_play: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &eligible_for_online_play_))); set_has_eligible_for_online_play(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_need_to_choose_most_helpful_friend; break; } // optional bool need_to_choose_most_helpful_friend = 4; case 4: { if (tag == 32) { parse_need_to_choose_most_helpful_friend: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &need_to_choose_most_helpful_friend_))); set_has_need_to_choose_most_helpful_friend(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_in_coaches_list; break; } // optional bool in_coaches_list = 5; case 5: { if (tag == 40) { parse_in_coaches_list: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &in_coaches_list_))); set_has_in_coaches_list(); } else { goto handle_unusual; } if (input->ExpectTag(53)) goto parse_trade_ban_expiration; break; } // optional fixed32 trade_ban_expiration = 6; case 6: { if (tag == 53) { parse_trade_ban_expiration: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &trade_ban_expiration_))); set_has_trade_ban_expiration(); } else { goto handle_unusual; } if (input->ExpectTag(61)) goto parse_duel_ban_expiration; break; } // optional fixed32 duel_ban_expiration = 7; case 7: { if (tag == 61) { parse_duel_ban_expiration: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &duel_ban_expiration_))); set_has_duel_ban_expiration(); } else { goto handle_unusual; } if (input->ExpectTag(72)) goto parse_made_first_purchase; break; } // optional bool made_first_purchase = 9 [default = false]; case 9: { if (tag == 72) { parse_made_first_purchase: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &made_first_purchase_))); set_has_made_first_purchase(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconGameAccountClient) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconGameAccountClient) return false; #undef DO_ } void CSOEconGameAccountClient::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconGameAccountClient) // optional uint32 additional_backpack_slots = 1 [default = 0]; if (has_additional_backpack_slots()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->additional_backpack_slots(), output); } // optional bool trial_account = 2 [default = false]; if (has_trial_account()) { ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->trial_account(), output); } // optional bool eligible_for_online_play = 3 [default = true]; if (has_eligible_for_online_play()) { ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->eligible_for_online_play(), output); } // optional bool need_to_choose_most_helpful_friend = 4; if (has_need_to_choose_most_helpful_friend()) { ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->need_to_choose_most_helpful_friend(), output); } // optional bool in_coaches_list = 5; if (has_in_coaches_list()) { ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->in_coaches_list(), output); } // optional fixed32 trade_ban_expiration = 6; if (has_trade_ban_expiration()) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(6, this->trade_ban_expiration(), output); } // optional fixed32 duel_ban_expiration = 7; if (has_duel_ban_expiration()) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(7, this->duel_ban_expiration(), output); } // optional bool made_first_purchase = 9 [default = false]; if (has_made_first_purchase()) { ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->made_first_purchase(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconGameAccountClient) } ::google::protobuf::uint8* CSOEconGameAccountClient::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconGameAccountClient) // optional uint32 additional_backpack_slots = 1 [default = 0]; if (has_additional_backpack_slots()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->additional_backpack_slots(), target); } // optional bool trial_account = 2 [default = false]; if (has_trial_account()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->trial_account(), target); } // optional bool eligible_for_online_play = 3 [default = true]; if (has_eligible_for_online_play()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->eligible_for_online_play(), target); } // optional bool need_to_choose_most_helpful_friend = 4; if (has_need_to_choose_most_helpful_friend()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->need_to_choose_most_helpful_friend(), target); } // optional bool in_coaches_list = 5; if (has_in_coaches_list()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->in_coaches_list(), target); } // optional fixed32 trade_ban_expiration = 6; if (has_trade_ban_expiration()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(6, this->trade_ban_expiration(), target); } // optional fixed32 duel_ban_expiration = 7; if (has_duel_ban_expiration()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(7, this->duel_ban_expiration(), target); } // optional bool made_first_purchase = 9 [default = false]; if (has_made_first_purchase()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(9, this->made_first_purchase(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconGameAccountClient) return target; } int CSOEconGameAccountClient::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 additional_backpack_slots = 1 [default = 0]; if (has_additional_backpack_slots()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->additional_backpack_slots()); } // optional bool trial_account = 2 [default = false]; if (has_trial_account()) { total_size += 1 + 1; } // optional bool eligible_for_online_play = 3 [default = true]; if (has_eligible_for_online_play()) { total_size += 1 + 1; } // optional bool need_to_choose_most_helpful_friend = 4; if (has_need_to_choose_most_helpful_friend()) { total_size += 1 + 1; } // optional bool in_coaches_list = 5; if (has_in_coaches_list()) { total_size += 1 + 1; } // optional fixed32 trade_ban_expiration = 6; if (has_trade_ban_expiration()) { total_size += 1 + 4; } // optional fixed32 duel_ban_expiration = 7; if (has_duel_ban_expiration()) { total_size += 1 + 4; } // optional bool made_first_purchase = 9 [default = false]; if (has_made_first_purchase()) { total_size += 1 + 1; } } 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; } void CSOEconGameAccountClient::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconGameAccountClient* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconGameAccountClient*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconGameAccountClient::MergeFrom(const CSOEconGameAccountClient& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_additional_backpack_slots()) { set_additional_backpack_slots(from.additional_backpack_slots()); } if (from.has_trial_account()) { set_trial_account(from.trial_account()); } if (from.has_eligible_for_online_play()) { set_eligible_for_online_play(from.eligible_for_online_play()); } if (from.has_need_to_choose_most_helpful_friend()) { set_need_to_choose_most_helpful_friend(from.need_to_choose_most_helpful_friend()); } if (from.has_in_coaches_list()) { set_in_coaches_list(from.in_coaches_list()); } if (from.has_trade_ban_expiration()) { set_trade_ban_expiration(from.trade_ban_expiration()); } if (from.has_duel_ban_expiration()) { set_duel_ban_expiration(from.duel_ban_expiration()); } if (from.has_made_first_purchase()) { set_made_first_purchase(from.made_first_purchase()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconGameAccountClient::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconGameAccountClient::CopyFrom(const CSOEconGameAccountClient& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconGameAccountClient::IsInitialized() const { return true; } void CSOEconGameAccountClient::Swap(CSOEconGameAccountClient* other) { if (other != this) { std::swap(additional_backpack_slots_, other->additional_backpack_slots_); std::swap(trial_account_, other->trial_account_); std::swap(eligible_for_online_play_, other->eligible_for_online_play_); std::swap(need_to_choose_most_helpful_friend_, other->need_to_choose_most_helpful_friend_); std::swap(in_coaches_list_, other->in_coaches_list_); std::swap(trade_ban_expiration_, other->trade_ban_expiration_); std::swap(duel_ban_expiration_, other->duel_ban_expiration_); std::swap(made_first_purchase_, other->made_first_purchase_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconGameAccountClient::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconGameAccountClient_descriptor_; metadata.reflection = CSOEconGameAccountClient_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOItemCriteriaCondition::kOpFieldNumber; const int CSOItemCriteriaCondition::kFieldFieldNumber; const int CSOItemCriteriaCondition::kRequiredFieldNumber; const int CSOItemCriteriaCondition::kFloatValueFieldNumber; const int CSOItemCriteriaCondition::kStringValueFieldNumber; #endif // !_MSC_VER CSOItemCriteriaCondition::CSOItemCriteriaCondition() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOItemCriteriaCondition) } void CSOItemCriteriaCondition::InitAsDefaultInstance() { } CSOItemCriteriaCondition::CSOItemCriteriaCondition(const CSOItemCriteriaCondition& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOItemCriteriaCondition) } void CSOItemCriteriaCondition::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; op_ = 0; field_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); required_ = false; float_value_ = 0; string_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOItemCriteriaCondition::~CSOItemCriteriaCondition() { // @@protoc_insertion_point(destructor:CSOItemCriteriaCondition) SharedDtor(); } void CSOItemCriteriaCondition::SharedDtor() { if (field_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete field_; } if (string_value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete string_value_; } if (this != default_instance_) { } } void CSOItemCriteriaCondition::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOItemCriteriaCondition::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOItemCriteriaCondition_descriptor_; } const CSOItemCriteriaCondition& CSOItemCriteriaCondition::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOItemCriteriaCondition* CSOItemCriteriaCondition::default_instance_ = NULL; CSOItemCriteriaCondition* CSOItemCriteriaCondition::New() const { return new CSOItemCriteriaCondition; } void CSOItemCriteriaCondition::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOItemCriteriaCondition*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 31) { ZR_(op_, required_); if (has_field()) { if (field_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { field_->clear(); } } float_value_ = 0; if (has_string_value()) { if (string_value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { string_value_->clear(); } } } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOItemCriteriaCondition::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOItemCriteriaCondition) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 op = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &op_))); set_has_op(); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_field; break; } // optional string field = 2; case 2: { if (tag == 18) { parse_field: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_field())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->field().data(), this->field().length(), ::google::protobuf::internal::WireFormat::PARSE, "field"); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_required; break; } // optional bool required = 3; case 3: { if (tag == 24) { parse_required: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &required_))); set_has_required(); } else { goto handle_unusual; } if (input->ExpectTag(37)) goto parse_float_value; break; } // optional float float_value = 4; case 4: { if (tag == 37) { parse_float_value: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &float_value_))); set_has_float_value(); } else { goto handle_unusual; } if (input->ExpectTag(42)) goto parse_string_value; break; } // optional string string_value = 5; case 5: { if (tag == 42) { parse_string_value: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_string_value())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->string_value().data(), this->string_value().length(), ::google::protobuf::internal::WireFormat::PARSE, "string_value"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOItemCriteriaCondition) return true; failure: // @@protoc_insertion_point(parse_failure:CSOItemCriteriaCondition) return false; #undef DO_ } void CSOItemCriteriaCondition::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOItemCriteriaCondition) // optional int32 op = 1; if (has_op()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->op(), output); } // optional string field = 2; if (has_field()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->field().data(), this->field().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "field"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->field(), output); } // optional bool required = 3; if (has_required()) { ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->required(), output); } // optional float float_value = 4; if (has_float_value()) { ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->float_value(), output); } // optional string string_value = 5; if (has_string_value()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->string_value().data(), this->string_value().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "string_value"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 5, this->string_value(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOItemCriteriaCondition) } ::google::protobuf::uint8* CSOItemCriteriaCondition::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOItemCriteriaCondition) // optional int32 op = 1; if (has_op()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->op(), target); } // optional string field = 2; if (has_field()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->field().data(), this->field().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "field"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->field(), target); } // optional bool required = 3; if (has_required()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->required(), target); } // optional float float_value = 4; if (has_float_value()) { target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->float_value(), target); } // optional string string_value = 5; if (has_string_value()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->string_value().data(), this->string_value().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "string_value"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 5, this->string_value(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOItemCriteriaCondition) return target; } int CSOItemCriteriaCondition::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 op = 1; if (has_op()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->op()); } // optional string field = 2; if (has_field()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->field()); } // optional bool required = 3; if (has_required()) { total_size += 1 + 1; } // optional float float_value = 4; if (has_float_value()) { total_size += 1 + 4; } // optional string string_value = 5; if (has_string_value()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->string_value()); } } 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; } void CSOItemCriteriaCondition::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOItemCriteriaCondition* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOItemCriteriaCondition*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOItemCriteriaCondition::MergeFrom(const CSOItemCriteriaCondition& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_op()) { set_op(from.op()); } if (from.has_field()) { set_field(from.field()); } if (from.has_required()) { set_required(from.required()); } if (from.has_float_value()) { set_float_value(from.float_value()); } if (from.has_string_value()) { set_string_value(from.string_value()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOItemCriteriaCondition::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOItemCriteriaCondition::CopyFrom(const CSOItemCriteriaCondition& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOItemCriteriaCondition::IsInitialized() const { return true; } void CSOItemCriteriaCondition::Swap(CSOItemCriteriaCondition* other) { if (other != this) { std::swap(op_, other->op_); std::swap(field_, other->field_); std::swap(required_, other->required_); std::swap(float_value_, other->float_value_); std::swap(string_value_, other->string_value_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOItemCriteriaCondition::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOItemCriteriaCondition_descriptor_; metadata.reflection = CSOItemCriteriaCondition_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOItemCriteria::kItemLevelFieldNumber; const int CSOItemCriteria::kItemQualityFieldNumber; const int CSOItemCriteria::kItemLevelSetFieldNumber; const int CSOItemCriteria::kItemQualitySetFieldNumber; const int CSOItemCriteria::kInitialInventoryFieldNumber; const int CSOItemCriteria::kInitialQuantityFieldNumber; const int CSOItemCriteria::kIgnoreEnabledFlagFieldNumber; const int CSOItemCriteria::kConditionsFieldNumber; const int CSOItemCriteria::kRecentOnlyFieldNumber; #endif // !_MSC_VER CSOItemCriteria::CSOItemCriteria() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOItemCriteria) } void CSOItemCriteria::InitAsDefaultInstance() { } CSOItemCriteria::CSOItemCriteria(const CSOItemCriteria& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOItemCriteria) } void CSOItemCriteria::SharedCtor() { _cached_size_ = 0; item_level_ = 0u; item_quality_ = 0; item_level_set_ = false; item_quality_set_ = false; initial_inventory_ = 0u; initial_quantity_ = 0u; ignore_enabled_flag_ = false; recent_only_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOItemCriteria::~CSOItemCriteria() { // @@protoc_insertion_point(destructor:CSOItemCriteria) SharedDtor(); } void CSOItemCriteria::SharedDtor() { if (this != default_instance_) { } } void CSOItemCriteria::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOItemCriteria::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOItemCriteria_descriptor_; } const CSOItemCriteria& CSOItemCriteria::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOItemCriteria* CSOItemCriteria::default_instance_ = NULL; CSOItemCriteria* CSOItemCriteria::New() const { return new CSOItemCriteria; } void CSOItemCriteria::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOItemCriteria*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 127) { ZR_(item_level_, ignore_enabled_flag_); initial_quantity_ = 0u; } recent_only_ = false; #undef OFFSET_OF_FIELD_ #undef ZR_ conditions_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOItemCriteria::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOItemCriteria) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 item_level = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &item_level_))); set_has_item_level(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_item_quality; break; } // optional int32 item_quality = 2; case 2: { if (tag == 16) { parse_item_quality: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &item_quality_))); set_has_item_quality(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_item_level_set; break; } // optional bool item_level_set = 3; case 3: { if (tag == 24) { parse_item_level_set: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &item_level_set_))); set_has_item_level_set(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_item_quality_set; break; } // optional bool item_quality_set = 4; case 4: { if (tag == 32) { parse_item_quality_set: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &item_quality_set_))); set_has_item_quality_set(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_initial_inventory; break; } // optional uint32 initial_inventory = 5; case 5: { if (tag == 40) { parse_initial_inventory: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &initial_inventory_))); set_has_initial_inventory(); } else { goto handle_unusual; } if (input->ExpectTag(48)) goto parse_initial_quantity; break; } // optional uint32 initial_quantity = 6; case 6: { if (tag == 48) { parse_initial_quantity: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &initial_quantity_))); set_has_initial_quantity(); } else { goto handle_unusual; } if (input->ExpectTag(64)) goto parse_ignore_enabled_flag; break; } // optional bool ignore_enabled_flag = 8; case 8: { if (tag == 64) { parse_ignore_enabled_flag: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &ignore_enabled_flag_))); set_has_ignore_enabled_flag(); } else { goto handle_unusual; } if (input->ExpectTag(74)) goto parse_conditions; break; } // repeated .CSOItemCriteriaCondition conditions = 9; case 9: { if (tag == 74) { parse_conditions: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_conditions())); } else { goto handle_unusual; } if (input->ExpectTag(74)) goto parse_conditions; if (input->ExpectTag(80)) goto parse_recent_only; break; } // optional bool recent_only = 10; case 10: { if (tag == 80) { parse_recent_only: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &recent_only_))); set_has_recent_only(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOItemCriteria) return true; failure: // @@protoc_insertion_point(parse_failure:CSOItemCriteria) return false; #undef DO_ } void CSOItemCriteria::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOItemCriteria) // optional uint32 item_level = 1; if (has_item_level()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->item_level(), output); } // optional int32 item_quality = 2; if (has_item_quality()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->item_quality(), output); } // optional bool item_level_set = 3; if (has_item_level_set()) { ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->item_level_set(), output); } // optional bool item_quality_set = 4; if (has_item_quality_set()) { ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->item_quality_set(), output); } // optional uint32 initial_inventory = 5; if (has_initial_inventory()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->initial_inventory(), output); } // optional uint32 initial_quantity = 6; if (has_initial_quantity()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->initial_quantity(), output); } // optional bool ignore_enabled_flag = 8; if (has_ignore_enabled_flag()) { ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->ignore_enabled_flag(), output); } // repeated .CSOItemCriteriaCondition conditions = 9; for (int i = 0; i < this->conditions_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 9, this->conditions(i), output); } // optional bool recent_only = 10; if (has_recent_only()) { ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->recent_only(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOItemCriteria) } ::google::protobuf::uint8* CSOItemCriteria::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOItemCriteria) // optional uint32 item_level = 1; if (has_item_level()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->item_level(), target); } // optional int32 item_quality = 2; if (has_item_quality()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->item_quality(), target); } // optional bool item_level_set = 3; if (has_item_level_set()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->item_level_set(), target); } // optional bool item_quality_set = 4; if (has_item_quality_set()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->item_quality_set(), target); } // optional uint32 initial_inventory = 5; if (has_initial_inventory()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->initial_inventory(), target); } // optional uint32 initial_quantity = 6; if (has_initial_quantity()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->initial_quantity(), target); } // optional bool ignore_enabled_flag = 8; if (has_ignore_enabled_flag()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(8, this->ignore_enabled_flag(), target); } // repeated .CSOItemCriteriaCondition conditions = 9; for (int i = 0; i < this->conditions_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 9, this->conditions(i), target); } // optional bool recent_only = 10; if (has_recent_only()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->recent_only(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOItemCriteria) return target; } int CSOItemCriteria::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 item_level = 1; if (has_item_level()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->item_level()); } // optional int32 item_quality = 2; if (has_item_quality()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->item_quality()); } // optional bool item_level_set = 3; if (has_item_level_set()) { total_size += 1 + 1; } // optional bool item_quality_set = 4; if (has_item_quality_set()) { total_size += 1 + 1; } // optional uint32 initial_inventory = 5; if (has_initial_inventory()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->initial_inventory()); } // optional uint32 initial_quantity = 6; if (has_initial_quantity()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->initial_quantity()); } // optional bool ignore_enabled_flag = 8; if (has_ignore_enabled_flag()) { total_size += 1 + 1; } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional bool recent_only = 10; if (has_recent_only()) { total_size += 1 + 1; } } // repeated .CSOItemCriteriaCondition conditions = 9; total_size += 1 * this->conditions_size(); for (int i = 0; i < this->conditions_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->conditions(i)); } 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; } void CSOItemCriteria::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOItemCriteria* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOItemCriteria*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOItemCriteria::MergeFrom(const CSOItemCriteria& from) { GOOGLE_CHECK_NE(&from, this); conditions_.MergeFrom(from.conditions_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_level()) { set_item_level(from.item_level()); } if (from.has_item_quality()) { set_item_quality(from.item_quality()); } if (from.has_item_level_set()) { set_item_level_set(from.item_level_set()); } if (from.has_item_quality_set()) { set_item_quality_set(from.item_quality_set()); } if (from.has_initial_inventory()) { set_initial_inventory(from.initial_inventory()); } if (from.has_initial_quantity()) { set_initial_quantity(from.initial_quantity()); } if (from.has_ignore_enabled_flag()) { set_ignore_enabled_flag(from.ignore_enabled_flag()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_recent_only()) { set_recent_only(from.recent_only()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOItemCriteria::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOItemCriteria::CopyFrom(const CSOItemCriteria& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOItemCriteria::IsInitialized() const { return true; } void CSOItemCriteria::Swap(CSOItemCriteria* other) { if (other != this) { std::swap(item_level_, other->item_level_); std::swap(item_quality_, other->item_quality_); std::swap(item_level_set_, other->item_level_set_); std::swap(item_quality_set_, other->item_quality_set_); std::swap(initial_inventory_, other->initial_inventory_); std::swap(initial_quantity_, other->initial_quantity_); std::swap(ignore_enabled_flag_, other->ignore_enabled_flag_); conditions_.Swap(&other->conditions_); std::swap(recent_only_, other->recent_only_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOItemCriteria::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOItemCriteria_descriptor_; metadata.reflection = CSOItemCriteria_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOItemRecipe::kDefIndexFieldNumber; const int CSOItemRecipe::kNameFieldNumber; const int CSOItemRecipe::kNAFieldNumber; const int CSOItemRecipe::kDescInputsFieldNumber; const int CSOItemRecipe::kDescOutputsFieldNumber; const int CSOItemRecipe::kDiAFieldNumber; const int CSOItemRecipe::kDiBFieldNumber; const int CSOItemRecipe::kDiCFieldNumber; const int CSOItemRecipe::kDoAFieldNumber; const int CSOItemRecipe::kDoBFieldNumber; const int CSOItemRecipe::kDoCFieldNumber; const int CSOItemRecipe::kRequiresAllSameClassFieldNumber; const int CSOItemRecipe::kRequiresAllSameSlotFieldNumber; const int CSOItemRecipe::kClassUsageForOutputFieldNumber; const int CSOItemRecipe::kSlotUsageForOutputFieldNumber; const int CSOItemRecipe::kSetForOutputFieldNumber; const int CSOItemRecipe::kInputItemsCriteriaFieldNumber; const int CSOItemRecipe::kOutputItemsCriteriaFieldNumber; const int CSOItemRecipe::kInputItemDupeCountsFieldNumber; #endif // !_MSC_VER CSOItemRecipe::CSOItemRecipe() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOItemRecipe) } void CSOItemRecipe::InitAsDefaultInstance() { } CSOItemRecipe::CSOItemRecipe(const CSOItemRecipe& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOItemRecipe) } void CSOItemRecipe::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; def_index_ = 0u; name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); n_a_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); desc_inputs_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); desc_outputs_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); di_a_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); di_b_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); di_c_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); do_a_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); do_b_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); do_c_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); requires_all_same_class_ = false; requires_all_same_slot_ = false; class_usage_for_output_ = 0; slot_usage_for_output_ = 0; set_for_output_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOItemRecipe::~CSOItemRecipe() { // @@protoc_insertion_point(destructor:CSOItemRecipe) SharedDtor(); } void CSOItemRecipe::SharedDtor() { if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (n_a_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete n_a_; } if (desc_inputs_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete desc_inputs_; } if (desc_outputs_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete desc_outputs_; } if (di_a_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete di_a_; } if (di_b_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete di_b_; } if (di_c_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete di_c_; } if (do_a_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete do_a_; } if (do_b_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete do_b_; } if (do_c_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete do_c_; } if (this != default_instance_) { } } void CSOItemRecipe::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOItemRecipe::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOItemRecipe_descriptor_; } const CSOItemRecipe& CSOItemRecipe::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOItemRecipe* CSOItemRecipe::default_instance_ = NULL; CSOItemRecipe* CSOItemRecipe::New() const { return new CSOItemRecipe; } void CSOItemRecipe::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOItemRecipe*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 255) { def_index_ = 0u; if (has_name()) { if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } } if (has_n_a()) { if (n_a_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { n_a_->clear(); } } if (has_desc_inputs()) { if (desc_inputs_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { desc_inputs_->clear(); } } if (has_desc_outputs()) { if (desc_outputs_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { desc_outputs_->clear(); } } if (has_di_a()) { if (di_a_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { di_a_->clear(); } } if (has_di_b()) { if (di_b_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { di_b_->clear(); } } if (has_di_c()) { if (di_c_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { di_c_->clear(); } } } if (_has_bits_[8 / 32] & 65280) { ZR_(requires_all_same_class_, requires_all_same_slot_); ZR_(class_usage_for_output_, slot_usage_for_output_); if (has_do_a()) { if (do_a_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { do_a_->clear(); } } if (has_do_b()) { if (do_b_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { do_b_->clear(); } } if (has_do_c()) { if (do_c_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { do_c_->clear(); } } set_for_output_ = 0; } #undef OFFSET_OF_FIELD_ #undef ZR_ input_items_criteria_.Clear(); output_items_criteria_.Clear(); input_item_dupe_counts_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOItemRecipe::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOItemRecipe) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 def_index = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &def_index_))); set_has_def_index(); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_name; break; } // optional string name = 2; case 2: { if (tag == 18) { parse_name: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::PARSE, "name"); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_n_a; break; } // optional string n_a = 3; case 3: { if (tag == 26) { parse_n_a: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_n_a())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->n_a().data(), this->n_a().length(), ::google::protobuf::internal::WireFormat::PARSE, "n_a"); } else { goto handle_unusual; } if (input->ExpectTag(34)) goto parse_desc_inputs; break; } // optional string desc_inputs = 4; case 4: { if (tag == 34) { parse_desc_inputs: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_desc_inputs())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->desc_inputs().data(), this->desc_inputs().length(), ::google::protobuf::internal::WireFormat::PARSE, "desc_inputs"); } else { goto handle_unusual; } if (input->ExpectTag(42)) goto parse_desc_outputs; break; } // optional string desc_outputs = 5; case 5: { if (tag == 42) { parse_desc_outputs: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_desc_outputs())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->desc_outputs().data(), this->desc_outputs().length(), ::google::protobuf::internal::WireFormat::PARSE, "desc_outputs"); } else { goto handle_unusual; } if (input->ExpectTag(50)) goto parse_di_a; break; } // optional string di_a = 6; case 6: { if (tag == 50) { parse_di_a: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_di_a())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_a().data(), this->di_a().length(), ::google::protobuf::internal::WireFormat::PARSE, "di_a"); } else { goto handle_unusual; } if (input->ExpectTag(58)) goto parse_di_b; break; } // optional string di_b = 7; case 7: { if (tag == 58) { parse_di_b: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_di_b())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_b().data(), this->di_b().length(), ::google::protobuf::internal::WireFormat::PARSE, "di_b"); } else { goto handle_unusual; } if (input->ExpectTag(66)) goto parse_di_c; break; } // optional string di_c = 8; case 8: { if (tag == 66) { parse_di_c: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_di_c())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_c().data(), this->di_c().length(), ::google::protobuf::internal::WireFormat::PARSE, "di_c"); } else { goto handle_unusual; } if (input->ExpectTag(74)) goto parse_do_a; break; } // optional string do_a = 9; case 9: { if (tag == 74) { parse_do_a: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_do_a())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_a().data(), this->do_a().length(), ::google::protobuf::internal::WireFormat::PARSE, "do_a"); } else { goto handle_unusual; } if (input->ExpectTag(82)) goto parse_do_b; break; } // optional string do_b = 10; case 10: { if (tag == 82) { parse_do_b: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_do_b())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_b().data(), this->do_b().length(), ::google::protobuf::internal::WireFormat::PARSE, "do_b"); } else { goto handle_unusual; } if (input->ExpectTag(90)) goto parse_do_c; break; } // optional string do_c = 11; case 11: { if (tag == 90) { parse_do_c: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_do_c())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_c().data(), this->do_c().length(), ::google::protobuf::internal::WireFormat::PARSE, "do_c"); } else { goto handle_unusual; } if (input->ExpectTag(96)) goto parse_requires_all_same_class; break; } // optional bool requires_all_same_class = 12; case 12: { if (tag == 96) { parse_requires_all_same_class: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &requires_all_same_class_))); set_has_requires_all_same_class(); } else { goto handle_unusual; } if (input->ExpectTag(104)) goto parse_requires_all_same_slot; break; } // optional bool requires_all_same_slot = 13; case 13: { if (tag == 104) { parse_requires_all_same_slot: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &requires_all_same_slot_))); set_has_requires_all_same_slot(); } else { goto handle_unusual; } if (input->ExpectTag(112)) goto parse_class_usage_for_output; break; } // optional int32 class_usage_for_output = 14; case 14: { if (tag == 112) { parse_class_usage_for_output: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &class_usage_for_output_))); set_has_class_usage_for_output(); } else { goto handle_unusual; } if (input->ExpectTag(120)) goto parse_slot_usage_for_output; break; } // optional int32 slot_usage_for_output = 15; case 15: { if (tag == 120) { parse_slot_usage_for_output: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &slot_usage_for_output_))); set_has_slot_usage_for_output(); } else { goto handle_unusual; } if (input->ExpectTag(128)) goto parse_set_for_output; break; } // optional int32 set_for_output = 16; case 16: { if (tag == 128) { parse_set_for_output: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &set_for_output_))); set_has_set_for_output(); } else { goto handle_unusual; } if (input->ExpectTag(162)) goto parse_input_items_criteria; break; } // repeated .CSOItemCriteria input_items_criteria = 20; case 20: { if (tag == 162) { parse_input_items_criteria: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_input_items_criteria())); } else { goto handle_unusual; } if (input->ExpectTag(162)) goto parse_input_items_criteria; if (input->ExpectTag(170)) goto parse_output_items_criteria; break; } // repeated .CSOItemCriteria output_items_criteria = 21; case 21: { if (tag == 170) { parse_output_items_criteria: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_output_items_criteria())); } else { goto handle_unusual; } if (input->ExpectTag(170)) goto parse_output_items_criteria; if (input->ExpectTag(176)) goto parse_input_item_dupe_counts; break; } // repeated uint32 input_item_dupe_counts = 22; case 22: { if (tag == 176) { parse_input_item_dupe_counts: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 2, 176, input, this->mutable_input_item_dupe_counts()))); } else if (tag == 178) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, this->mutable_input_item_dupe_counts()))); } else { goto handle_unusual; } if (input->ExpectTag(176)) goto parse_input_item_dupe_counts; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOItemRecipe) return true; failure: // @@protoc_insertion_point(parse_failure:CSOItemRecipe) return false; #undef DO_ } void CSOItemRecipe::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOItemRecipe) // optional uint32 def_index = 1; if (has_def_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->def_index(), output); } // optional string name = 2; if (has_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->name(), output); } // optional string n_a = 3; if (has_n_a()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->n_a().data(), this->n_a().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "n_a"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 3, this->n_a(), output); } // optional string desc_inputs = 4; if (has_desc_inputs()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->desc_inputs().data(), this->desc_inputs().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "desc_inputs"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 4, this->desc_inputs(), output); } // optional string desc_outputs = 5; if (has_desc_outputs()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->desc_outputs().data(), this->desc_outputs().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "desc_outputs"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 5, this->desc_outputs(), output); } // optional string di_a = 6; if (has_di_a()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_a().data(), this->di_a().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "di_a"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 6, this->di_a(), output); } // optional string di_b = 7; if (has_di_b()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_b().data(), this->di_b().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "di_b"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 7, this->di_b(), output); } // optional string di_c = 8; if (has_di_c()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_c().data(), this->di_c().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "di_c"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 8, this->di_c(), output); } // optional string do_a = 9; if (has_do_a()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_a().data(), this->do_a().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "do_a"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 9, this->do_a(), output); } // optional string do_b = 10; if (has_do_b()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_b().data(), this->do_b().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "do_b"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 10, this->do_b(), output); } // optional string do_c = 11; if (has_do_c()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_c().data(), this->do_c().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "do_c"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 11, this->do_c(), output); } // optional bool requires_all_same_class = 12; if (has_requires_all_same_class()) { ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->requires_all_same_class(), output); } // optional bool requires_all_same_slot = 13; if (has_requires_all_same_slot()) { ::google::protobuf::internal::WireFormatLite::WriteBool(13, this->requires_all_same_slot(), output); } // optional int32 class_usage_for_output = 14; if (has_class_usage_for_output()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->class_usage_for_output(), output); } // optional int32 slot_usage_for_output = 15; if (has_slot_usage_for_output()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(15, this->slot_usage_for_output(), output); } // optional int32 set_for_output = 16; if (has_set_for_output()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->set_for_output(), output); } // repeated .CSOItemCriteria input_items_criteria = 20; for (int i = 0; i < this->input_items_criteria_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 20, this->input_items_criteria(i), output); } // repeated .CSOItemCriteria output_items_criteria = 21; for (int i = 0; i < this->output_items_criteria_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 21, this->output_items_criteria(i), output); } // repeated uint32 input_item_dupe_counts = 22; for (int i = 0; i < this->input_item_dupe_counts_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt32( 22, this->input_item_dupe_counts(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOItemRecipe) } ::google::protobuf::uint8* CSOItemRecipe::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOItemRecipe) // optional uint32 def_index = 1; if (has_def_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->def_index(), target); } // optional string name = 2; if (has_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->name(), target); } // optional string n_a = 3; if (has_n_a()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->n_a().data(), this->n_a().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "n_a"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->n_a(), target); } // optional string desc_inputs = 4; if (has_desc_inputs()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->desc_inputs().data(), this->desc_inputs().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "desc_inputs"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 4, this->desc_inputs(), target); } // optional string desc_outputs = 5; if (has_desc_outputs()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->desc_outputs().data(), this->desc_outputs().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "desc_outputs"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 5, this->desc_outputs(), target); } // optional string di_a = 6; if (has_di_a()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_a().data(), this->di_a().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "di_a"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 6, this->di_a(), target); } // optional string di_b = 7; if (has_di_b()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_b().data(), this->di_b().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "di_b"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 7, this->di_b(), target); } // optional string di_c = 8; if (has_di_c()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->di_c().data(), this->di_c().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "di_c"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 8, this->di_c(), target); } // optional string do_a = 9; if (has_do_a()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_a().data(), this->do_a().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "do_a"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 9, this->do_a(), target); } // optional string do_b = 10; if (has_do_b()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_b().data(), this->do_b().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "do_b"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 10, this->do_b(), target); } // optional string do_c = 11; if (has_do_c()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->do_c().data(), this->do_c().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "do_c"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 11, this->do_c(), target); } // optional bool requires_all_same_class = 12; if (has_requires_all_same_class()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(12, this->requires_all_same_class(), target); } // optional bool requires_all_same_slot = 13; if (has_requires_all_same_slot()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(13, this->requires_all_same_slot(), target); } // optional int32 class_usage_for_output = 14; if (has_class_usage_for_output()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->class_usage_for_output(), target); } // optional int32 slot_usage_for_output = 15; if (has_slot_usage_for_output()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(15, this->slot_usage_for_output(), target); } // optional int32 set_for_output = 16; if (has_set_for_output()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(16, this->set_for_output(), target); } // repeated .CSOItemCriteria input_items_criteria = 20; for (int i = 0; i < this->input_items_criteria_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 20, this->input_items_criteria(i), target); } // repeated .CSOItemCriteria output_items_criteria = 21; for (int i = 0; i < this->output_items_criteria_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 21, this->output_items_criteria(i), target); } // repeated uint32 input_item_dupe_counts = 22; for (int i = 0; i < this->input_item_dupe_counts_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt32ToArray(22, this->input_item_dupe_counts(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOItemRecipe) return target; } int CSOItemRecipe::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 def_index = 1; if (has_def_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->def_index()); } // optional string name = 2; if (has_name()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional string n_a = 3; if (has_n_a()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->n_a()); } // optional string desc_inputs = 4; if (has_desc_inputs()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->desc_inputs()); } // optional string desc_outputs = 5; if (has_desc_outputs()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->desc_outputs()); } // optional string di_a = 6; if (has_di_a()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->di_a()); } // optional string di_b = 7; if (has_di_b()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->di_b()); } // optional string di_c = 8; if (has_di_c()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->di_c()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional string do_a = 9; if (has_do_a()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->do_a()); } // optional string do_b = 10; if (has_do_b()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->do_b()); } // optional string do_c = 11; if (has_do_c()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->do_c()); } // optional bool requires_all_same_class = 12; if (has_requires_all_same_class()) { total_size += 1 + 1; } // optional bool requires_all_same_slot = 13; if (has_requires_all_same_slot()) { total_size += 1 + 1; } // optional int32 class_usage_for_output = 14; if (has_class_usage_for_output()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->class_usage_for_output()); } // optional int32 slot_usage_for_output = 15; if (has_slot_usage_for_output()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->slot_usage_for_output()); } // optional int32 set_for_output = 16; if (has_set_for_output()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->set_for_output()); } } // repeated .CSOItemCriteria input_items_criteria = 20; total_size += 2 * this->input_items_criteria_size(); for (int i = 0; i < this->input_items_criteria_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->input_items_criteria(i)); } // repeated .CSOItemCriteria output_items_criteria = 21; total_size += 2 * this->output_items_criteria_size(); for (int i = 0; i < this->output_items_criteria_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->output_items_criteria(i)); } // repeated uint32 input_item_dupe_counts = 22; { int data_size = 0; for (int i = 0; i < this->input_item_dupe_counts_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt32Size(this->input_item_dupe_counts(i)); } total_size += 2 * this->input_item_dupe_counts_size() + data_size; } 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; } void CSOItemRecipe::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOItemRecipe* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOItemRecipe*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOItemRecipe::MergeFrom(const CSOItemRecipe& from) { GOOGLE_CHECK_NE(&from, this); input_items_criteria_.MergeFrom(from.input_items_criteria_); output_items_criteria_.MergeFrom(from.output_items_criteria_); input_item_dupe_counts_.MergeFrom(from.input_item_dupe_counts_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_def_index()) { set_def_index(from.def_index()); } if (from.has_name()) { set_name(from.name()); } if (from.has_n_a()) { set_n_a(from.n_a()); } if (from.has_desc_inputs()) { set_desc_inputs(from.desc_inputs()); } if (from.has_desc_outputs()) { set_desc_outputs(from.desc_outputs()); } if (from.has_di_a()) { set_di_a(from.di_a()); } if (from.has_di_b()) { set_di_b(from.di_b()); } if (from.has_di_c()) { set_di_c(from.di_c()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_do_a()) { set_do_a(from.do_a()); } if (from.has_do_b()) { set_do_b(from.do_b()); } if (from.has_do_c()) { set_do_c(from.do_c()); } if (from.has_requires_all_same_class()) { set_requires_all_same_class(from.requires_all_same_class()); } if (from.has_requires_all_same_slot()) { set_requires_all_same_slot(from.requires_all_same_slot()); } if (from.has_class_usage_for_output()) { set_class_usage_for_output(from.class_usage_for_output()); } if (from.has_slot_usage_for_output()) { set_slot_usage_for_output(from.slot_usage_for_output()); } if (from.has_set_for_output()) { set_set_for_output(from.set_for_output()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOItemRecipe::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOItemRecipe::CopyFrom(const CSOItemRecipe& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOItemRecipe::IsInitialized() const { return true; } void CSOItemRecipe::Swap(CSOItemRecipe* other) { if (other != this) { std::swap(def_index_, other->def_index_); std::swap(name_, other->name_); std::swap(n_a_, other->n_a_); std::swap(desc_inputs_, other->desc_inputs_); std::swap(desc_outputs_, other->desc_outputs_); std::swap(di_a_, other->di_a_); std::swap(di_b_, other->di_b_); std::swap(di_c_, other->di_c_); std::swap(do_a_, other->do_a_); std::swap(do_b_, other->do_b_); std::swap(do_c_, other->do_c_); std::swap(requires_all_same_class_, other->requires_all_same_class_); std::swap(requires_all_same_slot_, other->requires_all_same_slot_); std::swap(class_usage_for_output_, other->class_usage_for_output_); std::swap(slot_usage_for_output_, other->slot_usage_for_output_); std::swap(set_for_output_, other->set_for_output_); input_items_criteria_.Swap(&other->input_items_criteria_); output_items_criteria_.Swap(&other->output_items_criteria_); input_item_dupe_counts_.Swap(&other->input_item_dupe_counts_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOItemRecipe::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOItemRecipe_descriptor_; metadata.reflection = CSOItemRecipe_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgApplyStrangePart::kStrangePartItemIdFieldNumber; const int CMsgApplyStrangePart::kItemItemIdFieldNumber; #endif // !_MSC_VER CMsgApplyStrangePart::CMsgApplyStrangePart() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgApplyStrangePart) } void CMsgApplyStrangePart::InitAsDefaultInstance() { } CMsgApplyStrangePart::CMsgApplyStrangePart(const CMsgApplyStrangePart& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgApplyStrangePart) } void CMsgApplyStrangePart::SharedCtor() { _cached_size_ = 0; strange_part_item_id_ = GOOGLE_ULONGLONG(0); item_item_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgApplyStrangePart::~CMsgApplyStrangePart() { // @@protoc_insertion_point(destructor:CMsgApplyStrangePart) SharedDtor(); } void CMsgApplyStrangePart::SharedDtor() { if (this != default_instance_) { } } void CMsgApplyStrangePart::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgApplyStrangePart::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgApplyStrangePart_descriptor_; } const CMsgApplyStrangePart& CMsgApplyStrangePart::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgApplyStrangePart* CMsgApplyStrangePart::default_instance_ = NULL; CMsgApplyStrangePart* CMsgApplyStrangePart::New() const { return new CMsgApplyStrangePart; } void CMsgApplyStrangePart::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgApplyStrangePart*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(strange_part_item_id_, item_item_id_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgApplyStrangePart::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgApplyStrangePart) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 strange_part_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &strange_part_item_id_))); set_has_strange_part_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_item_item_id; break; } // optional uint64 item_item_id = 2; case 2: { if (tag == 16) { parse_item_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_item_id_))); set_has_item_item_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgApplyStrangePart) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgApplyStrangePart) return false; #undef DO_ } void CMsgApplyStrangePart::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgApplyStrangePart) // optional uint64 strange_part_item_id = 1; if (has_strange_part_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->strange_part_item_id(), output); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->item_item_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgApplyStrangePart) } ::google::protobuf::uint8* CMsgApplyStrangePart::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgApplyStrangePart) // optional uint64 strange_part_item_id = 1; if (has_strange_part_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->strange_part_item_id(), target); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->item_item_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgApplyStrangePart) return target; } int CMsgApplyStrangePart::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 strange_part_item_id = 1; if (has_strange_part_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->strange_part_item_id()); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_item_id()); } } 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; } void CMsgApplyStrangePart::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgApplyStrangePart* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgApplyStrangePart*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgApplyStrangePart::MergeFrom(const CMsgApplyStrangePart& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_strange_part_item_id()) { set_strange_part_item_id(from.strange_part_item_id()); } if (from.has_item_item_id()) { set_item_item_id(from.item_item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgApplyStrangePart::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgApplyStrangePart::CopyFrom(const CMsgApplyStrangePart& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgApplyStrangePart::IsInitialized() const { return true; } void CMsgApplyStrangePart::Swap(CMsgApplyStrangePart* other) { if (other != this) { std::swap(strange_part_item_id_, other->strange_part_item_id_); std::swap(item_item_id_, other->item_item_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgApplyStrangePart::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgApplyStrangePart_descriptor_; metadata.reflection = CMsgApplyStrangePart_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgApplyPennantUpgrade::kUpgradeItemIdFieldNumber; const int CMsgApplyPennantUpgrade::kPennantItemIdFieldNumber; #endif // !_MSC_VER CMsgApplyPennantUpgrade::CMsgApplyPennantUpgrade() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgApplyPennantUpgrade) } void CMsgApplyPennantUpgrade::InitAsDefaultInstance() { } CMsgApplyPennantUpgrade::CMsgApplyPennantUpgrade(const CMsgApplyPennantUpgrade& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgApplyPennantUpgrade) } void CMsgApplyPennantUpgrade::SharedCtor() { _cached_size_ = 0; upgrade_item_id_ = GOOGLE_ULONGLONG(0); pennant_item_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgApplyPennantUpgrade::~CMsgApplyPennantUpgrade() { // @@protoc_insertion_point(destructor:CMsgApplyPennantUpgrade) SharedDtor(); } void CMsgApplyPennantUpgrade::SharedDtor() { if (this != default_instance_) { } } void CMsgApplyPennantUpgrade::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgApplyPennantUpgrade::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgApplyPennantUpgrade_descriptor_; } const CMsgApplyPennantUpgrade& CMsgApplyPennantUpgrade::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgApplyPennantUpgrade* CMsgApplyPennantUpgrade::default_instance_ = NULL; CMsgApplyPennantUpgrade* CMsgApplyPennantUpgrade::New() const { return new CMsgApplyPennantUpgrade; } void CMsgApplyPennantUpgrade::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgApplyPennantUpgrade*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(upgrade_item_id_, pennant_item_id_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgApplyPennantUpgrade::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgApplyPennantUpgrade) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 upgrade_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &upgrade_item_id_))); set_has_upgrade_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_pennant_item_id; break; } // optional uint64 pennant_item_id = 2; case 2: { if (tag == 16) { parse_pennant_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &pennant_item_id_))); set_has_pennant_item_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgApplyPennantUpgrade) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgApplyPennantUpgrade) return false; #undef DO_ } void CMsgApplyPennantUpgrade::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgApplyPennantUpgrade) // optional uint64 upgrade_item_id = 1; if (has_upgrade_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->upgrade_item_id(), output); } // optional uint64 pennant_item_id = 2; if (has_pennant_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->pennant_item_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgApplyPennantUpgrade) } ::google::protobuf::uint8* CMsgApplyPennantUpgrade::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgApplyPennantUpgrade) // optional uint64 upgrade_item_id = 1; if (has_upgrade_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->upgrade_item_id(), target); } // optional uint64 pennant_item_id = 2; if (has_pennant_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->pennant_item_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgApplyPennantUpgrade) return target; } int CMsgApplyPennantUpgrade::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 upgrade_item_id = 1; if (has_upgrade_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->upgrade_item_id()); } // optional uint64 pennant_item_id = 2; if (has_pennant_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->pennant_item_id()); } } 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; } void CMsgApplyPennantUpgrade::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgApplyPennantUpgrade* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgApplyPennantUpgrade*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgApplyPennantUpgrade::MergeFrom(const CMsgApplyPennantUpgrade& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_upgrade_item_id()) { set_upgrade_item_id(from.upgrade_item_id()); } if (from.has_pennant_item_id()) { set_pennant_item_id(from.pennant_item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgApplyPennantUpgrade::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgApplyPennantUpgrade::CopyFrom(const CMsgApplyPennantUpgrade& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgApplyPennantUpgrade::IsInitialized() const { return true; } void CMsgApplyPennantUpgrade::Swap(CMsgApplyPennantUpgrade* other) { if (other != this) { std::swap(upgrade_item_id_, other->upgrade_item_id_); std::swap(pennant_item_id_, other->pennant_item_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgApplyPennantUpgrade::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgApplyPennantUpgrade_descriptor_; metadata.reflection = CMsgApplyPennantUpgrade_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgApplyEggEssence::kEssenceItemIdFieldNumber; const int CMsgApplyEggEssence::kEggItemIdFieldNumber; #endif // !_MSC_VER CMsgApplyEggEssence::CMsgApplyEggEssence() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgApplyEggEssence) } void CMsgApplyEggEssence::InitAsDefaultInstance() { } CMsgApplyEggEssence::CMsgApplyEggEssence(const CMsgApplyEggEssence& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgApplyEggEssence) } void CMsgApplyEggEssence::SharedCtor() { _cached_size_ = 0; essence_item_id_ = GOOGLE_ULONGLONG(0); egg_item_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgApplyEggEssence::~CMsgApplyEggEssence() { // @@protoc_insertion_point(destructor:CMsgApplyEggEssence) SharedDtor(); } void CMsgApplyEggEssence::SharedDtor() { if (this != default_instance_) { } } void CMsgApplyEggEssence::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgApplyEggEssence::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgApplyEggEssence_descriptor_; } const CMsgApplyEggEssence& CMsgApplyEggEssence::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgApplyEggEssence* CMsgApplyEggEssence::default_instance_ = NULL; CMsgApplyEggEssence* CMsgApplyEggEssence::New() const { return new CMsgApplyEggEssence; } void CMsgApplyEggEssence::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgApplyEggEssence*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(essence_item_id_, egg_item_id_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgApplyEggEssence::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgApplyEggEssence) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 essence_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &essence_item_id_))); set_has_essence_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_egg_item_id; break; } // optional uint64 egg_item_id = 2; case 2: { if (tag == 16) { parse_egg_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &egg_item_id_))); set_has_egg_item_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgApplyEggEssence) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgApplyEggEssence) return false; #undef DO_ } void CMsgApplyEggEssence::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgApplyEggEssence) // optional uint64 essence_item_id = 1; if (has_essence_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->essence_item_id(), output); } // optional uint64 egg_item_id = 2; if (has_egg_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->egg_item_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgApplyEggEssence) } ::google::protobuf::uint8* CMsgApplyEggEssence::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgApplyEggEssence) // optional uint64 essence_item_id = 1; if (has_essence_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->essence_item_id(), target); } // optional uint64 egg_item_id = 2; if (has_egg_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->egg_item_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgApplyEggEssence) return target; } int CMsgApplyEggEssence::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 essence_item_id = 1; if (has_essence_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->essence_item_id()); } // optional uint64 egg_item_id = 2; if (has_egg_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->egg_item_id()); } } 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; } void CMsgApplyEggEssence::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgApplyEggEssence* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgApplyEggEssence*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgApplyEggEssence::MergeFrom(const CMsgApplyEggEssence& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_essence_item_id()) { set_essence_item_id(from.essence_item_id()); } if (from.has_egg_item_id()) { set_egg_item_id(from.egg_item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgApplyEggEssence::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgApplyEggEssence::CopyFrom(const CMsgApplyEggEssence& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgApplyEggEssence::IsInitialized() const { return true; } void CMsgApplyEggEssence::Swap(CMsgApplyEggEssence* other) { if (other != this) { std::swap(essence_item_id_, other->essence_item_id_); std::swap(egg_item_id_, other->egg_item_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgApplyEggEssence::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgApplyEggEssence_descriptor_; metadata.reflection = CMsgApplyEggEssence_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconItemAttribute::kDefIndexFieldNumber; const int CSOEconItemAttribute::kValueFieldNumber; const int CSOEconItemAttribute::kValueBytesFieldNumber; #endif // !_MSC_VER CSOEconItemAttribute::CSOEconItemAttribute() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconItemAttribute) } void CSOEconItemAttribute::InitAsDefaultInstance() { } CSOEconItemAttribute::CSOEconItemAttribute(const CSOEconItemAttribute& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconItemAttribute) } void CSOEconItemAttribute::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; def_index_ = 0u; value_ = 0u; value_bytes_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconItemAttribute::~CSOEconItemAttribute() { // @@protoc_insertion_point(destructor:CSOEconItemAttribute) SharedDtor(); } void CSOEconItemAttribute::SharedDtor() { if (value_bytes_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete value_bytes_; } if (this != default_instance_) { } } void CSOEconItemAttribute::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconItemAttribute::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconItemAttribute_descriptor_; } const CSOEconItemAttribute& CSOEconItemAttribute::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconItemAttribute* CSOEconItemAttribute::default_instance_ = NULL; CSOEconItemAttribute* CSOEconItemAttribute::New() const { return new CSOEconItemAttribute; } void CSOEconItemAttribute::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconItemAttribute*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 7) { ZR_(def_index_, value_); if (has_value_bytes()) { if (value_bytes_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { value_bytes_->clear(); } } } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconItemAttribute::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconItemAttribute) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 def_index = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &def_index_))); set_has_def_index(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_value; break; } // optional uint32 value = 2; case 2: { if (tag == 16) { parse_value: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &value_))); set_has_value(); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_value_bytes; break; } // optional bytes value_bytes = 3; case 3: { if (tag == 26) { parse_value_bytes: DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_value_bytes())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconItemAttribute) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconItemAttribute) return false; #undef DO_ } void CSOEconItemAttribute::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconItemAttribute) // optional uint32 def_index = 1; if (has_def_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->def_index(), output); } // optional uint32 value = 2; if (has_value()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->value(), output); } // optional bytes value_bytes = 3; if (has_value_bytes()) { ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 3, this->value_bytes(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconItemAttribute) } ::google::protobuf::uint8* CSOEconItemAttribute::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconItemAttribute) // optional uint32 def_index = 1; if (has_def_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->def_index(), target); } // optional uint32 value = 2; if (has_value()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->value(), target); } // optional bytes value_bytes = 3; if (has_value_bytes()) { target = ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 3, this->value_bytes(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconItemAttribute) return target; } int CSOEconItemAttribute::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 def_index = 1; if (has_def_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->def_index()); } // optional uint32 value = 2; if (has_value()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->value()); } // optional bytes value_bytes = 3; if (has_value_bytes()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( this->value_bytes()); } } 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; } void CSOEconItemAttribute::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconItemAttribute* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconItemAttribute*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconItemAttribute::MergeFrom(const CSOEconItemAttribute& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_def_index()) { set_def_index(from.def_index()); } if (from.has_value()) { set_value(from.value()); } if (from.has_value_bytes()) { set_value_bytes(from.value_bytes()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconItemAttribute::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconItemAttribute::CopyFrom(const CSOEconItemAttribute& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconItemAttribute::IsInitialized() const { return true; } void CSOEconItemAttribute::Swap(CSOEconItemAttribute* other) { if (other != this) { std::swap(def_index_, other->def_index_); std::swap(value_, other->value_); std::swap(value_bytes_, other->value_bytes_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconItemAttribute::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconItemAttribute_descriptor_; metadata.reflection = CSOEconItemAttribute_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconItemEquipped::kNewClassFieldNumber; const int CSOEconItemEquipped::kNewSlotFieldNumber; #endif // !_MSC_VER CSOEconItemEquipped::CSOEconItemEquipped() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconItemEquipped) } void CSOEconItemEquipped::InitAsDefaultInstance() { } CSOEconItemEquipped::CSOEconItemEquipped(const CSOEconItemEquipped& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconItemEquipped) } void CSOEconItemEquipped::SharedCtor() { _cached_size_ = 0; new_class_ = 0u; new_slot_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconItemEquipped::~CSOEconItemEquipped() { // @@protoc_insertion_point(destructor:CSOEconItemEquipped) SharedDtor(); } void CSOEconItemEquipped::SharedDtor() { if (this != default_instance_) { } } void CSOEconItemEquipped::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconItemEquipped::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconItemEquipped_descriptor_; } const CSOEconItemEquipped& CSOEconItemEquipped::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconItemEquipped* CSOEconItemEquipped::default_instance_ = NULL; CSOEconItemEquipped* CSOEconItemEquipped::New() const { return new CSOEconItemEquipped; } void CSOEconItemEquipped::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconItemEquipped*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(new_class_, new_slot_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconItemEquipped::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconItemEquipped) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 new_class = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &new_class_))); set_has_new_class(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_new_slot; break; } // optional uint32 new_slot = 2; case 2: { if (tag == 16) { parse_new_slot: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &new_slot_))); set_has_new_slot(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconItemEquipped) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconItemEquipped) return false; #undef DO_ } void CSOEconItemEquipped::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconItemEquipped) // optional uint32 new_class = 1; if (has_new_class()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->new_class(), output); } // optional uint32 new_slot = 2; if (has_new_slot()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->new_slot(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconItemEquipped) } ::google::protobuf::uint8* CSOEconItemEquipped::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconItemEquipped) // optional uint32 new_class = 1; if (has_new_class()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->new_class(), target); } // optional uint32 new_slot = 2; if (has_new_slot()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->new_slot(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconItemEquipped) return target; } int CSOEconItemEquipped::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 new_class = 1; if (has_new_class()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->new_class()); } // optional uint32 new_slot = 2; if (has_new_slot()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->new_slot()); } } 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; } void CSOEconItemEquipped::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconItemEquipped* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconItemEquipped*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconItemEquipped::MergeFrom(const CSOEconItemEquipped& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_new_class()) { set_new_class(from.new_class()); } if (from.has_new_slot()) { set_new_slot(from.new_slot()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconItemEquipped::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconItemEquipped::CopyFrom(const CSOEconItemEquipped& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconItemEquipped::IsInitialized() const { return true; } void CSOEconItemEquipped::Swap(CSOEconItemEquipped* other) { if (other != this) { std::swap(new_class_, other->new_class_); std::swap(new_slot_, other->new_slot_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconItemEquipped::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconItemEquipped_descriptor_; metadata.reflection = CSOEconItemEquipped_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconItem::kIdFieldNumber; const int CSOEconItem::kAccountIdFieldNumber; const int CSOEconItem::kInventoryFieldNumber; const int CSOEconItem::kDefIndexFieldNumber; const int CSOEconItem::kQuantityFieldNumber; const int CSOEconItem::kLevelFieldNumber; const int CSOEconItem::kQualityFieldNumber; const int CSOEconItem::kFlagsFieldNumber; const int CSOEconItem::kOriginFieldNumber; const int CSOEconItem::kAttributeFieldNumber; const int CSOEconItem::kInteriorItemFieldNumber; const int CSOEconItem::kInUseFieldNumber; const int CSOEconItem::kStyleFieldNumber; const int CSOEconItem::kOriginalIdFieldNumber; const int CSOEconItem::kEquippedStateFieldNumber; #endif // !_MSC_VER CSOEconItem::CSOEconItem() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconItem) } void CSOEconItem::InitAsDefaultInstance() { interior_item_ = const_cast< ::CSOEconItem*>(&::CSOEconItem::default_instance()); } CSOEconItem::CSOEconItem(const CSOEconItem& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconItem) } void CSOEconItem::SharedCtor() { _cached_size_ = 0; id_ = GOOGLE_ULONGLONG(0); account_id_ = 0u; inventory_ = 0u; def_index_ = 0u; quantity_ = 1u; level_ = 1u; quality_ = 4u; flags_ = 0u; origin_ = 0u; interior_item_ = NULL; in_use_ = false; style_ = 0u; original_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconItem::~CSOEconItem() { // @@protoc_insertion_point(destructor:CSOEconItem) SharedDtor(); } void CSOEconItem::SharedDtor() { if (this != default_instance_) { delete interior_item_; } } void CSOEconItem::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconItem::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconItem_descriptor_; } const CSOEconItem& CSOEconItem::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconItem* CSOEconItem::default_instance_ = NULL; CSOEconItem* CSOEconItem::New() const { return new CSOEconItem; } void CSOEconItem::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconItem*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 255) { ZR_(id_, def_index_); quantity_ = 1u; level_ = 1u; quality_ = 4u; flags_ = 0u; } if (_has_bits_[8 / 32] & 15616) { ZR_(in_use_, original_id_); origin_ = 0u; if (has_interior_item()) { if (interior_item_ != NULL) interior_item_->::CSOEconItem::Clear(); } } #undef OFFSET_OF_FIELD_ #undef ZR_ attribute_.Clear(); equipped_state_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconItem::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconItem) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &id_))); set_has_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_account_id; break; } // optional uint32 account_id = 2; case 2: { if (tag == 16) { parse_account_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &account_id_))); set_has_account_id(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_inventory; break; } // optional uint32 inventory = 3; case 3: { if (tag == 24) { parse_inventory: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &inventory_))); set_has_inventory(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_def_index; break; } // optional uint32 def_index = 4; case 4: { if (tag == 32) { parse_def_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &def_index_))); set_has_def_index(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_quantity; break; } // optional uint32 quantity = 5 [default = 1]; case 5: { if (tag == 40) { parse_quantity: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &quantity_))); set_has_quantity(); } else { goto handle_unusual; } if (input->ExpectTag(48)) goto parse_level; break; } // optional uint32 level = 6 [default = 1]; case 6: { if (tag == 48) { parse_level: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &level_))); set_has_level(); } else { goto handle_unusual; } if (input->ExpectTag(56)) goto parse_quality; break; } // optional uint32 quality = 7 [default = 4]; case 7: { if (tag == 56) { parse_quality: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &quality_))); set_has_quality(); } else { goto handle_unusual; } if (input->ExpectTag(64)) goto parse_flags; break; } // optional uint32 flags = 8 [default = 0]; case 8: { if (tag == 64) { parse_flags: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &flags_))); set_has_flags(); } else { goto handle_unusual; } if (input->ExpectTag(72)) goto parse_origin; break; } // optional uint32 origin = 9 [default = 0]; case 9: { if (tag == 72) { parse_origin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &origin_))); set_has_origin(); } else { goto handle_unusual; } if (input->ExpectTag(98)) goto parse_attribute; break; } // repeated .CSOEconItemAttribute attribute = 12; case 12: { if (tag == 98) { parse_attribute: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_attribute())); } else { goto handle_unusual; } if (input->ExpectTag(98)) goto parse_attribute; if (input->ExpectTag(106)) goto parse_interior_item; break; } // optional .CSOEconItem interior_item = 13; case 13: { if (tag == 106) { parse_interior_item: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_interior_item())); } else { goto handle_unusual; } if (input->ExpectTag(112)) goto parse_in_use; break; } // optional bool in_use = 14 [default = false]; case 14: { if (tag == 112) { parse_in_use: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &in_use_))); set_has_in_use(); } else { goto handle_unusual; } if (input->ExpectTag(120)) goto parse_style; break; } // optional uint32 style = 15 [default = 0]; case 15: { if (tag == 120) { parse_style: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &style_))); set_has_style(); } else { goto handle_unusual; } if (input->ExpectTag(128)) goto parse_original_id; break; } // optional uint64 original_id = 16 [default = 0]; case 16: { if (tag == 128) { parse_original_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &original_id_))); set_has_original_id(); } else { goto handle_unusual; } if (input->ExpectTag(146)) goto parse_equipped_state; break; } // repeated .CSOEconItemEquipped equipped_state = 18; case 18: { if (tag == 146) { parse_equipped_state: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_equipped_state())); } else { goto handle_unusual; } if (input->ExpectTag(146)) goto parse_equipped_state; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconItem) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconItem) return false; #undef DO_ } void CSOEconItem::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconItem) // optional uint64 id = 1; if (has_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->id(), output); } // optional uint32 account_id = 2; if (has_account_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->account_id(), output); } // optional uint32 inventory = 3; if (has_inventory()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->inventory(), output); } // optional uint32 def_index = 4; if (has_def_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->def_index(), output); } // optional uint32 quantity = 5 [default = 1]; if (has_quantity()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->quantity(), output); } // optional uint32 level = 6 [default = 1]; if (has_level()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->level(), output); } // optional uint32 quality = 7 [default = 4]; if (has_quality()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->quality(), output); } // optional uint32 flags = 8 [default = 0]; if (has_flags()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->flags(), output); } // optional uint32 origin = 9 [default = 0]; if (has_origin()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->origin(), output); } // repeated .CSOEconItemAttribute attribute = 12; for (int i = 0; i < this->attribute_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 12, this->attribute(i), output); } // optional .CSOEconItem interior_item = 13; if (has_interior_item()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 13, this->interior_item(), output); } // optional bool in_use = 14 [default = false]; if (has_in_use()) { ::google::protobuf::internal::WireFormatLite::WriteBool(14, this->in_use(), output); } // optional uint32 style = 15 [default = 0]; if (has_style()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(15, this->style(), output); } // optional uint64 original_id = 16 [default = 0]; if (has_original_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(16, this->original_id(), output); } // repeated .CSOEconItemEquipped equipped_state = 18; for (int i = 0; i < this->equipped_state_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 18, this->equipped_state(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconItem) } ::google::protobuf::uint8* CSOEconItem::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconItem) // optional uint64 id = 1; if (has_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), target); } // optional uint32 account_id = 2; if (has_account_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->account_id(), target); } // optional uint32 inventory = 3; if (has_inventory()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->inventory(), target); } // optional uint32 def_index = 4; if (has_def_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->def_index(), target); } // optional uint32 quantity = 5 [default = 1]; if (has_quantity()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->quantity(), target); } // optional uint32 level = 6 [default = 1]; if (has_level()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->level(), target); } // optional uint32 quality = 7 [default = 4]; if (has_quality()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->quality(), target); } // optional uint32 flags = 8 [default = 0]; if (has_flags()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->flags(), target); } // optional uint32 origin = 9 [default = 0]; if (has_origin()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->origin(), target); } // repeated .CSOEconItemAttribute attribute = 12; for (int i = 0; i < this->attribute_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 12, this->attribute(i), target); } // optional .CSOEconItem interior_item = 13; if (has_interior_item()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 13, this->interior_item(), target); } // optional bool in_use = 14 [default = false]; if (has_in_use()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(14, this->in_use(), target); } // optional uint32 style = 15 [default = 0]; if (has_style()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(15, this->style(), target); } // optional uint64 original_id = 16 [default = 0]; if (has_original_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(16, this->original_id(), target); } // repeated .CSOEconItemEquipped equipped_state = 18; for (int i = 0; i < this->equipped_state_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 18, this->equipped_state(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconItem) return target; } int CSOEconItem::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 id = 1; if (has_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->id()); } // optional uint32 account_id = 2; if (has_account_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->account_id()); } // optional uint32 inventory = 3; if (has_inventory()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->inventory()); } // optional uint32 def_index = 4; if (has_def_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->def_index()); } // optional uint32 quantity = 5 [default = 1]; if (has_quantity()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->quantity()); } // optional uint32 level = 6 [default = 1]; if (has_level()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->level()); } // optional uint32 quality = 7 [default = 4]; if (has_quality()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->quality()); } // optional uint32 flags = 8 [default = 0]; if (has_flags()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->flags()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional uint32 origin = 9 [default = 0]; if (has_origin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->origin()); } // optional .CSOEconItem interior_item = 13; if (has_interior_item()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->interior_item()); } // optional bool in_use = 14 [default = false]; if (has_in_use()) { total_size += 1 + 1; } // optional uint32 style = 15 [default = 0]; if (has_style()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->style()); } // optional uint64 original_id = 16 [default = 0]; if (has_original_id()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->original_id()); } } // repeated .CSOEconItemAttribute attribute = 12; total_size += 1 * this->attribute_size(); for (int i = 0; i < this->attribute_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->attribute(i)); } // repeated .CSOEconItemEquipped equipped_state = 18; total_size += 2 * this->equipped_state_size(); for (int i = 0; i < this->equipped_state_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->equipped_state(i)); } 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; } void CSOEconItem::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconItem* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconItem*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconItem::MergeFrom(const CSOEconItem& from) { GOOGLE_CHECK_NE(&from, this); attribute_.MergeFrom(from.attribute_); equipped_state_.MergeFrom(from.equipped_state_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_id()) { set_id(from.id()); } if (from.has_account_id()) { set_account_id(from.account_id()); } if (from.has_inventory()) { set_inventory(from.inventory()); } if (from.has_def_index()) { set_def_index(from.def_index()); } if (from.has_quantity()) { set_quantity(from.quantity()); } if (from.has_level()) { set_level(from.level()); } if (from.has_quality()) { set_quality(from.quality()); } if (from.has_flags()) { set_flags(from.flags()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_origin()) { set_origin(from.origin()); } if (from.has_interior_item()) { mutable_interior_item()->::CSOEconItem::MergeFrom(from.interior_item()); } if (from.has_in_use()) { set_in_use(from.in_use()); } if (from.has_style()) { set_style(from.style()); } if (from.has_original_id()) { set_original_id(from.original_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconItem::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconItem::CopyFrom(const CSOEconItem& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconItem::IsInitialized() const { return true; } void CSOEconItem::Swap(CSOEconItem* other) { if (other != this) { std::swap(id_, other->id_); std::swap(account_id_, other->account_id_); std::swap(inventory_, other->inventory_); std::swap(def_index_, other->def_index_); std::swap(quantity_, other->quantity_); std::swap(level_, other->level_); std::swap(quality_, other->quality_); std::swap(flags_, other->flags_); std::swap(origin_, other->origin_); attribute_.Swap(&other->attribute_); std::swap(interior_item_, other->interior_item_); std::swap(in_use_, other->in_use_); std::swap(style_, other->style_); std::swap(original_id_, other->original_id_); equipped_state_.Swap(&other->equipped_state_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconItem::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconItem_descriptor_; metadata.reflection = CSOEconItem_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgSortItems::kSortTypeFieldNumber; #endif // !_MSC_VER CMsgSortItems::CMsgSortItems() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgSortItems) } void CMsgSortItems::InitAsDefaultInstance() { } CMsgSortItems::CMsgSortItems(const CMsgSortItems& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgSortItems) } void CMsgSortItems::SharedCtor() { _cached_size_ = 0; sort_type_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgSortItems::~CMsgSortItems() { // @@protoc_insertion_point(destructor:CMsgSortItems) SharedDtor(); } void CMsgSortItems::SharedDtor() { if (this != default_instance_) { } } void CMsgSortItems::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgSortItems::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgSortItems_descriptor_; } const CMsgSortItems& CMsgSortItems::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgSortItems* CMsgSortItems::default_instance_ = NULL; CMsgSortItems* CMsgSortItems::New() const { return new CMsgSortItems; } void CMsgSortItems::Clear() { sort_type_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgSortItems::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgSortItems) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 sort_type = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &sort_type_))); set_has_sort_type(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgSortItems) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgSortItems) return false; #undef DO_ } void CMsgSortItems::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgSortItems) // optional uint32 sort_type = 1; if (has_sort_type()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sort_type(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgSortItems) } ::google::protobuf::uint8* CMsgSortItems::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgSortItems) // optional uint32 sort_type = 1; if (has_sort_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->sort_type(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgSortItems) return target; } int CMsgSortItems::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 sort_type = 1; if (has_sort_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->sort_type()); } } 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; } void CMsgSortItems::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgSortItems* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgSortItems*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgSortItems::MergeFrom(const CMsgSortItems& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_sort_type()) { set_sort_type(from.sort_type()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgSortItems::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgSortItems::CopyFrom(const CMsgSortItems& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgSortItems::IsInitialized() const { return true; } void CMsgSortItems::Swap(CMsgSortItems* other) { if (other != this) { std::swap(sort_type_, other->sort_type_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgSortItems::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgSortItems_descriptor_; metadata.reflection = CMsgSortItems_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconClaimCode::kAccountIdFieldNumber; const int CSOEconClaimCode::kCodeTypeFieldNumber; const int CSOEconClaimCode::kTimeAcquiredFieldNumber; const int CSOEconClaimCode::kCodeFieldNumber; #endif // !_MSC_VER CSOEconClaimCode::CSOEconClaimCode() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconClaimCode) } void CSOEconClaimCode::InitAsDefaultInstance() { } CSOEconClaimCode::CSOEconClaimCode(const CSOEconClaimCode& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconClaimCode) } void CSOEconClaimCode::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; account_id_ = 0u; code_type_ = 0u; time_acquired_ = 0u; code_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconClaimCode::~CSOEconClaimCode() { // @@protoc_insertion_point(destructor:CSOEconClaimCode) SharedDtor(); } void CSOEconClaimCode::SharedDtor() { if (code_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete code_; } if (this != default_instance_) { } } void CSOEconClaimCode::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconClaimCode::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconClaimCode_descriptor_; } const CSOEconClaimCode& CSOEconClaimCode::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconClaimCode* CSOEconClaimCode::default_instance_ = NULL; CSOEconClaimCode* CSOEconClaimCode::New() const { return new CSOEconClaimCode; } void CSOEconClaimCode::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconClaimCode*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 15) { ZR_(account_id_, code_type_); time_acquired_ = 0u; if (has_code()) { if (code_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { code_->clear(); } } } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconClaimCode::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconClaimCode) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 account_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &account_id_))); set_has_account_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_code_type; break; } // optional uint32 code_type = 2; case 2: { if (tag == 16) { parse_code_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &code_type_))); set_has_code_type(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_time_acquired; break; } // optional uint32 time_acquired = 3; case 3: { if (tag == 24) { parse_time_acquired: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &time_acquired_))); set_has_time_acquired(); } else { goto handle_unusual; } if (input->ExpectTag(34)) goto parse_code; break; } // optional string code = 4; case 4: { if (tag == 34) { parse_code: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_code())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->code().data(), this->code().length(), ::google::protobuf::internal::WireFormat::PARSE, "code"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconClaimCode) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconClaimCode) return false; #undef DO_ } void CSOEconClaimCode::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconClaimCode) // optional uint32 account_id = 1; if (has_account_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->account_id(), output); } // optional uint32 code_type = 2; if (has_code_type()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->code_type(), output); } // optional uint32 time_acquired = 3; if (has_time_acquired()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->time_acquired(), output); } // optional string code = 4; if (has_code()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->code().data(), this->code().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "code"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 4, this->code(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconClaimCode) } ::google::protobuf::uint8* CSOEconClaimCode::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconClaimCode) // optional uint32 account_id = 1; if (has_account_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->account_id(), target); } // optional uint32 code_type = 2; if (has_code_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->code_type(), target); } // optional uint32 time_acquired = 3; if (has_time_acquired()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->time_acquired(), target); } // optional string code = 4; if (has_code()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->code().data(), this->code().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "code"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 4, this->code(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconClaimCode) return target; } int CSOEconClaimCode::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 account_id = 1; if (has_account_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->account_id()); } // optional uint32 code_type = 2; if (has_code_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->code_type()); } // optional uint32 time_acquired = 3; if (has_time_acquired()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->time_acquired()); } // optional string code = 4; if (has_code()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->code()); } } 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; } void CSOEconClaimCode::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconClaimCode* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconClaimCode*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconClaimCode::MergeFrom(const CSOEconClaimCode& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_account_id()) { set_account_id(from.account_id()); } if (from.has_code_type()) { set_code_type(from.code_type()); } if (from.has_time_acquired()) { set_time_acquired(from.time_acquired()); } if (from.has_code()) { set_code(from.code()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconClaimCode::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconClaimCode::CopyFrom(const CSOEconClaimCode& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconClaimCode::IsInitialized() const { return true; } void CSOEconClaimCode::Swap(CSOEconClaimCode* other) { if (other != this) { std::swap(account_id_, other->account_id_); std::swap(code_type_, other->code_type_); std::swap(time_acquired_, other->time_acquired_); std::swap(code_, other->code_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconClaimCode::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconClaimCode_descriptor_; metadata.reflection = CSOEconClaimCode_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgStoreGetUserData::kPriceSheetVersionFieldNumber; #endif // !_MSC_VER CMsgStoreGetUserData::CMsgStoreGetUserData() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgStoreGetUserData) } void CMsgStoreGetUserData::InitAsDefaultInstance() { } CMsgStoreGetUserData::CMsgStoreGetUserData(const CMsgStoreGetUserData& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgStoreGetUserData) } void CMsgStoreGetUserData::SharedCtor() { _cached_size_ = 0; price_sheet_version_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgStoreGetUserData::~CMsgStoreGetUserData() { // @@protoc_insertion_point(destructor:CMsgStoreGetUserData) SharedDtor(); } void CMsgStoreGetUserData::SharedDtor() { if (this != default_instance_) { } } void CMsgStoreGetUserData::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgStoreGetUserData::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgStoreGetUserData_descriptor_; } const CMsgStoreGetUserData& CMsgStoreGetUserData::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgStoreGetUserData* CMsgStoreGetUserData::default_instance_ = NULL; CMsgStoreGetUserData* CMsgStoreGetUserData::New() const { return new CMsgStoreGetUserData; } void CMsgStoreGetUserData::Clear() { price_sheet_version_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgStoreGetUserData::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgStoreGetUserData) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional fixed32 price_sheet_version = 1; case 1: { if (tag == 13) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &price_sheet_version_))); set_has_price_sheet_version(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgStoreGetUserData) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgStoreGetUserData) return false; #undef DO_ } void CMsgStoreGetUserData::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgStoreGetUserData) // optional fixed32 price_sheet_version = 1; if (has_price_sheet_version()) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(1, this->price_sheet_version(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgStoreGetUserData) } ::google::protobuf::uint8* CMsgStoreGetUserData::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgStoreGetUserData) // optional fixed32 price_sheet_version = 1; if (has_price_sheet_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(1, this->price_sheet_version(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgStoreGetUserData) return target; } int CMsgStoreGetUserData::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional fixed32 price_sheet_version = 1; if (has_price_sheet_version()) { total_size += 1 + 4; } } 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; } void CMsgStoreGetUserData::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgStoreGetUserData* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgStoreGetUserData*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgStoreGetUserData::MergeFrom(const CMsgStoreGetUserData& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_price_sheet_version()) { set_price_sheet_version(from.price_sheet_version()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgStoreGetUserData::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgStoreGetUserData::CopyFrom(const CMsgStoreGetUserData& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgStoreGetUserData::IsInitialized() const { return true; } void CMsgStoreGetUserData::Swap(CMsgStoreGetUserData* other) { if (other != this) { std::swap(price_sheet_version_, other->price_sheet_version_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgStoreGetUserData::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgStoreGetUserData_descriptor_; metadata.reflection = CMsgStoreGetUserData_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgStoreGetUserDataResponse::kResultFieldNumber; const int CMsgStoreGetUserDataResponse::kCurrencyFieldNumber; const int CMsgStoreGetUserDataResponse::kCountryFieldNumber; const int CMsgStoreGetUserDataResponse::kPriceSheetVersionFieldNumber; const int CMsgStoreGetUserDataResponse::kExperimentDataFieldNumber; const int CMsgStoreGetUserDataResponse::kFeaturedItemIdxFieldNumber; const int CMsgStoreGetUserDataResponse::kShowHatDescriptionsFieldNumber; const int CMsgStoreGetUserDataResponse::kPriceSheetFieldNumber; const int CMsgStoreGetUserDataResponse::kDefaultItemSortFieldNumber; const int CMsgStoreGetUserDataResponse::kPopularItemsFieldNumber; #endif // !_MSC_VER CMsgStoreGetUserDataResponse::CMsgStoreGetUserDataResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgStoreGetUserDataResponse) } void CMsgStoreGetUserDataResponse::InitAsDefaultInstance() { } CMsgStoreGetUserDataResponse::CMsgStoreGetUserDataResponse(const CMsgStoreGetUserDataResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgStoreGetUserDataResponse) } void CMsgStoreGetUserDataResponse::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; result_ = 0; currency_ = 0; country_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); price_sheet_version_ = 0u; experiment_data_ = GOOGLE_ULONGLONG(0); featured_item_idx_ = 0; show_hat_descriptions_ = true; price_sheet_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); default_item_sort_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgStoreGetUserDataResponse::~CMsgStoreGetUserDataResponse() { // @@protoc_insertion_point(destructor:CMsgStoreGetUserDataResponse) SharedDtor(); } void CMsgStoreGetUserDataResponse::SharedDtor() { if (country_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete country_; } if (price_sheet_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete price_sheet_; } if (this != default_instance_) { } } void CMsgStoreGetUserDataResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgStoreGetUserDataResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgStoreGetUserDataResponse_descriptor_; } const CMsgStoreGetUserDataResponse& CMsgStoreGetUserDataResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgStoreGetUserDataResponse* CMsgStoreGetUserDataResponse::default_instance_ = NULL; CMsgStoreGetUserDataResponse* CMsgStoreGetUserDataResponse::New() const { return new CMsgStoreGetUserDataResponse; } void CMsgStoreGetUserDataResponse::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgStoreGetUserDataResponse*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 255) { ZR_(result_, currency_); ZR_(experiment_data_, featured_item_idx_); if (has_country()) { if (country_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { country_->clear(); } } show_hat_descriptions_ = true; if (has_price_sheet()) { if (price_sheet_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { price_sheet_->clear(); } } } default_item_sort_ = 0; #undef OFFSET_OF_FIELD_ #undef ZR_ popular_items_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgStoreGetUserDataResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgStoreGetUserDataResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 result = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &result_))); set_has_result(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_currency; break; } // optional int32 currency = 2; case 2: { if (tag == 16) { parse_currency: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &currency_))); set_has_currency(); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_country; break; } // optional string country = 3; case 3: { if (tag == 26) { parse_country: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_country())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->country().data(), this->country().length(), ::google::protobuf::internal::WireFormat::PARSE, "country"); } else { goto handle_unusual; } if (input->ExpectTag(37)) goto parse_price_sheet_version; break; } // optional fixed32 price_sheet_version = 4; case 4: { if (tag == 37) { parse_price_sheet_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &price_sheet_version_))); set_has_price_sheet_version(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_experiment_data; break; } // optional uint64 experiment_data = 5 [default = 0]; case 5: { if (tag == 40) { parse_experiment_data: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &experiment_data_))); set_has_experiment_data(); } else { goto handle_unusual; } if (input->ExpectTag(48)) goto parse_featured_item_idx; break; } // optional int32 featured_item_idx = 6; case 6: { if (tag == 48) { parse_featured_item_idx: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &featured_item_idx_))); set_has_featured_item_idx(); } else { goto handle_unusual; } if (input->ExpectTag(56)) goto parse_show_hat_descriptions; break; } // optional bool show_hat_descriptions = 7 [default = true]; case 7: { if (tag == 56) { parse_show_hat_descriptions: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &show_hat_descriptions_))); set_has_show_hat_descriptions(); } else { goto handle_unusual; } if (input->ExpectTag(66)) goto parse_price_sheet; break; } // optional bytes price_sheet = 8; case 8: { if (tag == 66) { parse_price_sheet: DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_price_sheet())); } else { goto handle_unusual; } if (input->ExpectTag(72)) goto parse_default_item_sort; break; } // optional int32 default_item_sort = 9 [default = 0]; case 9: { if (tag == 72) { parse_default_item_sort: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &default_item_sort_))); set_has_default_item_sort(); } else { goto handle_unusual; } if (input->ExpectTag(80)) goto parse_popular_items; break; } // repeated uint32 popular_items = 10; case 10: { if (tag == 80) { parse_popular_items: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1, 80, input, this->mutable_popular_items()))); } else if (tag == 82) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, this->mutable_popular_items()))); } else { goto handle_unusual; } if (input->ExpectTag(80)) goto parse_popular_items; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgStoreGetUserDataResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgStoreGetUserDataResponse) return false; #undef DO_ } void CMsgStoreGetUserDataResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgStoreGetUserDataResponse) // optional int32 result = 1; if (has_result()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->result(), output); } // optional int32 currency = 2; if (has_currency()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->currency(), output); } // optional string country = 3; if (has_country()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->country().data(), this->country().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "country"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 3, this->country(), output); } // optional fixed32 price_sheet_version = 4; if (has_price_sheet_version()) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(4, this->price_sheet_version(), output); } // optional uint64 experiment_data = 5 [default = 0]; if (has_experiment_data()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->experiment_data(), output); } // optional int32 featured_item_idx = 6; if (has_featured_item_idx()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->featured_item_idx(), output); } // optional bool show_hat_descriptions = 7 [default = true]; if (has_show_hat_descriptions()) { ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->show_hat_descriptions(), output); } // optional bytes price_sheet = 8; if (has_price_sheet()) { ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 8, this->price_sheet(), output); } // optional int32 default_item_sort = 9 [default = 0]; if (has_default_item_sort()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->default_item_sort(), output); } // repeated uint32 popular_items = 10; for (int i = 0; i < this->popular_items_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt32( 10, this->popular_items(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgStoreGetUserDataResponse) } ::google::protobuf::uint8* CMsgStoreGetUserDataResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgStoreGetUserDataResponse) // optional int32 result = 1; if (has_result()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->result(), target); } // optional int32 currency = 2; if (has_currency()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->currency(), target); } // optional string country = 3; if (has_country()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->country().data(), this->country().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "country"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->country(), target); } // optional fixed32 price_sheet_version = 4; if (has_price_sheet_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(4, this->price_sheet_version(), target); } // optional uint64 experiment_data = 5 [default = 0]; if (has_experiment_data()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->experiment_data(), target); } // optional int32 featured_item_idx = 6; if (has_featured_item_idx()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->featured_item_idx(), target); } // optional bool show_hat_descriptions = 7 [default = true]; if (has_show_hat_descriptions()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->show_hat_descriptions(), target); } // optional bytes price_sheet = 8; if (has_price_sheet()) { target = ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 8, this->price_sheet(), target); } // optional int32 default_item_sort = 9 [default = 0]; if (has_default_item_sort()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->default_item_sort(), target); } // repeated uint32 popular_items = 10; for (int i = 0; i < this->popular_items_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt32ToArray(10, this->popular_items(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgStoreGetUserDataResponse) return target; } int CMsgStoreGetUserDataResponse::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()); } // optional int32 currency = 2; if (has_currency()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->currency()); } // optional string country = 3; if (has_country()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->country()); } // optional fixed32 price_sheet_version = 4; if (has_price_sheet_version()) { total_size += 1 + 4; } // optional uint64 experiment_data = 5 [default = 0]; if (has_experiment_data()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->experiment_data()); } // optional int32 featured_item_idx = 6; if (has_featured_item_idx()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->featured_item_idx()); } // optional bool show_hat_descriptions = 7 [default = true]; if (has_show_hat_descriptions()) { total_size += 1 + 1; } // optional bytes price_sheet = 8; if (has_price_sheet()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( this->price_sheet()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional int32 default_item_sort = 9 [default = 0]; if (has_default_item_sort()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->default_item_sort()); } } // repeated uint32 popular_items = 10; { int data_size = 0; for (int i = 0; i < this->popular_items_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt32Size(this->popular_items(i)); } total_size += 1 * this->popular_items_size() + data_size; } 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; } void CMsgStoreGetUserDataResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgStoreGetUserDataResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgStoreGetUserDataResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgStoreGetUserDataResponse::MergeFrom(const CMsgStoreGetUserDataResponse& from) { GOOGLE_CHECK_NE(&from, this); popular_items_.MergeFrom(from.popular_items_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_result()) { set_result(from.result()); } if (from.has_currency()) { set_currency(from.currency()); } if (from.has_country()) { set_country(from.country()); } if (from.has_price_sheet_version()) { set_price_sheet_version(from.price_sheet_version()); } if (from.has_experiment_data()) { set_experiment_data(from.experiment_data()); } if (from.has_featured_item_idx()) { set_featured_item_idx(from.featured_item_idx()); } if (from.has_show_hat_descriptions()) { set_show_hat_descriptions(from.show_hat_descriptions()); } if (from.has_price_sheet()) { set_price_sheet(from.price_sheet()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_default_item_sort()) { set_default_item_sort(from.default_item_sort()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgStoreGetUserDataResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgStoreGetUserDataResponse::CopyFrom(const CMsgStoreGetUserDataResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgStoreGetUserDataResponse::IsInitialized() const { return true; } void CMsgStoreGetUserDataResponse::Swap(CMsgStoreGetUserDataResponse* other) { if (other != this) { std::swap(result_, other->result_); std::swap(currency_, other->currency_); std::swap(country_, other->country_); std::swap(price_sheet_version_, other->price_sheet_version_); std::swap(experiment_data_, other->experiment_data_); std::swap(featured_item_idx_, other->featured_item_idx_); std::swap(show_hat_descriptions_, other->show_hat_descriptions_); std::swap(price_sheet_, other->price_sheet_); std::swap(default_item_sort_, other->default_item_sort_); popular_items_.Swap(&other->popular_items_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgStoreGetUserDataResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgStoreGetUserDataResponse_descriptor_; metadata.reflection = CMsgStoreGetUserDataResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgUpdateItemSchema::kItemsGameFieldNumber; const int CMsgUpdateItemSchema::kItemSchemaVersionFieldNumber; const int CMsgUpdateItemSchema::kItemsGameUrlFieldNumber; #endif // !_MSC_VER CMsgUpdateItemSchema::CMsgUpdateItemSchema() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgUpdateItemSchema) } void CMsgUpdateItemSchema::InitAsDefaultInstance() { } CMsgUpdateItemSchema::CMsgUpdateItemSchema(const CMsgUpdateItemSchema& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgUpdateItemSchema) } void CMsgUpdateItemSchema::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; items_game_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); item_schema_version_ = 0u; items_game_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgUpdateItemSchema::~CMsgUpdateItemSchema() { // @@protoc_insertion_point(destructor:CMsgUpdateItemSchema) SharedDtor(); } void CMsgUpdateItemSchema::SharedDtor() { if (items_game_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete items_game_; } if (items_game_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete items_game_url_; } if (this != default_instance_) { } } void CMsgUpdateItemSchema::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgUpdateItemSchema::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgUpdateItemSchema_descriptor_; } const CMsgUpdateItemSchema& CMsgUpdateItemSchema::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgUpdateItemSchema* CMsgUpdateItemSchema::default_instance_ = NULL; CMsgUpdateItemSchema* CMsgUpdateItemSchema::New() const { return new CMsgUpdateItemSchema; } void CMsgUpdateItemSchema::Clear() { if (_has_bits_[0 / 32] & 7) { if (has_items_game()) { if (items_game_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { items_game_->clear(); } } item_schema_version_ = 0u; if (has_items_game_url()) { if (items_game_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { items_game_url_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgUpdateItemSchema::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgUpdateItemSchema) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bytes items_game = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_items_game())); } else { goto handle_unusual; } if (input->ExpectTag(21)) goto parse_item_schema_version; break; } // optional fixed32 item_schema_version = 2; case 2: { if (tag == 21) { parse_item_schema_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &item_schema_version_))); set_has_item_schema_version(); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_items_game_url; break; } // optional string items_game_url = 3; case 3: { if (tag == 26) { parse_items_game_url: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_items_game_url())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->items_game_url().data(), this->items_game_url().length(), ::google::protobuf::internal::WireFormat::PARSE, "items_game_url"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgUpdateItemSchema) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgUpdateItemSchema) return false; #undef DO_ } void CMsgUpdateItemSchema::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgUpdateItemSchema) // optional bytes items_game = 1; if (has_items_game()) { ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( 1, this->items_game(), output); } // optional fixed32 item_schema_version = 2; if (has_item_schema_version()) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(2, this->item_schema_version(), output); } // optional string items_game_url = 3; if (has_items_game_url()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->items_game_url().data(), this->items_game_url().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "items_game_url"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 3, this->items_game_url(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgUpdateItemSchema) } ::google::protobuf::uint8* CMsgUpdateItemSchema::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgUpdateItemSchema) // optional bytes items_game = 1; if (has_items_game()) { target = ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( 1, this->items_game(), target); } // optional fixed32 item_schema_version = 2; if (has_item_schema_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(2, this->item_schema_version(), target); } // optional string items_game_url = 3; if (has_items_game_url()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->items_game_url().data(), this->items_game_url().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "items_game_url"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->items_game_url(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgUpdateItemSchema) return target; } int CMsgUpdateItemSchema::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional bytes items_game = 1; if (has_items_game()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( this->items_game()); } // optional fixed32 item_schema_version = 2; if (has_item_schema_version()) { total_size += 1 + 4; } // optional string items_game_url = 3; if (has_items_game_url()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->items_game_url()); } } 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; } void CMsgUpdateItemSchema::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgUpdateItemSchema* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgUpdateItemSchema*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgUpdateItemSchema::MergeFrom(const CMsgUpdateItemSchema& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_items_game()) { set_items_game(from.items_game()); } if (from.has_item_schema_version()) { set_item_schema_version(from.item_schema_version()); } if (from.has_items_game_url()) { set_items_game_url(from.items_game_url()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgUpdateItemSchema::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgUpdateItemSchema::CopyFrom(const CMsgUpdateItemSchema& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgUpdateItemSchema::IsInitialized() const { return true; } void CMsgUpdateItemSchema::Swap(CMsgUpdateItemSchema* other) { if (other != this) { std::swap(items_game_, other->items_game_); std::swap(item_schema_version_, other->item_schema_version_); std::swap(items_game_url_, other->items_game_url_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgUpdateItemSchema::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgUpdateItemSchema_descriptor_; metadata.reflection = CMsgUpdateItemSchema_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCError::kErrorTextFieldNumber; #endif // !_MSC_VER CMsgGCError::CMsgGCError() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCError) } void CMsgGCError::InitAsDefaultInstance() { } CMsgGCError::CMsgGCError(const CMsgGCError& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCError) } void CMsgGCError::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; error_text_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCError::~CMsgGCError() { // @@protoc_insertion_point(destructor:CMsgGCError) SharedDtor(); } void CMsgGCError::SharedDtor() { if (error_text_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete error_text_; } if (this != default_instance_) { } } void CMsgGCError::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCError::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCError_descriptor_; } const CMsgGCError& CMsgGCError::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCError* CMsgGCError::default_instance_ = NULL; CMsgGCError* CMsgGCError::New() const { return new CMsgGCError; } void CMsgGCError::Clear() { if (has_error_text()) { if (error_text_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { error_text_->clear(); } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCError::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCError) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string error_text = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_error_text())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->error_text().data(), this->error_text().length(), ::google::protobuf::internal::WireFormat::PARSE, "error_text"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCError) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCError) return false; #undef DO_ } void CMsgGCError::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCError) // optional string error_text = 1; if (has_error_text()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->error_text().data(), this->error_text().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "error_text"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->error_text(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCError) } ::google::protobuf::uint8* CMsgGCError::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCError) // optional string error_text = 1; if (has_error_text()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->error_text().data(), this->error_text().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "error_text"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->error_text(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCError) return target; } int CMsgGCError::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string error_text = 1; if (has_error_text()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->error_text()); } } 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; } void CMsgGCError::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCError* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCError*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCError::MergeFrom(const CMsgGCError& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_error_text()) { set_error_text(from.error_text()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCError::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCError::CopyFrom(const CMsgGCError& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCError::IsInitialized() const { return true; } void CMsgGCError::Swap(CMsgGCError* other) { if (other != this) { std::swap(error_text_, other->error_text_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCError::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCError_descriptor_; metadata.reflection = CMsgGCError_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER CMsgRequestInventoryRefresh::CMsgRequestInventoryRefresh() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgRequestInventoryRefresh) } void CMsgRequestInventoryRefresh::InitAsDefaultInstance() { } CMsgRequestInventoryRefresh::CMsgRequestInventoryRefresh(const CMsgRequestInventoryRefresh& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgRequestInventoryRefresh) } void CMsgRequestInventoryRefresh::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgRequestInventoryRefresh::~CMsgRequestInventoryRefresh() { // @@protoc_insertion_point(destructor:CMsgRequestInventoryRefresh) SharedDtor(); } void CMsgRequestInventoryRefresh::SharedDtor() { if (this != default_instance_) { } } void CMsgRequestInventoryRefresh::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgRequestInventoryRefresh::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgRequestInventoryRefresh_descriptor_; } const CMsgRequestInventoryRefresh& CMsgRequestInventoryRefresh::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgRequestInventoryRefresh* CMsgRequestInventoryRefresh::default_instance_ = NULL; CMsgRequestInventoryRefresh* CMsgRequestInventoryRefresh::New() const { return new CMsgRequestInventoryRefresh; } void CMsgRequestInventoryRefresh::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgRequestInventoryRefresh::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgRequestInventoryRefresh) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } success: // @@protoc_insertion_point(parse_success:CMsgRequestInventoryRefresh) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgRequestInventoryRefresh) return false; #undef DO_ } void CMsgRequestInventoryRefresh::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgRequestInventoryRefresh) if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgRequestInventoryRefresh) } ::google::protobuf::uint8* CMsgRequestInventoryRefresh::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgRequestInventoryRefresh) if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgRequestInventoryRefresh) return target; } int CMsgRequestInventoryRefresh::ByteSize() const { int total_size = 0; 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; } void CMsgRequestInventoryRefresh::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgRequestInventoryRefresh* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgRequestInventoryRefresh*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgRequestInventoryRefresh::MergeFrom(const CMsgRequestInventoryRefresh& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgRequestInventoryRefresh::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgRequestInventoryRefresh::CopyFrom(const CMsgRequestInventoryRefresh& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgRequestInventoryRefresh::IsInitialized() const { return true; } void CMsgRequestInventoryRefresh::Swap(CMsgRequestInventoryRefresh* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgRequestInventoryRefresh::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgRequestInventoryRefresh_descriptor_; metadata.reflection = CMsgRequestInventoryRefresh_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgConVarValue::kNameFieldNumber; const int CMsgConVarValue::kValueFieldNumber; #endif // !_MSC_VER CMsgConVarValue::CMsgConVarValue() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgConVarValue) } void CMsgConVarValue::InitAsDefaultInstance() { } CMsgConVarValue::CMsgConVarValue(const CMsgConVarValue& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgConVarValue) } void CMsgConVarValue::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgConVarValue::~CMsgConVarValue() { // @@protoc_insertion_point(destructor:CMsgConVarValue) SharedDtor(); } void CMsgConVarValue::SharedDtor() { if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete name_; } if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete value_; } if (this != default_instance_) { } } void CMsgConVarValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgConVarValue::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgConVarValue_descriptor_; } const CMsgConVarValue& CMsgConVarValue::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgConVarValue* CMsgConVarValue::default_instance_ = NULL; CMsgConVarValue* CMsgConVarValue::New() const { return new CMsgConVarValue; } void CMsgConVarValue::Clear() { if (_has_bits_[0 / 32] & 3) { if (has_name()) { if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { name_->clear(); } } if (has_value()) { if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { value_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgConVarValue::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgConVarValue) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string name = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::PARSE, "name"); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_value; break; } // optional string value = 2; case 2: { if (tag == 18) { parse_value: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_value())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->value().data(), this->value().length(), ::google::protobuf::internal::WireFormat::PARSE, "value"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgConVarValue) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgConVarValue) return false; #undef DO_ } void CMsgConVarValue::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgConVarValue) // optional string name = 1; if (has_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->name(), output); } // optional string value = 2; if (has_value()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->value().data(), this->value().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "value"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->value(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgConVarValue) } ::google::protobuf::uint8* CMsgConVarValue::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgConVarValue) // optional string name = 1; if (has_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->name(), target); } // optional string value = 2; if (has_value()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->value().data(), this->value().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "value"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->value(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgConVarValue) return target; } int CMsgConVarValue::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string name = 1; if (has_name()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional string value = 2; if (has_value()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->value()); } } 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; } void CMsgConVarValue::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgConVarValue* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgConVarValue*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgConVarValue::MergeFrom(const CMsgConVarValue& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_name()) { set_name(from.name()); } if (from.has_value()) { set_value(from.value()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgConVarValue::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgConVarValue::CopyFrom(const CMsgConVarValue& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgConVarValue::IsInitialized() const { return true; } void CMsgConVarValue::Swap(CMsgConVarValue* other) { if (other != this) { std::swap(name_, other->name_); std::swap(value_, other->value_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgConVarValue::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgConVarValue_descriptor_; metadata.reflection = CMsgConVarValue_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgReplicateConVars::kConvarsFieldNumber; #endif // !_MSC_VER CMsgReplicateConVars::CMsgReplicateConVars() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgReplicateConVars) } void CMsgReplicateConVars::InitAsDefaultInstance() { } CMsgReplicateConVars::CMsgReplicateConVars(const CMsgReplicateConVars& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgReplicateConVars) } void CMsgReplicateConVars::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgReplicateConVars::~CMsgReplicateConVars() { // @@protoc_insertion_point(destructor:CMsgReplicateConVars) SharedDtor(); } void CMsgReplicateConVars::SharedDtor() { if (this != default_instance_) { } } void CMsgReplicateConVars::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgReplicateConVars::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgReplicateConVars_descriptor_; } const CMsgReplicateConVars& CMsgReplicateConVars::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgReplicateConVars* CMsgReplicateConVars::default_instance_ = NULL; CMsgReplicateConVars* CMsgReplicateConVars::New() const { return new CMsgReplicateConVars; } void CMsgReplicateConVars::Clear() { convars_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgReplicateConVars::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgReplicateConVars) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .CMsgConVarValue convars = 1; case 1: { if (tag == 10) { parse_convars: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_convars())); } else { goto handle_unusual; } if (input->ExpectTag(10)) goto parse_convars; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgReplicateConVars) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgReplicateConVars) return false; #undef DO_ } void CMsgReplicateConVars::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgReplicateConVars) // repeated .CMsgConVarValue convars = 1; for (int i = 0; i < this->convars_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1, this->convars(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgReplicateConVars) } ::google::protobuf::uint8* CMsgReplicateConVars::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgReplicateConVars) // repeated .CMsgConVarValue convars = 1; for (int i = 0; i < this->convars_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 1, this->convars(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgReplicateConVars) return target; } int CMsgReplicateConVars::ByteSize() const { int total_size = 0; // repeated .CMsgConVarValue convars = 1; total_size += 1 * this->convars_size(); for (int i = 0; i < this->convars_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->convars(i)); } 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; } void CMsgReplicateConVars::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgReplicateConVars* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgReplicateConVars*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgReplicateConVars::MergeFrom(const CMsgReplicateConVars& from) { GOOGLE_CHECK_NE(&from, this); convars_.MergeFrom(from.convars_); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgReplicateConVars::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgReplicateConVars::CopyFrom(const CMsgReplicateConVars& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgReplicateConVars::IsInitialized() const { return true; } void CMsgReplicateConVars::Swap(CMsgReplicateConVars* other) { if (other != this) { convars_.Swap(&other->convars_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgReplicateConVars::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgReplicateConVars_descriptor_; metadata.reflection = CMsgReplicateConVars_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgConsumableExhausted::kItemDefIdFieldNumber; #endif // !_MSC_VER CMsgConsumableExhausted::CMsgConsumableExhausted() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgConsumableExhausted) } void CMsgConsumableExhausted::InitAsDefaultInstance() { } CMsgConsumableExhausted::CMsgConsumableExhausted(const CMsgConsumableExhausted& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgConsumableExhausted) } void CMsgConsumableExhausted::SharedCtor() { _cached_size_ = 0; item_def_id_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgConsumableExhausted::~CMsgConsumableExhausted() { // @@protoc_insertion_point(destructor:CMsgConsumableExhausted) SharedDtor(); } void CMsgConsumableExhausted::SharedDtor() { if (this != default_instance_) { } } void CMsgConsumableExhausted::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgConsumableExhausted::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgConsumableExhausted_descriptor_; } const CMsgConsumableExhausted& CMsgConsumableExhausted::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgConsumableExhausted* CMsgConsumableExhausted::default_instance_ = NULL; CMsgConsumableExhausted* CMsgConsumableExhausted::New() const { return new CMsgConsumableExhausted; } void CMsgConsumableExhausted::Clear() { item_def_id_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgConsumableExhausted::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgConsumableExhausted) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 item_def_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &item_def_id_))); set_has_item_def_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgConsumableExhausted) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgConsumableExhausted) return false; #undef DO_ } void CMsgConsumableExhausted::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgConsumableExhausted) // optional int32 item_def_id = 1; if (has_item_def_id()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->item_def_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgConsumableExhausted) } ::google::protobuf::uint8* CMsgConsumableExhausted::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgConsumableExhausted) // optional int32 item_def_id = 1; if (has_item_def_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->item_def_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgConsumableExhausted) return target; } int CMsgConsumableExhausted::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 item_def_id = 1; if (has_item_def_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->item_def_id()); } } 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; } void CMsgConsumableExhausted::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgConsumableExhausted* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgConsumableExhausted*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgConsumableExhausted::MergeFrom(const CMsgConsumableExhausted& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_def_id()) { set_item_def_id(from.item_def_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgConsumableExhausted::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgConsumableExhausted::CopyFrom(const CMsgConsumableExhausted& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgConsumableExhausted::IsInitialized() const { return true; } void CMsgConsumableExhausted::Swap(CMsgConsumableExhausted* other) { if (other != this) { std::swap(item_def_id_, other->item_def_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgConsumableExhausted::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgConsumableExhausted_descriptor_; metadata.reflection = CMsgConsumableExhausted_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgItemAcknowledged::kAccountIdFieldNumber; const int CMsgItemAcknowledged::kInventoryFieldNumber; const int CMsgItemAcknowledged::kDefIndexFieldNumber; const int CMsgItemAcknowledged::kQualityFieldNumber; const int CMsgItemAcknowledged::kRarityFieldNumber; const int CMsgItemAcknowledged::kOriginFieldNumber; #endif // !_MSC_VER CMsgItemAcknowledged::CMsgItemAcknowledged() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgItemAcknowledged) } void CMsgItemAcknowledged::InitAsDefaultInstance() { } CMsgItemAcknowledged::CMsgItemAcknowledged(const CMsgItemAcknowledged& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgItemAcknowledged) } void CMsgItemAcknowledged::SharedCtor() { _cached_size_ = 0; account_id_ = 0u; inventory_ = 0u; def_index_ = 0u; quality_ = 0u; rarity_ = 0u; origin_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgItemAcknowledged::~CMsgItemAcknowledged() { // @@protoc_insertion_point(destructor:CMsgItemAcknowledged) SharedDtor(); } void CMsgItemAcknowledged::SharedDtor() { if (this != default_instance_) { } } void CMsgItemAcknowledged::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgItemAcknowledged::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgItemAcknowledged_descriptor_; } const CMsgItemAcknowledged& CMsgItemAcknowledged::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgItemAcknowledged* CMsgItemAcknowledged::default_instance_ = NULL; CMsgItemAcknowledged* CMsgItemAcknowledged::New() const { return new CMsgItemAcknowledged; } void CMsgItemAcknowledged::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgItemAcknowledged*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 63) { ZR_(account_id_, origin_); } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgItemAcknowledged::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgItemAcknowledged) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 account_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &account_id_))); set_has_account_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_inventory; break; } // optional uint32 inventory = 2; case 2: { if (tag == 16) { parse_inventory: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &inventory_))); set_has_inventory(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_def_index; break; } // optional uint32 def_index = 3; case 3: { if (tag == 24) { parse_def_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &def_index_))); set_has_def_index(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_quality; break; } // optional uint32 quality = 4; case 4: { if (tag == 32) { parse_quality: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &quality_))); set_has_quality(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_rarity; break; } // optional uint32 rarity = 5; case 5: { if (tag == 40) { parse_rarity: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &rarity_))); set_has_rarity(); } else { goto handle_unusual; } if (input->ExpectTag(48)) goto parse_origin; break; } // optional uint32 origin = 6; case 6: { if (tag == 48) { parse_origin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &origin_))); set_has_origin(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgItemAcknowledged) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgItemAcknowledged) return false; #undef DO_ } void CMsgItemAcknowledged::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgItemAcknowledged) // optional uint32 account_id = 1; if (has_account_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->account_id(), output); } // optional uint32 inventory = 2; if (has_inventory()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->inventory(), output); } // optional uint32 def_index = 3; if (has_def_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->def_index(), output); } // optional uint32 quality = 4; if (has_quality()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->quality(), output); } // optional uint32 rarity = 5; if (has_rarity()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->rarity(), output); } // optional uint32 origin = 6; if (has_origin()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->origin(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgItemAcknowledged) } ::google::protobuf::uint8* CMsgItemAcknowledged::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgItemAcknowledged) // optional uint32 account_id = 1; if (has_account_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->account_id(), target); } // optional uint32 inventory = 2; if (has_inventory()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->inventory(), target); } // optional uint32 def_index = 3; if (has_def_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->def_index(), target); } // optional uint32 quality = 4; if (has_quality()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->quality(), target); } // optional uint32 rarity = 5; if (has_rarity()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->rarity(), target); } // optional uint32 origin = 6; if (has_origin()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->origin(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgItemAcknowledged) return target; } int CMsgItemAcknowledged::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 account_id = 1; if (has_account_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->account_id()); } // optional uint32 inventory = 2; if (has_inventory()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->inventory()); } // optional uint32 def_index = 3; if (has_def_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->def_index()); } // optional uint32 quality = 4; if (has_quality()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->quality()); } // optional uint32 rarity = 5; if (has_rarity()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->rarity()); } // optional uint32 origin = 6; if (has_origin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->origin()); } } 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; } void CMsgItemAcknowledged::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgItemAcknowledged* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgItemAcknowledged*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgItemAcknowledged::MergeFrom(const CMsgItemAcknowledged& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_account_id()) { set_account_id(from.account_id()); } if (from.has_inventory()) { set_inventory(from.inventory()); } if (from.has_def_index()) { set_def_index(from.def_index()); } if (from.has_quality()) { set_quality(from.quality()); } if (from.has_rarity()) { set_rarity(from.rarity()); } if (from.has_origin()) { set_origin(from.origin()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgItemAcknowledged::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgItemAcknowledged::CopyFrom(const CMsgItemAcknowledged& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgItemAcknowledged::IsInitialized() const { return true; } void CMsgItemAcknowledged::Swap(CMsgItemAcknowledged* other) { if (other != this) { std::swap(account_id_, other->account_id_); std::swap(inventory_, other->inventory_); std::swap(def_index_, other->def_index_); std::swap(quality_, other->quality_); std::swap(rarity_, other->rarity_); std::swap(origin_, other->origin_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgItemAcknowledged::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgItemAcknowledged_descriptor_; metadata.reflection = CMsgItemAcknowledged_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgSetItemPositions_ItemPosition::kItemIdFieldNumber; const int CMsgSetItemPositions_ItemPosition::kPositionFieldNumber; #endif // !_MSC_VER CMsgSetItemPositions_ItemPosition::CMsgSetItemPositions_ItemPosition() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgSetItemPositions.ItemPosition) } void CMsgSetItemPositions_ItemPosition::InitAsDefaultInstance() { } CMsgSetItemPositions_ItemPosition::CMsgSetItemPositions_ItemPosition(const CMsgSetItemPositions_ItemPosition& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgSetItemPositions.ItemPosition) } void CMsgSetItemPositions_ItemPosition::SharedCtor() { _cached_size_ = 0; item_id_ = GOOGLE_ULONGLONG(0); position_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgSetItemPositions_ItemPosition::~CMsgSetItemPositions_ItemPosition() { // @@protoc_insertion_point(destructor:CMsgSetItemPositions.ItemPosition) SharedDtor(); } void CMsgSetItemPositions_ItemPosition::SharedDtor() { if (this != default_instance_) { } } void CMsgSetItemPositions_ItemPosition::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgSetItemPositions_ItemPosition::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgSetItemPositions_ItemPosition_descriptor_; } const CMsgSetItemPositions_ItemPosition& CMsgSetItemPositions_ItemPosition::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgSetItemPositions_ItemPosition* CMsgSetItemPositions_ItemPosition::default_instance_ = NULL; CMsgSetItemPositions_ItemPosition* CMsgSetItemPositions_ItemPosition::New() const { return new CMsgSetItemPositions_ItemPosition; } void CMsgSetItemPositions_ItemPosition::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgSetItemPositions_ItemPosition*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(item_id_, position_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgSetItemPositions_ItemPosition::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgSetItemPositions.ItemPosition) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_id_))); set_has_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_position; break; } // optional uint32 position = 2; case 2: { if (tag == 16) { parse_position: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &position_))); set_has_position(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgSetItemPositions.ItemPosition) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgSetItemPositions.ItemPosition) return false; #undef DO_ } void CMsgSetItemPositions_ItemPosition::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgSetItemPositions.ItemPosition) // optional uint64 item_id = 1; if (has_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->item_id(), output); } // optional uint32 position = 2; if (has_position()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->position(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgSetItemPositions.ItemPosition) } ::google::protobuf::uint8* CMsgSetItemPositions_ItemPosition::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgSetItemPositions.ItemPosition) // optional uint64 item_id = 1; if (has_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->item_id(), target); } // optional uint32 position = 2; if (has_position()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->position(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgSetItemPositions.ItemPosition) return target; } int CMsgSetItemPositions_ItemPosition::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 item_id = 1; if (has_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_id()); } // optional uint32 position = 2; if (has_position()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->position()); } } 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; } void CMsgSetItemPositions_ItemPosition::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgSetItemPositions_ItemPosition* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgSetItemPositions_ItemPosition*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgSetItemPositions_ItemPosition::MergeFrom(const CMsgSetItemPositions_ItemPosition& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_id()) { set_item_id(from.item_id()); } if (from.has_position()) { set_position(from.position()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgSetItemPositions_ItemPosition::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgSetItemPositions_ItemPosition::CopyFrom(const CMsgSetItemPositions_ItemPosition& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgSetItemPositions_ItemPosition::IsInitialized() const { return true; } void CMsgSetItemPositions_ItemPosition::Swap(CMsgSetItemPositions_ItemPosition* other) { if (other != this) { std::swap(item_id_, other->item_id_); std::swap(position_, other->position_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgSetItemPositions_ItemPosition::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgSetItemPositions_ItemPosition_descriptor_; metadata.reflection = CMsgSetItemPositions_ItemPosition_reflection_; return metadata; } // ------------------------------------------------------------------- #ifndef _MSC_VER const int CMsgSetItemPositions::kItemPositionsFieldNumber; #endif // !_MSC_VER CMsgSetItemPositions::CMsgSetItemPositions() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgSetItemPositions) } void CMsgSetItemPositions::InitAsDefaultInstance() { } CMsgSetItemPositions::CMsgSetItemPositions(const CMsgSetItemPositions& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgSetItemPositions) } void CMsgSetItemPositions::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgSetItemPositions::~CMsgSetItemPositions() { // @@protoc_insertion_point(destructor:CMsgSetItemPositions) SharedDtor(); } void CMsgSetItemPositions::SharedDtor() { if (this != default_instance_) { } } void CMsgSetItemPositions::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgSetItemPositions::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgSetItemPositions_descriptor_; } const CMsgSetItemPositions& CMsgSetItemPositions::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgSetItemPositions* CMsgSetItemPositions::default_instance_ = NULL; CMsgSetItemPositions* CMsgSetItemPositions::New() const { return new CMsgSetItemPositions; } void CMsgSetItemPositions::Clear() { item_positions_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgSetItemPositions::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgSetItemPositions) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .CMsgSetItemPositions.ItemPosition item_positions = 1; case 1: { if (tag == 10) { parse_item_positions: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_item_positions())); } else { goto handle_unusual; } if (input->ExpectTag(10)) goto parse_item_positions; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgSetItemPositions) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgSetItemPositions) return false; #undef DO_ } void CMsgSetItemPositions::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgSetItemPositions) // repeated .CMsgSetItemPositions.ItemPosition item_positions = 1; for (int i = 0; i < this->item_positions_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1, this->item_positions(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgSetItemPositions) } ::google::protobuf::uint8* CMsgSetItemPositions::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgSetItemPositions) // repeated .CMsgSetItemPositions.ItemPosition item_positions = 1; for (int i = 0; i < this->item_positions_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 1, this->item_positions(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgSetItemPositions) return target; } int CMsgSetItemPositions::ByteSize() const { int total_size = 0; // repeated .CMsgSetItemPositions.ItemPosition item_positions = 1; total_size += 1 * this->item_positions_size(); for (int i = 0; i < this->item_positions_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->item_positions(i)); } 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; } void CMsgSetItemPositions::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgSetItemPositions* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgSetItemPositions*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgSetItemPositions::MergeFrom(const CMsgSetItemPositions& from) { GOOGLE_CHECK_NE(&from, this); item_positions_.MergeFrom(from.item_positions_); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgSetItemPositions::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgSetItemPositions::CopyFrom(const CMsgSetItemPositions& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgSetItemPositions::IsInitialized() const { return true; } void CMsgSetItemPositions::Swap(CMsgSetItemPositions* other) { if (other != this) { item_positions_.Swap(&other->item_positions_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgSetItemPositions::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgSetItemPositions_descriptor_; metadata.reflection = CMsgSetItemPositions_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCNameItemNotification::kPlayerSteamidFieldNumber; const int CMsgGCNameItemNotification::kItemDefIndexFieldNumber; const int CMsgGCNameItemNotification::kItemNameCustomFieldNumber; #endif // !_MSC_VER CMsgGCNameItemNotification::CMsgGCNameItemNotification() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCNameItemNotification) } void CMsgGCNameItemNotification::InitAsDefaultInstance() { } CMsgGCNameItemNotification::CMsgGCNameItemNotification(const CMsgGCNameItemNotification& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCNameItemNotification) } void CMsgGCNameItemNotification::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; player_steamid_ = GOOGLE_ULONGLONG(0); item_def_index_ = 0u; item_name_custom_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCNameItemNotification::~CMsgGCNameItemNotification() { // @@protoc_insertion_point(destructor:CMsgGCNameItemNotification) SharedDtor(); } void CMsgGCNameItemNotification::SharedDtor() { if (item_name_custom_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete item_name_custom_; } if (this != default_instance_) { } } void CMsgGCNameItemNotification::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCNameItemNotification::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCNameItemNotification_descriptor_; } const CMsgGCNameItemNotification& CMsgGCNameItemNotification::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCNameItemNotification* CMsgGCNameItemNotification::default_instance_ = NULL; CMsgGCNameItemNotification* CMsgGCNameItemNotification::New() const { return new CMsgGCNameItemNotification; } void CMsgGCNameItemNotification::Clear() { if (_has_bits_[0 / 32] & 7) { player_steamid_ = GOOGLE_ULONGLONG(0); item_def_index_ = 0u; if (has_item_name_custom()) { if (item_name_custom_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { item_name_custom_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCNameItemNotification::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCNameItemNotification) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional fixed64 player_steamid = 1; case 1: { if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &player_steamid_))); set_has_player_steamid(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_item_def_index; break; } // optional uint32 item_def_index = 2; case 2: { if (tag == 16) { parse_item_def_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &item_def_index_))); set_has_item_def_index(); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_item_name_custom; break; } // optional string item_name_custom = 3; case 3: { if (tag == 26) { parse_item_name_custom: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_item_name_custom())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->item_name_custom().data(), this->item_name_custom().length(), ::google::protobuf::internal::WireFormat::PARSE, "item_name_custom"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCNameItemNotification) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCNameItemNotification) return false; #undef DO_ } void CMsgGCNameItemNotification::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCNameItemNotification) // optional fixed64 player_steamid = 1; if (has_player_steamid()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(1, this->player_steamid(), output); } // optional uint32 item_def_index = 2; if (has_item_def_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->item_def_index(), output); } // optional string item_name_custom = 3; if (has_item_name_custom()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->item_name_custom().data(), this->item_name_custom().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "item_name_custom"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 3, this->item_name_custom(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCNameItemNotification) } ::google::protobuf::uint8* CMsgGCNameItemNotification::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCNameItemNotification) // optional fixed64 player_steamid = 1; if (has_player_steamid()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(1, this->player_steamid(), target); } // optional uint32 item_def_index = 2; if (has_item_def_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->item_def_index(), target); } // optional string item_name_custom = 3; if (has_item_name_custom()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->item_name_custom().data(), this->item_name_custom().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "item_name_custom"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->item_name_custom(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCNameItemNotification) return target; } int CMsgGCNameItemNotification::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional fixed64 player_steamid = 1; if (has_player_steamid()) { total_size += 1 + 8; } // optional uint32 item_def_index = 2; if (has_item_def_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->item_def_index()); } // optional string item_name_custom = 3; if (has_item_name_custom()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->item_name_custom()); } } 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; } void CMsgGCNameItemNotification::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCNameItemNotification* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCNameItemNotification*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCNameItemNotification::MergeFrom(const CMsgGCNameItemNotification& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_player_steamid()) { set_player_steamid(from.player_steamid()); } if (from.has_item_def_index()) { set_item_def_index(from.item_def_index()); } if (from.has_item_name_custom()) { set_item_name_custom(from.item_name_custom()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCNameItemNotification::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCNameItemNotification::CopyFrom(const CMsgGCNameItemNotification& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCNameItemNotification::IsInitialized() const { return true; } void CMsgGCNameItemNotification::Swap(CMsgGCNameItemNotification* other) { if (other != this) { std::swap(player_steamid_, other->player_steamid_); std::swap(item_def_index_, other->item_def_index_); std::swap(item_name_custom_, other->item_name_custom_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCNameItemNotification::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCNameItemNotification_descriptor_; metadata.reflection = CMsgGCNameItemNotification_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCClientDisplayNotification::kNotificationTitleLocalizationKeyFieldNumber; const int CMsgGCClientDisplayNotification::kNotificationBodyLocalizationKeyFieldNumber; const int CMsgGCClientDisplayNotification::kBodySubstringKeysFieldNumber; const int CMsgGCClientDisplayNotification::kBodySubstringValuesFieldNumber; #endif // !_MSC_VER CMsgGCClientDisplayNotification::CMsgGCClientDisplayNotification() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCClientDisplayNotification) } void CMsgGCClientDisplayNotification::InitAsDefaultInstance() { } CMsgGCClientDisplayNotification::CMsgGCClientDisplayNotification(const CMsgGCClientDisplayNotification& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCClientDisplayNotification) } void CMsgGCClientDisplayNotification::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; notification_title_localization_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); notification_body_localization_key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCClientDisplayNotification::~CMsgGCClientDisplayNotification() { // @@protoc_insertion_point(destructor:CMsgGCClientDisplayNotification) SharedDtor(); } void CMsgGCClientDisplayNotification::SharedDtor() { if (notification_title_localization_key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete notification_title_localization_key_; } if (notification_body_localization_key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete notification_body_localization_key_; } if (this != default_instance_) { } } void CMsgGCClientDisplayNotification::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCClientDisplayNotification::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCClientDisplayNotification_descriptor_; } const CMsgGCClientDisplayNotification& CMsgGCClientDisplayNotification::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCClientDisplayNotification* CMsgGCClientDisplayNotification::default_instance_ = NULL; CMsgGCClientDisplayNotification* CMsgGCClientDisplayNotification::New() const { return new CMsgGCClientDisplayNotification; } void CMsgGCClientDisplayNotification::Clear() { if (_has_bits_[0 / 32] & 3) { if (has_notification_title_localization_key()) { if (notification_title_localization_key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { notification_title_localization_key_->clear(); } } if (has_notification_body_localization_key()) { if (notification_body_localization_key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { notification_body_localization_key_->clear(); } } } body_substring_keys_.Clear(); body_substring_values_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCClientDisplayNotification::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCClientDisplayNotification) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string notification_title_localization_key = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_notification_title_localization_key())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->notification_title_localization_key().data(), this->notification_title_localization_key().length(), ::google::protobuf::internal::WireFormat::PARSE, "notification_title_localization_key"); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_notification_body_localization_key; break; } // optional string notification_body_localization_key = 2; case 2: { if (tag == 18) { parse_notification_body_localization_key: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_notification_body_localization_key())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->notification_body_localization_key().data(), this->notification_body_localization_key().length(), ::google::protobuf::internal::WireFormat::PARSE, "notification_body_localization_key"); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_body_substring_keys; break; } // repeated string body_substring_keys = 3; case 3: { if (tag == 26) { parse_body_substring_keys: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_body_substring_keys())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->body_substring_keys(this->body_substring_keys_size() - 1).data(), this->body_substring_keys(this->body_substring_keys_size() - 1).length(), ::google::protobuf::internal::WireFormat::PARSE, "body_substring_keys"); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_body_substring_keys; if (input->ExpectTag(34)) goto parse_body_substring_values; break; } // repeated string body_substring_values = 4; case 4: { if (tag == 34) { parse_body_substring_values: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_body_substring_values())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->body_substring_values(this->body_substring_values_size() - 1).data(), this->body_substring_values(this->body_substring_values_size() - 1).length(), ::google::protobuf::internal::WireFormat::PARSE, "body_substring_values"); } else { goto handle_unusual; } if (input->ExpectTag(34)) goto parse_body_substring_values; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCClientDisplayNotification) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCClientDisplayNotification) return false; #undef DO_ } void CMsgGCClientDisplayNotification::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCClientDisplayNotification) // optional string notification_title_localization_key = 1; if (has_notification_title_localization_key()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->notification_title_localization_key().data(), this->notification_title_localization_key().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "notification_title_localization_key"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->notification_title_localization_key(), output); } // optional string notification_body_localization_key = 2; if (has_notification_body_localization_key()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->notification_body_localization_key().data(), this->notification_body_localization_key().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "notification_body_localization_key"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->notification_body_localization_key(), output); } // repeated string body_substring_keys = 3; for (int i = 0; i < this->body_substring_keys_size(); i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->body_substring_keys(i).data(), this->body_substring_keys(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "body_substring_keys"); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->body_substring_keys(i), output); } // repeated string body_substring_values = 4; for (int i = 0; i < this->body_substring_values_size(); i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->body_substring_values(i).data(), this->body_substring_values(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "body_substring_values"); ::google::protobuf::internal::WireFormatLite::WriteString( 4, this->body_substring_values(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCClientDisplayNotification) } ::google::protobuf::uint8* CMsgGCClientDisplayNotification::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCClientDisplayNotification) // optional string notification_title_localization_key = 1; if (has_notification_title_localization_key()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->notification_title_localization_key().data(), this->notification_title_localization_key().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "notification_title_localization_key"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->notification_title_localization_key(), target); } // optional string notification_body_localization_key = 2; if (has_notification_body_localization_key()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->notification_body_localization_key().data(), this->notification_body_localization_key().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "notification_body_localization_key"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->notification_body_localization_key(), target); } // repeated string body_substring_keys = 3; for (int i = 0; i < this->body_substring_keys_size(); i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->body_substring_keys(i).data(), this->body_substring_keys(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "body_substring_keys"); target = ::google::protobuf::internal::WireFormatLite:: WriteStringToArray(3, this->body_substring_keys(i), target); } // repeated string body_substring_values = 4; for (int i = 0; i < this->body_substring_values_size(); i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->body_substring_values(i).data(), this->body_substring_values(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "body_substring_values"); target = ::google::protobuf::internal::WireFormatLite:: WriteStringToArray(4, this->body_substring_values(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCClientDisplayNotification) return target; } int CMsgGCClientDisplayNotification::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string notification_title_localization_key = 1; if (has_notification_title_localization_key()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->notification_title_localization_key()); } // optional string notification_body_localization_key = 2; if (has_notification_body_localization_key()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->notification_body_localization_key()); } } // repeated string body_substring_keys = 3; total_size += 1 * this->body_substring_keys_size(); for (int i = 0; i < this->body_substring_keys_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->body_substring_keys(i)); } // repeated string body_substring_values = 4; total_size += 1 * this->body_substring_values_size(); for (int i = 0; i < this->body_substring_values_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->body_substring_values(i)); } 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; } void CMsgGCClientDisplayNotification::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCClientDisplayNotification* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCClientDisplayNotification*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCClientDisplayNotification::MergeFrom(const CMsgGCClientDisplayNotification& from) { GOOGLE_CHECK_NE(&from, this); body_substring_keys_.MergeFrom(from.body_substring_keys_); body_substring_values_.MergeFrom(from.body_substring_values_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_notification_title_localization_key()) { set_notification_title_localization_key(from.notification_title_localization_key()); } if (from.has_notification_body_localization_key()) { set_notification_body_localization_key(from.notification_body_localization_key()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCClientDisplayNotification::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCClientDisplayNotification::CopyFrom(const CMsgGCClientDisplayNotification& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCClientDisplayNotification::IsInitialized() const { return true; } void CMsgGCClientDisplayNotification::Swap(CMsgGCClientDisplayNotification* other) { if (other != this) { std::swap(notification_title_localization_key_, other->notification_title_localization_key_); std::swap(notification_body_localization_key_, other->notification_body_localization_key_); body_substring_keys_.Swap(&other->body_substring_keys_); body_substring_values_.Swap(&other->body_substring_values_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCClientDisplayNotification::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCClientDisplayNotification_descriptor_; metadata.reflection = CMsgGCClientDisplayNotification_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCShowItemsPickedUp::kPlayerSteamidFieldNumber; #endif // !_MSC_VER CMsgGCShowItemsPickedUp::CMsgGCShowItemsPickedUp() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCShowItemsPickedUp) } void CMsgGCShowItemsPickedUp::InitAsDefaultInstance() { } CMsgGCShowItemsPickedUp::CMsgGCShowItemsPickedUp(const CMsgGCShowItemsPickedUp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCShowItemsPickedUp) } void CMsgGCShowItemsPickedUp::SharedCtor() { _cached_size_ = 0; player_steamid_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCShowItemsPickedUp::~CMsgGCShowItemsPickedUp() { // @@protoc_insertion_point(destructor:CMsgGCShowItemsPickedUp) SharedDtor(); } void CMsgGCShowItemsPickedUp::SharedDtor() { if (this != default_instance_) { } } void CMsgGCShowItemsPickedUp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCShowItemsPickedUp::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCShowItemsPickedUp_descriptor_; } const CMsgGCShowItemsPickedUp& CMsgGCShowItemsPickedUp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCShowItemsPickedUp* CMsgGCShowItemsPickedUp::default_instance_ = NULL; CMsgGCShowItemsPickedUp* CMsgGCShowItemsPickedUp::New() const { return new CMsgGCShowItemsPickedUp; } void CMsgGCShowItemsPickedUp::Clear() { player_steamid_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCShowItemsPickedUp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCShowItemsPickedUp) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional fixed64 player_steamid = 1; case 1: { if (tag == 9) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED64>( input, &player_steamid_))); set_has_player_steamid(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCShowItemsPickedUp) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCShowItemsPickedUp) return false; #undef DO_ } void CMsgGCShowItemsPickedUp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCShowItemsPickedUp) // optional fixed64 player_steamid = 1; if (has_player_steamid()) { ::google::protobuf::internal::WireFormatLite::WriteFixed64(1, this->player_steamid(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCShowItemsPickedUp) } ::google::protobuf::uint8* CMsgGCShowItemsPickedUp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCShowItemsPickedUp) // optional fixed64 player_steamid = 1; if (has_player_steamid()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed64ToArray(1, this->player_steamid(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCShowItemsPickedUp) return target; } int CMsgGCShowItemsPickedUp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional fixed64 player_steamid = 1; if (has_player_steamid()) { total_size += 1 + 8; } } 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; } void CMsgGCShowItemsPickedUp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCShowItemsPickedUp* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCShowItemsPickedUp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCShowItemsPickedUp::MergeFrom(const CMsgGCShowItemsPickedUp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_player_steamid()) { set_player_steamid(from.player_steamid()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCShowItemsPickedUp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCShowItemsPickedUp::CopyFrom(const CMsgGCShowItemsPickedUp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCShowItemsPickedUp::IsInitialized() const { return true; } void CMsgGCShowItemsPickedUp::Swap(CMsgGCShowItemsPickedUp* other) { if (other != this) { std::swap(player_steamid_, other->player_steamid_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCShowItemsPickedUp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCShowItemsPickedUp_descriptor_; metadata.reflection = CMsgGCShowItemsPickedUp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCIncrementKillCountResponse::kKillerAccountIdFieldNumber; const int CMsgGCIncrementKillCountResponse::kNumKillsFieldNumber; const int CMsgGCIncrementKillCountResponse::kItemDefFieldNumber; const int CMsgGCIncrementKillCountResponse::kLevelTypeFieldNumber; #endif // !_MSC_VER CMsgGCIncrementKillCountResponse::CMsgGCIncrementKillCountResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCIncrementKillCountResponse) } void CMsgGCIncrementKillCountResponse::InitAsDefaultInstance() { } CMsgGCIncrementKillCountResponse::CMsgGCIncrementKillCountResponse(const CMsgGCIncrementKillCountResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCIncrementKillCountResponse) } void CMsgGCIncrementKillCountResponse::SharedCtor() { _cached_size_ = 0; killer_account_id_ = 0u; num_kills_ = 0u; item_def_ = 0u; level_type_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCIncrementKillCountResponse::~CMsgGCIncrementKillCountResponse() { // @@protoc_insertion_point(destructor:CMsgGCIncrementKillCountResponse) SharedDtor(); } void CMsgGCIncrementKillCountResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgGCIncrementKillCountResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCIncrementKillCountResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCIncrementKillCountResponse_descriptor_; } const CMsgGCIncrementKillCountResponse& CMsgGCIncrementKillCountResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCIncrementKillCountResponse* CMsgGCIncrementKillCountResponse::default_instance_ = NULL; CMsgGCIncrementKillCountResponse* CMsgGCIncrementKillCountResponse::New() const { return new CMsgGCIncrementKillCountResponse; } void CMsgGCIncrementKillCountResponse::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgGCIncrementKillCountResponse*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(killer_account_id_, level_type_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCIncrementKillCountResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCIncrementKillCountResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 killer_account_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &killer_account_id_))); set_has_killer_account_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_num_kills; break; } // optional uint32 num_kills = 2; case 2: { if (tag == 16) { parse_num_kills: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &num_kills_))); set_has_num_kills(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_item_def; break; } // optional uint32 item_def = 3; case 3: { if (tag == 24) { parse_item_def: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &item_def_))); set_has_item_def(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_level_type; break; } // optional uint32 level_type = 4; case 4: { if (tag == 32) { parse_level_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &level_type_))); set_has_level_type(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCIncrementKillCountResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCIncrementKillCountResponse) return false; #undef DO_ } void CMsgGCIncrementKillCountResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCIncrementKillCountResponse) // optional uint32 killer_account_id = 1; if (has_killer_account_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->killer_account_id(), output); } // optional uint32 num_kills = 2; if (has_num_kills()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->num_kills(), output); } // optional uint32 item_def = 3; if (has_item_def()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->item_def(), output); } // optional uint32 level_type = 4; if (has_level_type()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->level_type(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCIncrementKillCountResponse) } ::google::protobuf::uint8* CMsgGCIncrementKillCountResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCIncrementKillCountResponse) // optional uint32 killer_account_id = 1; if (has_killer_account_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->killer_account_id(), target); } // optional uint32 num_kills = 2; if (has_num_kills()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->num_kills(), target); } // optional uint32 item_def = 3; if (has_item_def()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->item_def(), target); } // optional uint32 level_type = 4; if (has_level_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->level_type(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCIncrementKillCountResponse) return target; } int CMsgGCIncrementKillCountResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 killer_account_id = 1; if (has_killer_account_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->killer_account_id()); } // optional uint32 num_kills = 2; if (has_num_kills()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->num_kills()); } // optional uint32 item_def = 3; if (has_item_def()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->item_def()); } // optional uint32 level_type = 4; if (has_level_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->level_type()); } } 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; } void CMsgGCIncrementKillCountResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCIncrementKillCountResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCIncrementKillCountResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCIncrementKillCountResponse::MergeFrom(const CMsgGCIncrementKillCountResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_killer_account_id()) { set_killer_account_id(from.killer_account_id()); } if (from.has_num_kills()) { set_num_kills(from.num_kills()); } if (from.has_item_def()) { set_item_def(from.item_def()); } if (from.has_level_type()) { set_level_type(from.level_type()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCIncrementKillCountResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCIncrementKillCountResponse::CopyFrom(const CMsgGCIncrementKillCountResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCIncrementKillCountResponse::IsInitialized() const { return true; } void CMsgGCIncrementKillCountResponse::Swap(CMsgGCIncrementKillCountResponse* other) { if (other != this) { std::swap(killer_account_id_, other->killer_account_id_); std::swap(num_kills_, other->num_kills_); std::swap(item_def_, other->item_def_); std::swap(level_type_, other->level_type_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCIncrementKillCountResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCIncrementKillCountResponse_descriptor_; metadata.reflection = CMsgGCIncrementKillCountResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconItemDropRateBonus::kAccountIdFieldNumber; const int CSOEconItemDropRateBonus::kExpirationDateFieldNumber; const int CSOEconItemDropRateBonus::kBonusFieldNumber; const int CSOEconItemDropRateBonus::kBonusCountFieldNumber; const int CSOEconItemDropRateBonus::kItemIdFieldNumber; const int CSOEconItemDropRateBonus::kDefIndexFieldNumber; const int CSOEconItemDropRateBonus::kSecondsLeftFieldNumber; const int CSOEconItemDropRateBonus::kBoosterTypeFieldNumber; #endif // !_MSC_VER CSOEconItemDropRateBonus::CSOEconItemDropRateBonus() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconItemDropRateBonus) } void CSOEconItemDropRateBonus::InitAsDefaultInstance() { } CSOEconItemDropRateBonus::CSOEconItemDropRateBonus(const CSOEconItemDropRateBonus& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconItemDropRateBonus) } void CSOEconItemDropRateBonus::SharedCtor() { _cached_size_ = 0; account_id_ = 0u; expiration_date_ = 0u; bonus_ = 0; bonus_count_ = 0u; item_id_ = GOOGLE_ULONGLONG(0); def_index_ = 0u; seconds_left_ = 0u; booster_type_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconItemDropRateBonus::~CSOEconItemDropRateBonus() { // @@protoc_insertion_point(destructor:CSOEconItemDropRateBonus) SharedDtor(); } void CSOEconItemDropRateBonus::SharedDtor() { if (this != default_instance_) { } } void CSOEconItemDropRateBonus::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconItemDropRateBonus::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconItemDropRateBonus_descriptor_; } const CSOEconItemDropRateBonus& CSOEconItemDropRateBonus::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconItemDropRateBonus* CSOEconItemDropRateBonus::default_instance_ = NULL; CSOEconItemDropRateBonus* CSOEconItemDropRateBonus::New() const { return new CSOEconItemDropRateBonus; } void CSOEconItemDropRateBonus::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconItemDropRateBonus*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 255) { ZR_(account_id_, booster_type_); } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconItemDropRateBonus::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconItemDropRateBonus) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 account_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &account_id_))); set_has_account_id(); } else { goto handle_unusual; } if (input->ExpectTag(21)) goto parse_expiration_date; break; } // optional fixed32 expiration_date = 2; case 2: { if (tag == 21) { parse_expiration_date: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_FIXED32>( input, &expiration_date_))); set_has_expiration_date(); } else { goto handle_unusual; } if (input->ExpectTag(29)) goto parse_bonus; break; } // optional float bonus = 3; case 3: { if (tag == 29) { parse_bonus: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, &bonus_))); set_has_bonus(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_bonus_count; break; } // optional uint32 bonus_count = 4; case 4: { if (tag == 32) { parse_bonus_count: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &bonus_count_))); set_has_bonus_count(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_item_id; break; } // optional uint64 item_id = 5; case 5: { if (tag == 40) { parse_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_id_))); set_has_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(48)) goto parse_def_index; break; } // optional uint32 def_index = 6; case 6: { if (tag == 48) { parse_def_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &def_index_))); set_has_def_index(); } else { goto handle_unusual; } if (input->ExpectTag(56)) goto parse_seconds_left; break; } // optional uint32 seconds_left = 7; case 7: { if (tag == 56) { parse_seconds_left: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &seconds_left_))); set_has_seconds_left(); } else { goto handle_unusual; } if (input->ExpectTag(64)) goto parse_booster_type; break; } // optional uint32 booster_type = 8; case 8: { if (tag == 64) { parse_booster_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &booster_type_))); set_has_booster_type(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconItemDropRateBonus) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconItemDropRateBonus) return false; #undef DO_ } void CSOEconItemDropRateBonus::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconItemDropRateBonus) // optional uint32 account_id = 1; if (has_account_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->account_id(), output); } // optional fixed32 expiration_date = 2; if (has_expiration_date()) { ::google::protobuf::internal::WireFormatLite::WriteFixed32(2, this->expiration_date(), output); } // optional float bonus = 3; if (has_bonus()) { ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->bonus(), output); } // optional uint32 bonus_count = 4; if (has_bonus_count()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->bonus_count(), output); } // optional uint64 item_id = 5; if (has_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->item_id(), output); } // optional uint32 def_index = 6; if (has_def_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->def_index(), output); } // optional uint32 seconds_left = 7; if (has_seconds_left()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->seconds_left(), output); } // optional uint32 booster_type = 8; if (has_booster_type()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->booster_type(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconItemDropRateBonus) } ::google::protobuf::uint8* CSOEconItemDropRateBonus::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconItemDropRateBonus) // optional uint32 account_id = 1; if (has_account_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->account_id(), target); } // optional fixed32 expiration_date = 2; if (has_expiration_date()) { target = ::google::protobuf::internal::WireFormatLite::WriteFixed32ToArray(2, this->expiration_date(), target); } // optional float bonus = 3; if (has_bonus()) { target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->bonus(), target); } // optional uint32 bonus_count = 4; if (has_bonus_count()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->bonus_count(), target); } // optional uint64 item_id = 5; if (has_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->item_id(), target); } // optional uint32 def_index = 6; if (has_def_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->def_index(), target); } // optional uint32 seconds_left = 7; if (has_seconds_left()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->seconds_left(), target); } // optional uint32 booster_type = 8; if (has_booster_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->booster_type(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconItemDropRateBonus) return target; } int CSOEconItemDropRateBonus::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 account_id = 1; if (has_account_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->account_id()); } // optional fixed32 expiration_date = 2; if (has_expiration_date()) { total_size += 1 + 4; } // optional float bonus = 3; if (has_bonus()) { total_size += 1 + 4; } // optional uint32 bonus_count = 4; if (has_bonus_count()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->bonus_count()); } // optional uint64 item_id = 5; if (has_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_id()); } // optional uint32 def_index = 6; if (has_def_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->def_index()); } // optional uint32 seconds_left = 7; if (has_seconds_left()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->seconds_left()); } // optional uint32 booster_type = 8; if (has_booster_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->booster_type()); } } 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; } void CSOEconItemDropRateBonus::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconItemDropRateBonus* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconItemDropRateBonus*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconItemDropRateBonus::MergeFrom(const CSOEconItemDropRateBonus& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_account_id()) { set_account_id(from.account_id()); } if (from.has_expiration_date()) { set_expiration_date(from.expiration_date()); } if (from.has_bonus()) { set_bonus(from.bonus()); } if (from.has_bonus_count()) { set_bonus_count(from.bonus_count()); } if (from.has_item_id()) { set_item_id(from.item_id()); } if (from.has_def_index()) { set_def_index(from.def_index()); } if (from.has_seconds_left()) { set_seconds_left(from.seconds_left()); } if (from.has_booster_type()) { set_booster_type(from.booster_type()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconItemDropRateBonus::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconItemDropRateBonus::CopyFrom(const CSOEconItemDropRateBonus& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconItemDropRateBonus::IsInitialized() const { return true; } void CSOEconItemDropRateBonus::Swap(CSOEconItemDropRateBonus* other) { if (other != this) { std::swap(account_id_, other->account_id_); std::swap(expiration_date_, other->expiration_date_); std::swap(bonus_, other->bonus_); std::swap(bonus_count_, other->bonus_count_); std::swap(item_id_, other->item_id_); std::swap(def_index_, other->def_index_); std::swap(seconds_left_, other->seconds_left_); std::swap(booster_type_, other->booster_type_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconItemDropRateBonus::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconItemDropRateBonus_descriptor_; metadata.reflection = CSOEconItemDropRateBonus_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconItemLeagueViewPass::kAccountIdFieldNumber; const int CSOEconItemLeagueViewPass::kLeagueIdFieldNumber; const int CSOEconItemLeagueViewPass::kItemindexFieldNumber; const int CSOEconItemLeagueViewPass::kGrantReasonFieldNumber; #endif // !_MSC_VER CSOEconItemLeagueViewPass::CSOEconItemLeagueViewPass() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconItemLeagueViewPass) } void CSOEconItemLeagueViewPass::InitAsDefaultInstance() { } CSOEconItemLeagueViewPass::CSOEconItemLeagueViewPass(const CSOEconItemLeagueViewPass& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconItemLeagueViewPass) } void CSOEconItemLeagueViewPass::SharedCtor() { _cached_size_ = 0; account_id_ = 0u; league_id_ = 0u; itemindex_ = 0u; grant_reason_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconItemLeagueViewPass::~CSOEconItemLeagueViewPass() { // @@protoc_insertion_point(destructor:CSOEconItemLeagueViewPass) SharedDtor(); } void CSOEconItemLeagueViewPass::SharedDtor() { if (this != default_instance_) { } } void CSOEconItemLeagueViewPass::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconItemLeagueViewPass::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconItemLeagueViewPass_descriptor_; } const CSOEconItemLeagueViewPass& CSOEconItemLeagueViewPass::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconItemLeagueViewPass* CSOEconItemLeagueViewPass::default_instance_ = NULL; CSOEconItemLeagueViewPass* CSOEconItemLeagueViewPass::New() const { return new CSOEconItemLeagueViewPass; } void CSOEconItemLeagueViewPass::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconItemLeagueViewPass*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(account_id_, grant_reason_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconItemLeagueViewPass::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconItemLeagueViewPass) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 account_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &account_id_))); set_has_account_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_league_id; break; } // optional uint32 league_id = 2; case 2: { if (tag == 16) { parse_league_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &league_id_))); set_has_league_id(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_itemindex; break; } // optional uint32 itemindex = 4; case 4: { if (tag == 32) { parse_itemindex: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &itemindex_))); set_has_itemindex(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_grant_reason; break; } // optional uint32 grant_reason = 5; case 5: { if (tag == 40) { parse_grant_reason: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &grant_reason_))); set_has_grant_reason(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconItemLeagueViewPass) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconItemLeagueViewPass) return false; #undef DO_ } void CSOEconItemLeagueViewPass::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconItemLeagueViewPass) // optional uint32 account_id = 1; if (has_account_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->account_id(), output); } // optional uint32 league_id = 2; if (has_league_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->league_id(), output); } // optional uint32 itemindex = 4; if (has_itemindex()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->itemindex(), output); } // optional uint32 grant_reason = 5; if (has_grant_reason()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->grant_reason(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconItemLeagueViewPass) } ::google::protobuf::uint8* CSOEconItemLeagueViewPass::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconItemLeagueViewPass) // optional uint32 account_id = 1; if (has_account_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->account_id(), target); } // optional uint32 league_id = 2; if (has_league_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->league_id(), target); } // optional uint32 itemindex = 4; if (has_itemindex()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->itemindex(), target); } // optional uint32 grant_reason = 5; if (has_grant_reason()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->grant_reason(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconItemLeagueViewPass) return target; } int CSOEconItemLeagueViewPass::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 account_id = 1; if (has_account_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->account_id()); } // optional uint32 league_id = 2; if (has_league_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->league_id()); } // optional uint32 itemindex = 4; if (has_itemindex()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->itemindex()); } // optional uint32 grant_reason = 5; if (has_grant_reason()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->grant_reason()); } } 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; } void CSOEconItemLeagueViewPass::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconItemLeagueViewPass* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconItemLeagueViewPass*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconItemLeagueViewPass::MergeFrom(const CSOEconItemLeagueViewPass& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_account_id()) { set_account_id(from.account_id()); } if (from.has_league_id()) { set_league_id(from.league_id()); } if (from.has_itemindex()) { set_itemindex(from.itemindex()); } if (from.has_grant_reason()) { set_grant_reason(from.grant_reason()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconItemLeagueViewPass::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconItemLeagueViewPass::CopyFrom(const CSOEconItemLeagueViewPass& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconItemLeagueViewPass::IsInitialized() const { return true; } void CSOEconItemLeagueViewPass::Swap(CSOEconItemLeagueViewPass* other) { if (other != this) { std::swap(account_id_, other->account_id_); std::swap(league_id_, other->league_id_); std::swap(itemindex_, other->itemindex_); std::swap(grant_reason_, other->grant_reason_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconItemLeagueViewPass::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconItemLeagueViewPass_descriptor_; metadata.reflection = CSOEconItemLeagueViewPass_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconItemEventTicket::kAccountIdFieldNumber; const int CSOEconItemEventTicket::kEventIdFieldNumber; const int CSOEconItemEventTicket::kItemIdFieldNumber; #endif // !_MSC_VER CSOEconItemEventTicket::CSOEconItemEventTicket() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconItemEventTicket) } void CSOEconItemEventTicket::InitAsDefaultInstance() { } CSOEconItemEventTicket::CSOEconItemEventTicket(const CSOEconItemEventTicket& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconItemEventTicket) } void CSOEconItemEventTicket::SharedCtor() { _cached_size_ = 0; account_id_ = 0u; event_id_ = 0u; item_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconItemEventTicket::~CSOEconItemEventTicket() { // @@protoc_insertion_point(destructor:CSOEconItemEventTicket) SharedDtor(); } void CSOEconItemEventTicket::SharedDtor() { if (this != default_instance_) { } } void CSOEconItemEventTicket::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconItemEventTicket::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconItemEventTicket_descriptor_; } const CSOEconItemEventTicket& CSOEconItemEventTicket::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconItemEventTicket* CSOEconItemEventTicket::default_instance_ = NULL; CSOEconItemEventTicket* CSOEconItemEventTicket::New() const { return new CSOEconItemEventTicket; } void CSOEconItemEventTicket::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconItemEventTicket*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(account_id_, item_id_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconItemEventTicket::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconItemEventTicket) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 account_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &account_id_))); set_has_account_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_event_id; break; } // optional uint32 event_id = 2; case 2: { if (tag == 16) { parse_event_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &event_id_))); set_has_event_id(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_item_id; break; } // optional uint64 item_id = 3; case 3: { if (tag == 24) { parse_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_id_))); set_has_item_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconItemEventTicket) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconItemEventTicket) return false; #undef DO_ } void CSOEconItemEventTicket::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconItemEventTicket) // optional uint32 account_id = 1; if (has_account_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->account_id(), output); } // optional uint32 event_id = 2; if (has_event_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->event_id(), output); } // optional uint64 item_id = 3; if (has_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->item_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconItemEventTicket) } ::google::protobuf::uint8* CSOEconItemEventTicket::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconItemEventTicket) // optional uint32 account_id = 1; if (has_account_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->account_id(), target); } // optional uint32 event_id = 2; if (has_event_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->event_id(), target); } // optional uint64 item_id = 3; if (has_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->item_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconItemEventTicket) return target; } int CSOEconItemEventTicket::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 account_id = 1; if (has_account_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->account_id()); } // optional uint32 event_id = 2; if (has_event_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->event_id()); } // optional uint64 item_id = 3; if (has_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_id()); } } 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; } void CSOEconItemEventTicket::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconItemEventTicket* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconItemEventTicket*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconItemEventTicket::MergeFrom(const CSOEconItemEventTicket& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_account_id()) { set_account_id(from.account_id()); } if (from.has_event_id()) { set_event_id(from.event_id()); } if (from.has_item_id()) { set_item_id(from.item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconItemEventTicket::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconItemEventTicket::CopyFrom(const CSOEconItemEventTicket& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconItemEventTicket::IsInitialized() const { return true; } void CSOEconItemEventTicket::Swap(CSOEconItemEventTicket* other) { if (other != this) { std::swap(account_id_, other->account_id_); std::swap(event_id_, other->event_id_); std::swap(item_id_, other->item_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconItemEventTicket::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconItemEventTicket_descriptor_; metadata.reflection = CSOEconItemEventTicket_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CSOEconItemTournamentPassport::kAccountIdFieldNumber; const int CSOEconItemTournamentPassport::kLeagueIdFieldNumber; const int CSOEconItemTournamentPassport::kItemIdFieldNumber; const int CSOEconItemTournamentPassport::kOriginalPurchaserIdFieldNumber; const int CSOEconItemTournamentPassport::kPassportsBoughtFieldNumber; const int CSOEconItemTournamentPassport::kVersionFieldNumber; const int CSOEconItemTournamentPassport::kDefIndexFieldNumber; const int CSOEconItemTournamentPassport::kRewardFlagsFieldNumber; #endif // !_MSC_VER CSOEconItemTournamentPassport::CSOEconItemTournamentPassport() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CSOEconItemTournamentPassport) } void CSOEconItemTournamentPassport::InitAsDefaultInstance() { } CSOEconItemTournamentPassport::CSOEconItemTournamentPassport(const CSOEconItemTournamentPassport& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CSOEconItemTournamentPassport) } void CSOEconItemTournamentPassport::SharedCtor() { _cached_size_ = 0; account_id_ = 0u; league_id_ = 0u; item_id_ = GOOGLE_ULONGLONG(0); original_purchaser_id_ = 0u; passports_bought_ = 0u; version_ = 0u; def_index_ = 0u; reward_flags_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CSOEconItemTournamentPassport::~CSOEconItemTournamentPassport() { // @@protoc_insertion_point(destructor:CSOEconItemTournamentPassport) SharedDtor(); } void CSOEconItemTournamentPassport::SharedDtor() { if (this != default_instance_) { } } void CSOEconItemTournamentPassport::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CSOEconItemTournamentPassport::descriptor() { protobuf_AssignDescriptorsOnce(); return CSOEconItemTournamentPassport_descriptor_; } const CSOEconItemTournamentPassport& CSOEconItemTournamentPassport::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CSOEconItemTournamentPassport* CSOEconItemTournamentPassport::default_instance_ = NULL; CSOEconItemTournamentPassport* CSOEconItemTournamentPassport::New() const { return new CSOEconItemTournamentPassport; } void CSOEconItemTournamentPassport::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CSOEconItemTournamentPassport*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 255) { ZR_(account_id_, reward_flags_); } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CSOEconItemTournamentPassport::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CSOEconItemTournamentPassport) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 account_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &account_id_))); set_has_account_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_league_id; break; } // optional uint32 league_id = 2; case 2: { if (tag == 16) { parse_league_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &league_id_))); set_has_league_id(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_item_id; break; } // optional uint64 item_id = 3; case 3: { if (tag == 24) { parse_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_id_))); set_has_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_original_purchaser_id; break; } // optional uint32 original_purchaser_id = 4; case 4: { if (tag == 32) { parse_original_purchaser_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &original_purchaser_id_))); set_has_original_purchaser_id(); } else { goto handle_unusual; } if (input->ExpectTag(40)) goto parse_passports_bought; break; } // optional uint32 passports_bought = 5; case 5: { if (tag == 40) { parse_passports_bought: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &passports_bought_))); set_has_passports_bought(); } else { goto handle_unusual; } if (input->ExpectTag(48)) goto parse_version; break; } // optional uint32 version = 6; case 6: { if (tag == 48) { parse_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &version_))); set_has_version(); } else { goto handle_unusual; } if (input->ExpectTag(56)) goto parse_def_index; break; } // optional uint32 def_index = 7; case 7: { if (tag == 56) { parse_def_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &def_index_))); set_has_def_index(); } else { goto handle_unusual; } if (input->ExpectTag(64)) goto parse_reward_flags; break; } // optional uint32 reward_flags = 8; case 8: { if (tag == 64) { parse_reward_flags: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &reward_flags_))); set_has_reward_flags(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CSOEconItemTournamentPassport) return true; failure: // @@protoc_insertion_point(parse_failure:CSOEconItemTournamentPassport) return false; #undef DO_ } void CSOEconItemTournamentPassport::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CSOEconItemTournamentPassport) // optional uint32 account_id = 1; if (has_account_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->account_id(), output); } // optional uint32 league_id = 2; if (has_league_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->league_id(), output); } // optional uint64 item_id = 3; if (has_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->item_id(), output); } // optional uint32 original_purchaser_id = 4; if (has_original_purchaser_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->original_purchaser_id(), output); } // optional uint32 passports_bought = 5; if (has_passports_bought()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->passports_bought(), output); } // optional uint32 version = 6; if (has_version()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->version(), output); } // optional uint32 def_index = 7; if (has_def_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->def_index(), output); } // optional uint32 reward_flags = 8; if (has_reward_flags()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->reward_flags(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CSOEconItemTournamentPassport) } ::google::protobuf::uint8* CSOEconItemTournamentPassport::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CSOEconItemTournamentPassport) // optional uint32 account_id = 1; if (has_account_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->account_id(), target); } // optional uint32 league_id = 2; if (has_league_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->league_id(), target); } // optional uint64 item_id = 3; if (has_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->item_id(), target); } // optional uint32 original_purchaser_id = 4; if (has_original_purchaser_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->original_purchaser_id(), target); } // optional uint32 passports_bought = 5; if (has_passports_bought()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->passports_bought(), target); } // optional uint32 version = 6; if (has_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->version(), target); } // optional uint32 def_index = 7; if (has_def_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->def_index(), target); } // optional uint32 reward_flags = 8; if (has_reward_flags()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->reward_flags(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CSOEconItemTournamentPassport) return target; } int CSOEconItemTournamentPassport::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 account_id = 1; if (has_account_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->account_id()); } // optional uint32 league_id = 2; if (has_league_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->league_id()); } // optional uint64 item_id = 3; if (has_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_id()); } // optional uint32 original_purchaser_id = 4; if (has_original_purchaser_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->original_purchaser_id()); } // optional uint32 passports_bought = 5; if (has_passports_bought()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->passports_bought()); } // optional uint32 version = 6; if (has_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->version()); } // optional uint32 def_index = 7; if (has_def_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->def_index()); } // optional uint32 reward_flags = 8; if (has_reward_flags()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->reward_flags()); } } 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; } void CSOEconItemTournamentPassport::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CSOEconItemTournamentPassport* source = ::google::protobuf::internal::dynamic_cast_if_available<const CSOEconItemTournamentPassport*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CSOEconItemTournamentPassport::MergeFrom(const CSOEconItemTournamentPassport& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_account_id()) { set_account_id(from.account_id()); } if (from.has_league_id()) { set_league_id(from.league_id()); } if (from.has_item_id()) { set_item_id(from.item_id()); } if (from.has_original_purchaser_id()) { set_original_purchaser_id(from.original_purchaser_id()); } if (from.has_passports_bought()) { set_passports_bought(from.passports_bought()); } if (from.has_version()) { set_version(from.version()); } if (from.has_def_index()) { set_def_index(from.def_index()); } if (from.has_reward_flags()) { set_reward_flags(from.reward_flags()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CSOEconItemTournamentPassport::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CSOEconItemTournamentPassport::CopyFrom(const CSOEconItemTournamentPassport& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CSOEconItemTournamentPassport::IsInitialized() const { return true; } void CSOEconItemTournamentPassport::Swap(CSOEconItemTournamentPassport* other) { if (other != this) { std::swap(account_id_, other->account_id_); std::swap(league_id_, other->league_id_); std::swap(item_id_, other->item_id_); std::swap(original_purchaser_id_, other->original_purchaser_id_); std::swap(passports_bought_, other->passports_bought_); std::swap(version_, other->version_); std::swap(def_index_, other->def_index_); std::swap(reward_flags_, other->reward_flags_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CSOEconItemTournamentPassport::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CSOEconItemTournamentPassport_descriptor_; metadata.reflection = CSOEconItemTournamentPassport_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCStorePurchaseCancel::kTxnIdFieldNumber; #endif // !_MSC_VER CMsgGCStorePurchaseCancel::CMsgGCStorePurchaseCancel() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCStorePurchaseCancel) } void CMsgGCStorePurchaseCancel::InitAsDefaultInstance() { } CMsgGCStorePurchaseCancel::CMsgGCStorePurchaseCancel(const CMsgGCStorePurchaseCancel& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCStorePurchaseCancel) } void CMsgGCStorePurchaseCancel::SharedCtor() { _cached_size_ = 0; txn_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCStorePurchaseCancel::~CMsgGCStorePurchaseCancel() { // @@protoc_insertion_point(destructor:CMsgGCStorePurchaseCancel) SharedDtor(); } void CMsgGCStorePurchaseCancel::SharedDtor() { if (this != default_instance_) { } } void CMsgGCStorePurchaseCancel::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCStorePurchaseCancel::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCStorePurchaseCancel_descriptor_; } const CMsgGCStorePurchaseCancel& CMsgGCStorePurchaseCancel::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCStorePurchaseCancel* CMsgGCStorePurchaseCancel::default_instance_ = NULL; CMsgGCStorePurchaseCancel* CMsgGCStorePurchaseCancel::New() const { return new CMsgGCStorePurchaseCancel; } void CMsgGCStorePurchaseCancel::Clear() { txn_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCStorePurchaseCancel::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCStorePurchaseCancel) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 txn_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &txn_id_))); set_has_txn_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCStorePurchaseCancel) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCStorePurchaseCancel) return false; #undef DO_ } void CMsgGCStorePurchaseCancel::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCStorePurchaseCancel) // optional uint64 txn_id = 1; if (has_txn_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->txn_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCStorePurchaseCancel) } ::google::protobuf::uint8* CMsgGCStorePurchaseCancel::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCStorePurchaseCancel) // optional uint64 txn_id = 1; if (has_txn_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->txn_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCStorePurchaseCancel) return target; } int CMsgGCStorePurchaseCancel::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 txn_id = 1; if (has_txn_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->txn_id()); } } 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; } void CMsgGCStorePurchaseCancel::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCStorePurchaseCancel* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCStorePurchaseCancel*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCStorePurchaseCancel::MergeFrom(const CMsgGCStorePurchaseCancel& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_txn_id()) { set_txn_id(from.txn_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCStorePurchaseCancel::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCStorePurchaseCancel::CopyFrom(const CMsgGCStorePurchaseCancel& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCStorePurchaseCancel::IsInitialized() const { return true; } void CMsgGCStorePurchaseCancel::Swap(CMsgGCStorePurchaseCancel* other) { if (other != this) { std::swap(txn_id_, other->txn_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCStorePurchaseCancel::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCStorePurchaseCancel_descriptor_; metadata.reflection = CMsgGCStorePurchaseCancel_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCStorePurchaseCancelResponse::kResultFieldNumber; #endif // !_MSC_VER CMsgGCStorePurchaseCancelResponse::CMsgGCStorePurchaseCancelResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCStorePurchaseCancelResponse) } void CMsgGCStorePurchaseCancelResponse::InitAsDefaultInstance() { } CMsgGCStorePurchaseCancelResponse::CMsgGCStorePurchaseCancelResponse(const CMsgGCStorePurchaseCancelResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCStorePurchaseCancelResponse) } void CMsgGCStorePurchaseCancelResponse::SharedCtor() { _cached_size_ = 0; result_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCStorePurchaseCancelResponse::~CMsgGCStorePurchaseCancelResponse() { // @@protoc_insertion_point(destructor:CMsgGCStorePurchaseCancelResponse) SharedDtor(); } void CMsgGCStorePurchaseCancelResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgGCStorePurchaseCancelResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCStorePurchaseCancelResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCStorePurchaseCancelResponse_descriptor_; } const CMsgGCStorePurchaseCancelResponse& CMsgGCStorePurchaseCancelResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCStorePurchaseCancelResponse* CMsgGCStorePurchaseCancelResponse::default_instance_ = NULL; CMsgGCStorePurchaseCancelResponse* CMsgGCStorePurchaseCancelResponse::New() const { return new CMsgGCStorePurchaseCancelResponse; } void CMsgGCStorePurchaseCancelResponse::Clear() { result_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCStorePurchaseCancelResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCStorePurchaseCancelResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 result = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &result_))); set_has_result(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCStorePurchaseCancelResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCStorePurchaseCancelResponse) return false; #undef DO_ } void CMsgGCStorePurchaseCancelResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCStorePurchaseCancelResponse) // optional uint32 result = 1; if (has_result()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->result(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCStorePurchaseCancelResponse) } ::google::protobuf::uint8* CMsgGCStorePurchaseCancelResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCStorePurchaseCancelResponse) // optional uint32 result = 1; if (has_result()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->result(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCStorePurchaseCancelResponse) return target; } int CMsgGCStorePurchaseCancelResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 result = 1; if (has_result()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( 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; } void CMsgGCStorePurchaseCancelResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCStorePurchaseCancelResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCStorePurchaseCancelResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCStorePurchaseCancelResponse::MergeFrom(const CMsgGCStorePurchaseCancelResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_result()) { set_result(from.result()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCStorePurchaseCancelResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCStorePurchaseCancelResponse::CopyFrom(const CMsgGCStorePurchaseCancelResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCStorePurchaseCancelResponse::IsInitialized() const { return true; } void CMsgGCStorePurchaseCancelResponse::Swap(CMsgGCStorePurchaseCancelResponse* other) { if (other != this) { std::swap(result_, other->result_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCStorePurchaseCancelResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCStorePurchaseCancelResponse_descriptor_; metadata.reflection = CMsgGCStorePurchaseCancelResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCStorePurchaseFinalize::kTxnIdFieldNumber; #endif // !_MSC_VER CMsgGCStorePurchaseFinalize::CMsgGCStorePurchaseFinalize() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCStorePurchaseFinalize) } void CMsgGCStorePurchaseFinalize::InitAsDefaultInstance() { } CMsgGCStorePurchaseFinalize::CMsgGCStorePurchaseFinalize(const CMsgGCStorePurchaseFinalize& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCStorePurchaseFinalize) } void CMsgGCStorePurchaseFinalize::SharedCtor() { _cached_size_ = 0; txn_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCStorePurchaseFinalize::~CMsgGCStorePurchaseFinalize() { // @@protoc_insertion_point(destructor:CMsgGCStorePurchaseFinalize) SharedDtor(); } void CMsgGCStorePurchaseFinalize::SharedDtor() { if (this != default_instance_) { } } void CMsgGCStorePurchaseFinalize::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCStorePurchaseFinalize::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCStorePurchaseFinalize_descriptor_; } const CMsgGCStorePurchaseFinalize& CMsgGCStorePurchaseFinalize::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCStorePurchaseFinalize* CMsgGCStorePurchaseFinalize::default_instance_ = NULL; CMsgGCStorePurchaseFinalize* CMsgGCStorePurchaseFinalize::New() const { return new CMsgGCStorePurchaseFinalize; } void CMsgGCStorePurchaseFinalize::Clear() { txn_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCStorePurchaseFinalize::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCStorePurchaseFinalize) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 txn_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &txn_id_))); set_has_txn_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCStorePurchaseFinalize) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCStorePurchaseFinalize) return false; #undef DO_ } void CMsgGCStorePurchaseFinalize::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCStorePurchaseFinalize) // optional uint64 txn_id = 1; if (has_txn_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->txn_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCStorePurchaseFinalize) } ::google::protobuf::uint8* CMsgGCStorePurchaseFinalize::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCStorePurchaseFinalize) // optional uint64 txn_id = 1; if (has_txn_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->txn_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCStorePurchaseFinalize) return target; } int CMsgGCStorePurchaseFinalize::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 txn_id = 1; if (has_txn_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->txn_id()); } } 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; } void CMsgGCStorePurchaseFinalize::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCStorePurchaseFinalize* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCStorePurchaseFinalize*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCStorePurchaseFinalize::MergeFrom(const CMsgGCStorePurchaseFinalize& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_txn_id()) { set_txn_id(from.txn_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCStorePurchaseFinalize::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCStorePurchaseFinalize::CopyFrom(const CMsgGCStorePurchaseFinalize& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCStorePurchaseFinalize::IsInitialized() const { return true; } void CMsgGCStorePurchaseFinalize::Swap(CMsgGCStorePurchaseFinalize* other) { if (other != this) { std::swap(txn_id_, other->txn_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCStorePurchaseFinalize::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCStorePurchaseFinalize_descriptor_; metadata.reflection = CMsgGCStorePurchaseFinalize_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCStorePurchaseFinalizeResponse::kResultFieldNumber; const int CMsgGCStorePurchaseFinalizeResponse::kItemIdsFieldNumber; #endif // !_MSC_VER CMsgGCStorePurchaseFinalizeResponse::CMsgGCStorePurchaseFinalizeResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCStorePurchaseFinalizeResponse) } void CMsgGCStorePurchaseFinalizeResponse::InitAsDefaultInstance() { } CMsgGCStorePurchaseFinalizeResponse::CMsgGCStorePurchaseFinalizeResponse(const CMsgGCStorePurchaseFinalizeResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCStorePurchaseFinalizeResponse) } void CMsgGCStorePurchaseFinalizeResponse::SharedCtor() { _cached_size_ = 0; result_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCStorePurchaseFinalizeResponse::~CMsgGCStorePurchaseFinalizeResponse() { // @@protoc_insertion_point(destructor:CMsgGCStorePurchaseFinalizeResponse) SharedDtor(); } void CMsgGCStorePurchaseFinalizeResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgGCStorePurchaseFinalizeResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCStorePurchaseFinalizeResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCStorePurchaseFinalizeResponse_descriptor_; } const CMsgGCStorePurchaseFinalizeResponse& CMsgGCStorePurchaseFinalizeResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCStorePurchaseFinalizeResponse* CMsgGCStorePurchaseFinalizeResponse::default_instance_ = NULL; CMsgGCStorePurchaseFinalizeResponse* CMsgGCStorePurchaseFinalizeResponse::New() const { return new CMsgGCStorePurchaseFinalizeResponse; } void CMsgGCStorePurchaseFinalizeResponse::Clear() { result_ = 0u; item_ids_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCStorePurchaseFinalizeResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCStorePurchaseFinalizeResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 result = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &result_))); set_has_result(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_item_ids; break; } // repeated uint64 item_ids = 2; case 2: { if (tag == 16) { parse_item_ids: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 1, 16, input, this->mutable_item_ids()))); } else if (tag == 18) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, this->mutable_item_ids()))); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_item_ids; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCStorePurchaseFinalizeResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCStorePurchaseFinalizeResponse) return false; #undef DO_ } void CMsgGCStorePurchaseFinalizeResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCStorePurchaseFinalizeResponse) // optional uint32 result = 1; if (has_result()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->result(), output); } // repeated uint64 item_ids = 2; for (int i = 0; i < this->item_ids_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt64( 2, this->item_ids(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCStorePurchaseFinalizeResponse) } ::google::protobuf::uint8* CMsgGCStorePurchaseFinalizeResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCStorePurchaseFinalizeResponse) // optional uint32 result = 1; if (has_result()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->result(), target); } // repeated uint64 item_ids = 2; for (int i = 0; i < this->item_ids_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt64ToArray(2, this->item_ids(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCStorePurchaseFinalizeResponse) return target; } int CMsgGCStorePurchaseFinalizeResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 result = 1; if (has_result()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->result()); } } // repeated uint64 item_ids = 2; { int data_size = 0; for (int i = 0; i < this->item_ids_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt64Size(this->item_ids(i)); } total_size += 1 * this->item_ids_size() + data_size; } 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; } void CMsgGCStorePurchaseFinalizeResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCStorePurchaseFinalizeResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCStorePurchaseFinalizeResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCStorePurchaseFinalizeResponse::MergeFrom(const CMsgGCStorePurchaseFinalizeResponse& from) { GOOGLE_CHECK_NE(&from, this); item_ids_.MergeFrom(from.item_ids_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_result()) { set_result(from.result()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCStorePurchaseFinalizeResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCStorePurchaseFinalizeResponse::CopyFrom(const CMsgGCStorePurchaseFinalizeResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCStorePurchaseFinalizeResponse::IsInitialized() const { return true; } void CMsgGCStorePurchaseFinalizeResponse::Swap(CMsgGCStorePurchaseFinalizeResponse* other) { if (other != this) { std::swap(result_, other->result_); item_ids_.Swap(&other->item_ids_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCStorePurchaseFinalizeResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCStorePurchaseFinalizeResponse_descriptor_; metadata.reflection = CMsgGCStorePurchaseFinalizeResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCBannedWordListRequest::kBanListGroupIdFieldNumber; const int CMsgGCBannedWordListRequest::kWordIdFieldNumber; #endif // !_MSC_VER CMsgGCBannedWordListRequest::CMsgGCBannedWordListRequest() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCBannedWordListRequest) } void CMsgGCBannedWordListRequest::InitAsDefaultInstance() { } CMsgGCBannedWordListRequest::CMsgGCBannedWordListRequest(const CMsgGCBannedWordListRequest& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCBannedWordListRequest) } void CMsgGCBannedWordListRequest::SharedCtor() { _cached_size_ = 0; ban_list_group_id_ = 0u; word_id_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCBannedWordListRequest::~CMsgGCBannedWordListRequest() { // @@protoc_insertion_point(destructor:CMsgGCBannedWordListRequest) SharedDtor(); } void CMsgGCBannedWordListRequest::SharedDtor() { if (this != default_instance_) { } } void CMsgGCBannedWordListRequest::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCBannedWordListRequest::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCBannedWordListRequest_descriptor_; } const CMsgGCBannedWordListRequest& CMsgGCBannedWordListRequest::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCBannedWordListRequest* CMsgGCBannedWordListRequest::default_instance_ = NULL; CMsgGCBannedWordListRequest* CMsgGCBannedWordListRequest::New() const { return new CMsgGCBannedWordListRequest; } void CMsgGCBannedWordListRequest::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgGCBannedWordListRequest*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(ban_list_group_id_, word_id_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCBannedWordListRequest::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCBannedWordListRequest) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 ban_list_group_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &ban_list_group_id_))); set_has_ban_list_group_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_word_id; break; } // optional uint32 word_id = 2; case 2: { if (tag == 16) { parse_word_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &word_id_))); set_has_word_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCBannedWordListRequest) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCBannedWordListRequest) return false; #undef DO_ } void CMsgGCBannedWordListRequest::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCBannedWordListRequest) // optional uint32 ban_list_group_id = 1; if (has_ban_list_group_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->ban_list_group_id(), output); } // optional uint32 word_id = 2; if (has_word_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->word_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCBannedWordListRequest) } ::google::protobuf::uint8* CMsgGCBannedWordListRequest::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCBannedWordListRequest) // optional uint32 ban_list_group_id = 1; if (has_ban_list_group_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->ban_list_group_id(), target); } // optional uint32 word_id = 2; if (has_word_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->word_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCBannedWordListRequest) return target; } int CMsgGCBannedWordListRequest::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 ban_list_group_id = 1; if (has_ban_list_group_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->ban_list_group_id()); } // optional uint32 word_id = 2; if (has_word_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->word_id()); } } 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; } void CMsgGCBannedWordListRequest::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCBannedWordListRequest* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCBannedWordListRequest*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCBannedWordListRequest::MergeFrom(const CMsgGCBannedWordListRequest& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ban_list_group_id()) { set_ban_list_group_id(from.ban_list_group_id()); } if (from.has_word_id()) { set_word_id(from.word_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCBannedWordListRequest::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCBannedWordListRequest::CopyFrom(const CMsgGCBannedWordListRequest& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCBannedWordListRequest::IsInitialized() const { return true; } void CMsgGCBannedWordListRequest::Swap(CMsgGCBannedWordListRequest* other) { if (other != this) { std::swap(ban_list_group_id_, other->ban_list_group_id_); std::swap(word_id_, other->word_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCBannedWordListRequest::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCBannedWordListRequest_descriptor_; metadata.reflection = CMsgGCBannedWordListRequest_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCBannedWord::kWordIdFieldNumber; const int CMsgGCBannedWord::kWordTypeFieldNumber; const int CMsgGCBannedWord::kWordFieldNumber; #endif // !_MSC_VER CMsgGCBannedWord::CMsgGCBannedWord() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCBannedWord) } void CMsgGCBannedWord::InitAsDefaultInstance() { } CMsgGCBannedWord::CMsgGCBannedWord(const CMsgGCBannedWord& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCBannedWord) } void CMsgGCBannedWord::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; word_id_ = 0u; word_type_ = 0; word_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCBannedWord::~CMsgGCBannedWord() { // @@protoc_insertion_point(destructor:CMsgGCBannedWord) SharedDtor(); } void CMsgGCBannedWord::SharedDtor() { if (word_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete word_; } if (this != default_instance_) { } } void CMsgGCBannedWord::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCBannedWord::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCBannedWord_descriptor_; } const CMsgGCBannedWord& CMsgGCBannedWord::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCBannedWord* CMsgGCBannedWord::default_instance_ = NULL; CMsgGCBannedWord* CMsgGCBannedWord::New() const { return new CMsgGCBannedWord; } void CMsgGCBannedWord::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgGCBannedWord*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 7) { ZR_(word_id_, word_type_); if (has_word()) { if (word_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { word_->clear(); } } } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCBannedWord::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCBannedWord) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 word_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &word_id_))); set_has_word_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_word_type; break; } // optional .GC_BannedWordType word_type = 2 [default = GC_BANNED_WORD_DISABLE_WORD]; case 2: { if (tag == 16) { parse_word_type: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::GC_BannedWordType_IsValid(value)) { set_word_type(static_cast< ::GC_BannedWordType >(value)); } else { mutable_unknown_fields()->AddVarint(2, value); } } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_word; break; } // optional string word = 3; case 3: { if (tag == 26) { parse_word: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_word())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->word().data(), this->word().length(), ::google::protobuf::internal::WireFormat::PARSE, "word"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCBannedWord) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCBannedWord) return false; #undef DO_ } void CMsgGCBannedWord::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCBannedWord) // optional uint32 word_id = 1; if (has_word_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->word_id(), output); } // optional .GC_BannedWordType word_type = 2 [default = GC_BANNED_WORD_DISABLE_WORD]; if (has_word_type()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 2, this->word_type(), output); } // optional string word = 3; if (has_word()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->word().data(), this->word().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "word"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 3, this->word(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCBannedWord) } ::google::protobuf::uint8* CMsgGCBannedWord::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCBannedWord) // optional uint32 word_id = 1; if (has_word_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->word_id(), target); } // optional .GC_BannedWordType word_type = 2 [default = GC_BANNED_WORD_DISABLE_WORD]; if (has_word_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 2, this->word_type(), target); } // optional string word = 3; if (has_word()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->word().data(), this->word().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "word"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->word(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCBannedWord) return target; } int CMsgGCBannedWord::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 word_id = 1; if (has_word_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->word_id()); } // optional .GC_BannedWordType word_type = 2 [default = GC_BANNED_WORD_DISABLE_WORD]; if (has_word_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->word_type()); } // optional string word = 3; if (has_word()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->word()); } } 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; } void CMsgGCBannedWord::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCBannedWord* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCBannedWord*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCBannedWord::MergeFrom(const CMsgGCBannedWord& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_word_id()) { set_word_id(from.word_id()); } if (from.has_word_type()) { set_word_type(from.word_type()); } if (from.has_word()) { set_word(from.word()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCBannedWord::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCBannedWord::CopyFrom(const CMsgGCBannedWord& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCBannedWord::IsInitialized() const { return true; } void CMsgGCBannedWord::Swap(CMsgGCBannedWord* other) { if (other != this) { std::swap(word_id_, other->word_id_); std::swap(word_type_, other->word_type_); std::swap(word_, other->word_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCBannedWord::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCBannedWord_descriptor_; metadata.reflection = CMsgGCBannedWord_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCBannedWordListResponse::kBanListGroupIdFieldNumber; const int CMsgGCBannedWordListResponse::kWordListFieldNumber; #endif // !_MSC_VER CMsgGCBannedWordListResponse::CMsgGCBannedWordListResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCBannedWordListResponse) } void CMsgGCBannedWordListResponse::InitAsDefaultInstance() { } CMsgGCBannedWordListResponse::CMsgGCBannedWordListResponse(const CMsgGCBannedWordListResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCBannedWordListResponse) } void CMsgGCBannedWordListResponse::SharedCtor() { _cached_size_ = 0; ban_list_group_id_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCBannedWordListResponse::~CMsgGCBannedWordListResponse() { // @@protoc_insertion_point(destructor:CMsgGCBannedWordListResponse) SharedDtor(); } void CMsgGCBannedWordListResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgGCBannedWordListResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCBannedWordListResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCBannedWordListResponse_descriptor_; } const CMsgGCBannedWordListResponse& CMsgGCBannedWordListResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCBannedWordListResponse* CMsgGCBannedWordListResponse::default_instance_ = NULL; CMsgGCBannedWordListResponse* CMsgGCBannedWordListResponse::New() const { return new CMsgGCBannedWordListResponse; } void CMsgGCBannedWordListResponse::Clear() { ban_list_group_id_ = 0u; word_list_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCBannedWordListResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCBannedWordListResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 ban_list_group_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &ban_list_group_id_))); set_has_ban_list_group_id(); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_word_list; break; } // repeated .CMsgGCBannedWord word_list = 2; case 2: { if (tag == 18) { parse_word_list: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_word_list())); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_word_list; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCBannedWordListResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCBannedWordListResponse) return false; #undef DO_ } void CMsgGCBannedWordListResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCBannedWordListResponse) // optional uint32 ban_list_group_id = 1; if (has_ban_list_group_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->ban_list_group_id(), output); } // repeated .CMsgGCBannedWord word_list = 2; for (int i = 0; i < this->word_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2, this->word_list(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCBannedWordListResponse) } ::google::protobuf::uint8* CMsgGCBannedWordListResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCBannedWordListResponse) // optional uint32 ban_list_group_id = 1; if (has_ban_list_group_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->ban_list_group_id(), target); } // repeated .CMsgGCBannedWord word_list = 2; for (int i = 0; i < this->word_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 2, this->word_list(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCBannedWordListResponse) return target; } int CMsgGCBannedWordListResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 ban_list_group_id = 1; if (has_ban_list_group_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->ban_list_group_id()); } } // repeated .CMsgGCBannedWord word_list = 2; total_size += 1 * this->word_list_size(); for (int i = 0; i < this->word_list_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->word_list(i)); } 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; } void CMsgGCBannedWordListResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCBannedWordListResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCBannedWordListResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCBannedWordListResponse::MergeFrom(const CMsgGCBannedWordListResponse& from) { GOOGLE_CHECK_NE(&from, this); word_list_.MergeFrom(from.word_list_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ban_list_group_id()) { set_ban_list_group_id(from.ban_list_group_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCBannedWordListResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCBannedWordListResponse::CopyFrom(const CMsgGCBannedWordListResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCBannedWordListResponse::IsInitialized() const { return true; } void CMsgGCBannedWordListResponse::Swap(CMsgGCBannedWordListResponse* other) { if (other != this) { std::swap(ban_list_group_id_, other->ban_list_group_id_); word_list_.Swap(&other->word_list_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCBannedWordListResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCBannedWordListResponse_descriptor_; metadata.reflection = CMsgGCBannedWordListResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCToGCBannedWordListBroadcast::kBroadcastFieldNumber; #endif // !_MSC_VER CMsgGCToGCBannedWordListBroadcast::CMsgGCToGCBannedWordListBroadcast() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCToGCBannedWordListBroadcast) } void CMsgGCToGCBannedWordListBroadcast::InitAsDefaultInstance() { broadcast_ = const_cast< ::CMsgGCBannedWordListResponse*>(&::CMsgGCBannedWordListResponse::default_instance()); } CMsgGCToGCBannedWordListBroadcast::CMsgGCToGCBannedWordListBroadcast(const CMsgGCToGCBannedWordListBroadcast& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCToGCBannedWordListBroadcast) } void CMsgGCToGCBannedWordListBroadcast::SharedCtor() { _cached_size_ = 0; broadcast_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCToGCBannedWordListBroadcast::~CMsgGCToGCBannedWordListBroadcast() { // @@protoc_insertion_point(destructor:CMsgGCToGCBannedWordListBroadcast) SharedDtor(); } void CMsgGCToGCBannedWordListBroadcast::SharedDtor() { if (this != default_instance_) { delete broadcast_; } } void CMsgGCToGCBannedWordListBroadcast::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCToGCBannedWordListBroadcast::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCToGCBannedWordListBroadcast_descriptor_; } const CMsgGCToGCBannedWordListBroadcast& CMsgGCToGCBannedWordListBroadcast::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCToGCBannedWordListBroadcast* CMsgGCToGCBannedWordListBroadcast::default_instance_ = NULL; CMsgGCToGCBannedWordListBroadcast* CMsgGCToGCBannedWordListBroadcast::New() const { return new CMsgGCToGCBannedWordListBroadcast; } void CMsgGCToGCBannedWordListBroadcast::Clear() { if (has_broadcast()) { if (broadcast_ != NULL) broadcast_->::CMsgGCBannedWordListResponse::Clear(); } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCToGCBannedWordListBroadcast::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCToGCBannedWordListBroadcast) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .CMsgGCBannedWordListResponse broadcast = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_broadcast())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCToGCBannedWordListBroadcast) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCToGCBannedWordListBroadcast) return false; #undef DO_ } void CMsgGCToGCBannedWordListBroadcast::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCToGCBannedWordListBroadcast) // optional .CMsgGCBannedWordListResponse broadcast = 1; if (has_broadcast()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1, this->broadcast(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCToGCBannedWordListBroadcast) } ::google::protobuf::uint8* CMsgGCToGCBannedWordListBroadcast::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCToGCBannedWordListBroadcast) // optional .CMsgGCBannedWordListResponse broadcast = 1; if (has_broadcast()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 1, this->broadcast(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCToGCBannedWordListBroadcast) return target; } int CMsgGCToGCBannedWordListBroadcast::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional .CMsgGCBannedWordListResponse broadcast = 1; if (has_broadcast()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->broadcast()); } } 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; } void CMsgGCToGCBannedWordListBroadcast::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCToGCBannedWordListBroadcast* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCToGCBannedWordListBroadcast*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCToGCBannedWordListBroadcast::MergeFrom(const CMsgGCToGCBannedWordListBroadcast& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_broadcast()) { mutable_broadcast()->::CMsgGCBannedWordListResponse::MergeFrom(from.broadcast()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCToGCBannedWordListBroadcast::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCToGCBannedWordListBroadcast::CopyFrom(const CMsgGCToGCBannedWordListBroadcast& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCToGCBannedWordListBroadcast::IsInitialized() const { return true; } void CMsgGCToGCBannedWordListBroadcast::Swap(CMsgGCToGCBannedWordListBroadcast* other) { if (other != this) { std::swap(broadcast_, other->broadcast_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCToGCBannedWordListBroadcast::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCToGCBannedWordListBroadcast_descriptor_; metadata.reflection = CMsgGCToGCBannedWordListBroadcast_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCToGCBannedWordListUpdated::kGroupIdFieldNumber; #endif // !_MSC_VER CMsgGCToGCBannedWordListUpdated::CMsgGCToGCBannedWordListUpdated() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCToGCBannedWordListUpdated) } void CMsgGCToGCBannedWordListUpdated::InitAsDefaultInstance() { } CMsgGCToGCBannedWordListUpdated::CMsgGCToGCBannedWordListUpdated(const CMsgGCToGCBannedWordListUpdated& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCToGCBannedWordListUpdated) } void CMsgGCToGCBannedWordListUpdated::SharedCtor() { _cached_size_ = 0; group_id_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCToGCBannedWordListUpdated::~CMsgGCToGCBannedWordListUpdated() { // @@protoc_insertion_point(destructor:CMsgGCToGCBannedWordListUpdated) SharedDtor(); } void CMsgGCToGCBannedWordListUpdated::SharedDtor() { if (this != default_instance_) { } } void CMsgGCToGCBannedWordListUpdated::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCToGCBannedWordListUpdated::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCToGCBannedWordListUpdated_descriptor_; } const CMsgGCToGCBannedWordListUpdated& CMsgGCToGCBannedWordListUpdated::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCToGCBannedWordListUpdated* CMsgGCToGCBannedWordListUpdated::default_instance_ = NULL; CMsgGCToGCBannedWordListUpdated* CMsgGCToGCBannedWordListUpdated::New() const { return new CMsgGCToGCBannedWordListUpdated; } void CMsgGCToGCBannedWordListUpdated::Clear() { group_id_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCToGCBannedWordListUpdated::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCToGCBannedWordListUpdated) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 group_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &group_id_))); set_has_group_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCToGCBannedWordListUpdated) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCToGCBannedWordListUpdated) return false; #undef DO_ } void CMsgGCToGCBannedWordListUpdated::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCToGCBannedWordListUpdated) // optional uint32 group_id = 1; if (has_group_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->group_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCToGCBannedWordListUpdated) } ::google::protobuf::uint8* CMsgGCToGCBannedWordListUpdated::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCToGCBannedWordListUpdated) // optional uint32 group_id = 1; if (has_group_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->group_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCToGCBannedWordListUpdated) return target; } int CMsgGCToGCBannedWordListUpdated::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 group_id = 1; if (has_group_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->group_id()); } } 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; } void CMsgGCToGCBannedWordListUpdated::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCToGCBannedWordListUpdated* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCToGCBannedWordListUpdated*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCToGCBannedWordListUpdated::MergeFrom(const CMsgGCToGCBannedWordListUpdated& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_group_id()) { set_group_id(from.group_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCToGCBannedWordListUpdated::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCToGCBannedWordListUpdated::CopyFrom(const CMsgGCToGCBannedWordListUpdated& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCToGCBannedWordListUpdated::IsInitialized() const { return true; } void CMsgGCToGCBannedWordListUpdated::Swap(CMsgGCToGCBannedWordListUpdated* other) { if (other != this) { std::swap(group_id_, other->group_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCToGCBannedWordListUpdated::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCToGCBannedWordListUpdated_descriptor_; metadata.reflection = CMsgGCToGCBannedWordListUpdated_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCToGCDirtySDOCache::kSdoTypeFieldNumber; const int CMsgGCToGCDirtySDOCache::kKeyUint64FieldNumber; #endif // !_MSC_VER CMsgGCToGCDirtySDOCache::CMsgGCToGCDirtySDOCache() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCToGCDirtySDOCache) } void CMsgGCToGCDirtySDOCache::InitAsDefaultInstance() { } CMsgGCToGCDirtySDOCache::CMsgGCToGCDirtySDOCache(const CMsgGCToGCDirtySDOCache& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCToGCDirtySDOCache) } void CMsgGCToGCDirtySDOCache::SharedCtor() { _cached_size_ = 0; sdo_type_ = 0u; key_uint64_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCToGCDirtySDOCache::~CMsgGCToGCDirtySDOCache() { // @@protoc_insertion_point(destructor:CMsgGCToGCDirtySDOCache) SharedDtor(); } void CMsgGCToGCDirtySDOCache::SharedDtor() { if (this != default_instance_) { } } void CMsgGCToGCDirtySDOCache::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCToGCDirtySDOCache::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCToGCDirtySDOCache_descriptor_; } const CMsgGCToGCDirtySDOCache& CMsgGCToGCDirtySDOCache::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCToGCDirtySDOCache* CMsgGCToGCDirtySDOCache::default_instance_ = NULL; CMsgGCToGCDirtySDOCache* CMsgGCToGCDirtySDOCache::New() const { return new CMsgGCToGCDirtySDOCache; } void CMsgGCToGCDirtySDOCache::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgGCToGCDirtySDOCache*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(key_uint64_, sdo_type_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCToGCDirtySDOCache::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCToGCDirtySDOCache) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 sdo_type = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &sdo_type_))); set_has_sdo_type(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_key_uint64; break; } // optional uint64 key_uint64 = 2; case 2: { if (tag == 16) { parse_key_uint64: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &key_uint64_))); set_has_key_uint64(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCToGCDirtySDOCache) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCToGCDirtySDOCache) return false; #undef DO_ } void CMsgGCToGCDirtySDOCache::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCToGCDirtySDOCache) // optional uint32 sdo_type = 1; if (has_sdo_type()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sdo_type(), output); } // optional uint64 key_uint64 = 2; if (has_key_uint64()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->key_uint64(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCToGCDirtySDOCache) } ::google::protobuf::uint8* CMsgGCToGCDirtySDOCache::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCToGCDirtySDOCache) // optional uint32 sdo_type = 1; if (has_sdo_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->sdo_type(), target); } // optional uint64 key_uint64 = 2; if (has_key_uint64()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->key_uint64(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCToGCDirtySDOCache) return target; } int CMsgGCToGCDirtySDOCache::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 sdo_type = 1; if (has_sdo_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->sdo_type()); } // optional uint64 key_uint64 = 2; if (has_key_uint64()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->key_uint64()); } } 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; } void CMsgGCToGCDirtySDOCache::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCToGCDirtySDOCache* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCToGCDirtySDOCache*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCToGCDirtySDOCache::MergeFrom(const CMsgGCToGCDirtySDOCache& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_sdo_type()) { set_sdo_type(from.sdo_type()); } if (from.has_key_uint64()) { set_key_uint64(from.key_uint64()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCToGCDirtySDOCache::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCToGCDirtySDOCache::CopyFrom(const CMsgGCToGCDirtySDOCache& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCToGCDirtySDOCache::IsInitialized() const { return true; } void CMsgGCToGCDirtySDOCache::Swap(CMsgGCToGCDirtySDOCache* other) { if (other != this) { std::swap(sdo_type_, other->sdo_type_); std::swap(key_uint64_, other->key_uint64_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCToGCDirtySDOCache::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCToGCDirtySDOCache_descriptor_; metadata.reflection = CMsgGCToGCDirtySDOCache_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCToGCDirtyMultipleSDOCache::kSdoTypeFieldNumber; const int CMsgGCToGCDirtyMultipleSDOCache::kKeyUint64FieldNumber; #endif // !_MSC_VER CMsgGCToGCDirtyMultipleSDOCache::CMsgGCToGCDirtyMultipleSDOCache() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCToGCDirtyMultipleSDOCache) } void CMsgGCToGCDirtyMultipleSDOCache::InitAsDefaultInstance() { } CMsgGCToGCDirtyMultipleSDOCache::CMsgGCToGCDirtyMultipleSDOCache(const CMsgGCToGCDirtyMultipleSDOCache& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCToGCDirtyMultipleSDOCache) } void CMsgGCToGCDirtyMultipleSDOCache::SharedCtor() { _cached_size_ = 0; sdo_type_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCToGCDirtyMultipleSDOCache::~CMsgGCToGCDirtyMultipleSDOCache() { // @@protoc_insertion_point(destructor:CMsgGCToGCDirtyMultipleSDOCache) SharedDtor(); } void CMsgGCToGCDirtyMultipleSDOCache::SharedDtor() { if (this != default_instance_) { } } void CMsgGCToGCDirtyMultipleSDOCache::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCToGCDirtyMultipleSDOCache::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCToGCDirtyMultipleSDOCache_descriptor_; } const CMsgGCToGCDirtyMultipleSDOCache& CMsgGCToGCDirtyMultipleSDOCache::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCToGCDirtyMultipleSDOCache* CMsgGCToGCDirtyMultipleSDOCache::default_instance_ = NULL; CMsgGCToGCDirtyMultipleSDOCache* CMsgGCToGCDirtyMultipleSDOCache::New() const { return new CMsgGCToGCDirtyMultipleSDOCache; } void CMsgGCToGCDirtyMultipleSDOCache::Clear() { sdo_type_ = 0u; key_uint64_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCToGCDirtyMultipleSDOCache::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCToGCDirtyMultipleSDOCache) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 sdo_type = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &sdo_type_))); set_has_sdo_type(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_key_uint64; break; } // repeated uint64 key_uint64 = 2; case 2: { if (tag == 16) { parse_key_uint64: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 1, 16, input, this->mutable_key_uint64()))); } else if (tag == 18) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, this->mutable_key_uint64()))); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_key_uint64; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCToGCDirtyMultipleSDOCache) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCToGCDirtyMultipleSDOCache) return false; #undef DO_ } void CMsgGCToGCDirtyMultipleSDOCache::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCToGCDirtyMultipleSDOCache) // optional uint32 sdo_type = 1; if (has_sdo_type()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->sdo_type(), output); } // repeated uint64 key_uint64 = 2; for (int i = 0; i < this->key_uint64_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt64( 2, this->key_uint64(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCToGCDirtyMultipleSDOCache) } ::google::protobuf::uint8* CMsgGCToGCDirtyMultipleSDOCache::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCToGCDirtyMultipleSDOCache) // optional uint32 sdo_type = 1; if (has_sdo_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->sdo_type(), target); } // repeated uint64 key_uint64 = 2; for (int i = 0; i < this->key_uint64_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt64ToArray(2, this->key_uint64(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCToGCDirtyMultipleSDOCache) return target; } int CMsgGCToGCDirtyMultipleSDOCache::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 sdo_type = 1; if (has_sdo_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->sdo_type()); } } // repeated uint64 key_uint64 = 2; { int data_size = 0; for (int i = 0; i < this->key_uint64_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt64Size(this->key_uint64(i)); } total_size += 1 * this->key_uint64_size() + data_size; } 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; } void CMsgGCToGCDirtyMultipleSDOCache::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCToGCDirtyMultipleSDOCache* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCToGCDirtyMultipleSDOCache*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCToGCDirtyMultipleSDOCache::MergeFrom(const CMsgGCToGCDirtyMultipleSDOCache& from) { GOOGLE_CHECK_NE(&from, this); key_uint64_.MergeFrom(from.key_uint64_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_sdo_type()) { set_sdo_type(from.sdo_type()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCToGCDirtyMultipleSDOCache::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCToGCDirtyMultipleSDOCache::CopyFrom(const CMsgGCToGCDirtyMultipleSDOCache& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCToGCDirtyMultipleSDOCache::IsInitialized() const { return true; } void CMsgGCToGCDirtyMultipleSDOCache::Swap(CMsgGCToGCDirtyMultipleSDOCache* other) { if (other != this) { std::swap(sdo_type_, other->sdo_type_); key_uint64_.Swap(&other->key_uint64_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCToGCDirtyMultipleSDOCache::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCToGCDirtyMultipleSDOCache_descriptor_; metadata.reflection = CMsgGCToGCDirtyMultipleSDOCache_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCToGCApplyLocalizationDiff::kLanguageFieldNumber; const int CMsgGCToGCApplyLocalizationDiff::kPackedDiffFieldNumber; #endif // !_MSC_VER CMsgGCToGCApplyLocalizationDiff::CMsgGCToGCApplyLocalizationDiff() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCToGCApplyLocalizationDiff) } void CMsgGCToGCApplyLocalizationDiff::InitAsDefaultInstance() { } CMsgGCToGCApplyLocalizationDiff::CMsgGCToGCApplyLocalizationDiff(const CMsgGCToGCApplyLocalizationDiff& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCToGCApplyLocalizationDiff) } void CMsgGCToGCApplyLocalizationDiff::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; language_ = 0u; packed_diff_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCToGCApplyLocalizationDiff::~CMsgGCToGCApplyLocalizationDiff() { // @@protoc_insertion_point(destructor:CMsgGCToGCApplyLocalizationDiff) SharedDtor(); } void CMsgGCToGCApplyLocalizationDiff::SharedDtor() { if (packed_diff_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete packed_diff_; } if (this != default_instance_) { } } void CMsgGCToGCApplyLocalizationDiff::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCToGCApplyLocalizationDiff::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCToGCApplyLocalizationDiff_descriptor_; } const CMsgGCToGCApplyLocalizationDiff& CMsgGCToGCApplyLocalizationDiff::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCToGCApplyLocalizationDiff* CMsgGCToGCApplyLocalizationDiff::default_instance_ = NULL; CMsgGCToGCApplyLocalizationDiff* CMsgGCToGCApplyLocalizationDiff::New() const { return new CMsgGCToGCApplyLocalizationDiff; } void CMsgGCToGCApplyLocalizationDiff::Clear() { if (_has_bits_[0 / 32] & 3) { language_ = 0u; if (has_packed_diff()) { if (packed_diff_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { packed_diff_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCToGCApplyLocalizationDiff::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCToGCApplyLocalizationDiff) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 language = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &language_))); set_has_language(); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_packed_diff; break; } // optional string packed_diff = 2; case 2: { if (tag == 18) { parse_packed_diff: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_packed_diff())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->packed_diff().data(), this->packed_diff().length(), ::google::protobuf::internal::WireFormat::PARSE, "packed_diff"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCToGCApplyLocalizationDiff) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCToGCApplyLocalizationDiff) return false; #undef DO_ } void CMsgGCToGCApplyLocalizationDiff::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCToGCApplyLocalizationDiff) // optional uint32 language = 1; if (has_language()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->language(), output); } // optional string packed_diff = 2; if (has_packed_diff()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->packed_diff().data(), this->packed_diff().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "packed_diff"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 2, this->packed_diff(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCToGCApplyLocalizationDiff) } ::google::protobuf::uint8* CMsgGCToGCApplyLocalizationDiff::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCToGCApplyLocalizationDiff) // optional uint32 language = 1; if (has_language()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->language(), target); } // optional string packed_diff = 2; if (has_packed_diff()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->packed_diff().data(), this->packed_diff().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "packed_diff"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->packed_diff(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCToGCApplyLocalizationDiff) return target; } int CMsgGCToGCApplyLocalizationDiff::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 language = 1; if (has_language()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->language()); } // optional string packed_diff = 2; if (has_packed_diff()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->packed_diff()); } } 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; } void CMsgGCToGCApplyLocalizationDiff::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCToGCApplyLocalizationDiff* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCToGCApplyLocalizationDiff*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCToGCApplyLocalizationDiff::MergeFrom(const CMsgGCToGCApplyLocalizationDiff& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_language()) { set_language(from.language()); } if (from.has_packed_diff()) { set_packed_diff(from.packed_diff()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCToGCApplyLocalizationDiff::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCToGCApplyLocalizationDiff::CopyFrom(const CMsgGCToGCApplyLocalizationDiff& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCToGCApplyLocalizationDiff::IsInitialized() const { return true; } void CMsgGCToGCApplyLocalizationDiff::Swap(CMsgGCToGCApplyLocalizationDiff* other) { if (other != this) { std::swap(language_, other->language_); std::swap(packed_diff_, other->packed_diff_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCToGCApplyLocalizationDiff::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCToGCApplyLocalizationDiff_descriptor_; metadata.reflection = CMsgGCToGCApplyLocalizationDiff_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCToGCApplyLocalizationDiffResponse::kSuccessFieldNumber; #endif // !_MSC_VER CMsgGCToGCApplyLocalizationDiffResponse::CMsgGCToGCApplyLocalizationDiffResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCToGCApplyLocalizationDiffResponse) } void CMsgGCToGCApplyLocalizationDiffResponse::InitAsDefaultInstance() { } CMsgGCToGCApplyLocalizationDiffResponse::CMsgGCToGCApplyLocalizationDiffResponse(const CMsgGCToGCApplyLocalizationDiffResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCToGCApplyLocalizationDiffResponse) } void CMsgGCToGCApplyLocalizationDiffResponse::SharedCtor() { _cached_size_ = 0; success_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCToGCApplyLocalizationDiffResponse::~CMsgGCToGCApplyLocalizationDiffResponse() { // @@protoc_insertion_point(destructor:CMsgGCToGCApplyLocalizationDiffResponse) SharedDtor(); } void CMsgGCToGCApplyLocalizationDiffResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgGCToGCApplyLocalizationDiffResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCToGCApplyLocalizationDiffResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCToGCApplyLocalizationDiffResponse_descriptor_; } const CMsgGCToGCApplyLocalizationDiffResponse& CMsgGCToGCApplyLocalizationDiffResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCToGCApplyLocalizationDiffResponse* CMsgGCToGCApplyLocalizationDiffResponse::default_instance_ = NULL; CMsgGCToGCApplyLocalizationDiffResponse* CMsgGCToGCApplyLocalizationDiffResponse::New() const { return new CMsgGCToGCApplyLocalizationDiffResponse; } void CMsgGCToGCApplyLocalizationDiffResponse::Clear() { success_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCToGCApplyLocalizationDiffResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCToGCApplyLocalizationDiffResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bool success = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &success_))); set_has_success(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCToGCApplyLocalizationDiffResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCToGCApplyLocalizationDiffResponse) return false; #undef DO_ } void CMsgGCToGCApplyLocalizationDiffResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCToGCApplyLocalizationDiffResponse) // optional bool success = 1; if (has_success()) { ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->success(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCToGCApplyLocalizationDiffResponse) } ::google::protobuf::uint8* CMsgGCToGCApplyLocalizationDiffResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCToGCApplyLocalizationDiffResponse) // optional bool success = 1; if (has_success()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->success(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCToGCApplyLocalizationDiffResponse) return target; } int CMsgGCToGCApplyLocalizationDiffResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional bool success = 1; if (has_success()) { total_size += 1 + 1; } } 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; } void CMsgGCToGCApplyLocalizationDiffResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCToGCApplyLocalizationDiffResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCToGCApplyLocalizationDiffResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCToGCApplyLocalizationDiffResponse::MergeFrom(const CMsgGCToGCApplyLocalizationDiffResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_success()) { set_success(from.success()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCToGCApplyLocalizationDiffResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCToGCApplyLocalizationDiffResponse::CopyFrom(const CMsgGCToGCApplyLocalizationDiffResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCToGCApplyLocalizationDiffResponse::IsInitialized() const { return true; } void CMsgGCToGCApplyLocalizationDiffResponse::Swap(CMsgGCToGCApplyLocalizationDiffResponse* other) { if (other != this) { std::swap(success_, other->success_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCToGCApplyLocalizationDiffResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCToGCApplyLocalizationDiffResponse_descriptor_; metadata.reflection = CMsgGCToGCApplyLocalizationDiffResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCCollectItem::kCollectionItemIdFieldNumber; const int CMsgGCCollectItem::kSubjectItemIdFieldNumber; #endif // !_MSC_VER CMsgGCCollectItem::CMsgGCCollectItem() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCCollectItem) } void CMsgGCCollectItem::InitAsDefaultInstance() { } CMsgGCCollectItem::CMsgGCCollectItem(const CMsgGCCollectItem& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCCollectItem) } void CMsgGCCollectItem::SharedCtor() { _cached_size_ = 0; collection_item_id_ = GOOGLE_ULONGLONG(0); subject_item_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCCollectItem::~CMsgGCCollectItem() { // @@protoc_insertion_point(destructor:CMsgGCCollectItem) SharedDtor(); } void CMsgGCCollectItem::SharedDtor() { if (this != default_instance_) { } } void CMsgGCCollectItem::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCCollectItem::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCCollectItem_descriptor_; } const CMsgGCCollectItem& CMsgGCCollectItem::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCCollectItem* CMsgGCCollectItem::default_instance_ = NULL; CMsgGCCollectItem* CMsgGCCollectItem::New() const { return new CMsgGCCollectItem; } void CMsgGCCollectItem::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgGCCollectItem*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(collection_item_id_, subject_item_id_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCCollectItem::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCCollectItem) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 collection_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &collection_item_id_))); set_has_collection_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_subject_item_id; break; } // optional uint64 subject_item_id = 2; case 2: { if (tag == 16) { parse_subject_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &subject_item_id_))); set_has_subject_item_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCCollectItem) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCCollectItem) return false; #undef DO_ } void CMsgGCCollectItem::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCCollectItem) // optional uint64 collection_item_id = 1; if (has_collection_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->collection_item_id(), output); } // optional uint64 subject_item_id = 2; if (has_subject_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->subject_item_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCCollectItem) } ::google::protobuf::uint8* CMsgGCCollectItem::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCCollectItem) // optional uint64 collection_item_id = 1; if (has_collection_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->collection_item_id(), target); } // optional uint64 subject_item_id = 2; if (has_subject_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->subject_item_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCCollectItem) return target; } int CMsgGCCollectItem::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 collection_item_id = 1; if (has_collection_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->collection_item_id()); } // optional uint64 subject_item_id = 2; if (has_subject_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->subject_item_id()); } } 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; } void CMsgGCCollectItem::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCCollectItem* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCCollectItem*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCCollectItem::MergeFrom(const CMsgGCCollectItem& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_collection_item_id()) { set_collection_item_id(from.collection_item_id()); } if (from.has_subject_item_id()) { set_subject_item_id(from.subject_item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCCollectItem::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCCollectItem::CopyFrom(const CMsgGCCollectItem& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCCollectItem::IsInitialized() const { return true; } void CMsgGCCollectItem::Swap(CMsgGCCollectItem* other) { if (other != this) { std::swap(collection_item_id_, other->collection_item_id_); std::swap(subject_item_id_, other->subject_item_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCCollectItem::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCCollectItem_descriptor_; metadata.reflection = CMsgGCCollectItem_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER CMsgSDONoMemcached::CMsgSDONoMemcached() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgSDONoMemcached) } void CMsgSDONoMemcached::InitAsDefaultInstance() { } CMsgSDONoMemcached::CMsgSDONoMemcached(const CMsgSDONoMemcached& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgSDONoMemcached) } void CMsgSDONoMemcached::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgSDONoMemcached::~CMsgSDONoMemcached() { // @@protoc_insertion_point(destructor:CMsgSDONoMemcached) SharedDtor(); } void CMsgSDONoMemcached::SharedDtor() { if (this != default_instance_) { } } void CMsgSDONoMemcached::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgSDONoMemcached::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgSDONoMemcached_descriptor_; } const CMsgSDONoMemcached& CMsgSDONoMemcached::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgSDONoMemcached* CMsgSDONoMemcached::default_instance_ = NULL; CMsgSDONoMemcached* CMsgSDONoMemcached::New() const { return new CMsgSDONoMemcached; } void CMsgSDONoMemcached::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgSDONoMemcached::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgSDONoMemcached) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } success: // @@protoc_insertion_point(parse_success:CMsgSDONoMemcached) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgSDONoMemcached) return false; #undef DO_ } void CMsgSDONoMemcached::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgSDONoMemcached) if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgSDONoMemcached) } ::google::protobuf::uint8* CMsgSDONoMemcached::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgSDONoMemcached) if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgSDONoMemcached) return target; } int CMsgSDONoMemcached::ByteSize() const { int total_size = 0; 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; } void CMsgSDONoMemcached::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgSDONoMemcached* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgSDONoMemcached*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgSDONoMemcached::MergeFrom(const CMsgSDONoMemcached& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgSDONoMemcached::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgSDONoMemcached::CopyFrom(const CMsgSDONoMemcached& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgSDONoMemcached::IsInitialized() const { return true; } void CMsgSDONoMemcached::Swap(CMsgSDONoMemcached* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgSDONoMemcached::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgSDONoMemcached_descriptor_; metadata.reflection = CMsgSDONoMemcached_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCToGCUpdateSQLKeyValue::kKeyNameFieldNumber; #endif // !_MSC_VER CMsgGCToGCUpdateSQLKeyValue::CMsgGCToGCUpdateSQLKeyValue() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCToGCUpdateSQLKeyValue) } void CMsgGCToGCUpdateSQLKeyValue::InitAsDefaultInstance() { } CMsgGCToGCUpdateSQLKeyValue::CMsgGCToGCUpdateSQLKeyValue(const CMsgGCToGCUpdateSQLKeyValue& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCToGCUpdateSQLKeyValue) } void CMsgGCToGCUpdateSQLKeyValue::SharedCtor() { ::google::protobuf::internal::GetEmptyString(); _cached_size_ = 0; key_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCToGCUpdateSQLKeyValue::~CMsgGCToGCUpdateSQLKeyValue() { // @@protoc_insertion_point(destructor:CMsgGCToGCUpdateSQLKeyValue) SharedDtor(); } void CMsgGCToGCUpdateSQLKeyValue::SharedDtor() { if (key_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { delete key_name_; } if (this != default_instance_) { } } void CMsgGCToGCUpdateSQLKeyValue::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCToGCUpdateSQLKeyValue::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCToGCUpdateSQLKeyValue_descriptor_; } const CMsgGCToGCUpdateSQLKeyValue& CMsgGCToGCUpdateSQLKeyValue::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCToGCUpdateSQLKeyValue* CMsgGCToGCUpdateSQLKeyValue::default_instance_ = NULL; CMsgGCToGCUpdateSQLKeyValue* CMsgGCToGCUpdateSQLKeyValue::New() const { return new CMsgGCToGCUpdateSQLKeyValue; } void CMsgGCToGCUpdateSQLKeyValue::Clear() { if (has_key_name()) { if (key_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { key_name_->clear(); } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCToGCUpdateSQLKeyValue::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCToGCUpdateSQLKeyValue) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string key_name = 1; case 1: { if (tag == 10) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_key_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->key_name().data(), this->key_name().length(), ::google::protobuf::internal::WireFormat::PARSE, "key_name"); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCToGCUpdateSQLKeyValue) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCToGCUpdateSQLKeyValue) return false; #undef DO_ } void CMsgGCToGCUpdateSQLKeyValue::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCToGCUpdateSQLKeyValue) // optional string key_name = 1; if (has_key_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->key_name().data(), this->key_name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "key_name"); ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 1, this->key_name(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCToGCUpdateSQLKeyValue) } ::google::protobuf::uint8* CMsgGCToGCUpdateSQLKeyValue::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCToGCUpdateSQLKeyValue) // optional string key_name = 1; if (has_key_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->key_name().data(), this->key_name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE, "key_name"); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->key_name(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCToGCUpdateSQLKeyValue) return target; } int CMsgGCToGCUpdateSQLKeyValue::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string key_name = 1; if (has_key_name()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->key_name()); } } 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; } void CMsgGCToGCUpdateSQLKeyValue::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCToGCUpdateSQLKeyValue* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCToGCUpdateSQLKeyValue*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCToGCUpdateSQLKeyValue::MergeFrom(const CMsgGCToGCUpdateSQLKeyValue& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_key_name()) { set_key_name(from.key_name()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCToGCUpdateSQLKeyValue::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCToGCUpdateSQLKeyValue::CopyFrom(const CMsgGCToGCUpdateSQLKeyValue& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCToGCUpdateSQLKeyValue::IsInitialized() const { return true; } void CMsgGCToGCUpdateSQLKeyValue::Swap(CMsgGCToGCUpdateSQLKeyValue* other) { if (other != this) { std::swap(key_name_, other->key_name_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCToGCUpdateSQLKeyValue::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCToGCUpdateSQLKeyValue_descriptor_; metadata.reflection = CMsgGCToGCUpdateSQLKeyValue_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCServerVersionUpdated::kServerVersionFieldNumber; #endif // !_MSC_VER CMsgGCServerVersionUpdated::CMsgGCServerVersionUpdated() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCServerVersionUpdated) } void CMsgGCServerVersionUpdated::InitAsDefaultInstance() { } CMsgGCServerVersionUpdated::CMsgGCServerVersionUpdated(const CMsgGCServerVersionUpdated& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCServerVersionUpdated) } void CMsgGCServerVersionUpdated::SharedCtor() { _cached_size_ = 0; server_version_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCServerVersionUpdated::~CMsgGCServerVersionUpdated() { // @@protoc_insertion_point(destructor:CMsgGCServerVersionUpdated) SharedDtor(); } void CMsgGCServerVersionUpdated::SharedDtor() { if (this != default_instance_) { } } void CMsgGCServerVersionUpdated::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCServerVersionUpdated::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCServerVersionUpdated_descriptor_; } const CMsgGCServerVersionUpdated& CMsgGCServerVersionUpdated::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCServerVersionUpdated* CMsgGCServerVersionUpdated::default_instance_ = NULL; CMsgGCServerVersionUpdated* CMsgGCServerVersionUpdated::New() const { return new CMsgGCServerVersionUpdated; } void CMsgGCServerVersionUpdated::Clear() { server_version_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCServerVersionUpdated::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCServerVersionUpdated) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 server_version = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &server_version_))); set_has_server_version(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCServerVersionUpdated) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCServerVersionUpdated) return false; #undef DO_ } void CMsgGCServerVersionUpdated::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCServerVersionUpdated) // optional uint32 server_version = 1; if (has_server_version()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->server_version(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCServerVersionUpdated) } ::google::protobuf::uint8* CMsgGCServerVersionUpdated::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCServerVersionUpdated) // optional uint32 server_version = 1; if (has_server_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->server_version(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCServerVersionUpdated) return target; } int CMsgGCServerVersionUpdated::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 server_version = 1; if (has_server_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->server_version()); } } 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; } void CMsgGCServerVersionUpdated::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCServerVersionUpdated* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCServerVersionUpdated*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCServerVersionUpdated::MergeFrom(const CMsgGCServerVersionUpdated& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_server_version()) { set_server_version(from.server_version()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCServerVersionUpdated::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCServerVersionUpdated::CopyFrom(const CMsgGCServerVersionUpdated& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCServerVersionUpdated::IsInitialized() const { return true; } void CMsgGCServerVersionUpdated::Swap(CMsgGCServerVersionUpdated* other) { if (other != this) { std::swap(server_version_, other->server_version_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCServerVersionUpdated::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCServerVersionUpdated_descriptor_; metadata.reflection = CMsgGCServerVersionUpdated_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCClientVersionUpdated::kClientVersionFieldNumber; #endif // !_MSC_VER CMsgGCClientVersionUpdated::CMsgGCClientVersionUpdated() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCClientVersionUpdated) } void CMsgGCClientVersionUpdated::InitAsDefaultInstance() { } CMsgGCClientVersionUpdated::CMsgGCClientVersionUpdated(const CMsgGCClientVersionUpdated& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCClientVersionUpdated) } void CMsgGCClientVersionUpdated::SharedCtor() { _cached_size_ = 0; client_version_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCClientVersionUpdated::~CMsgGCClientVersionUpdated() { // @@protoc_insertion_point(destructor:CMsgGCClientVersionUpdated) SharedDtor(); } void CMsgGCClientVersionUpdated::SharedDtor() { if (this != default_instance_) { } } void CMsgGCClientVersionUpdated::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCClientVersionUpdated::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCClientVersionUpdated_descriptor_; } const CMsgGCClientVersionUpdated& CMsgGCClientVersionUpdated::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCClientVersionUpdated* CMsgGCClientVersionUpdated::default_instance_ = NULL; CMsgGCClientVersionUpdated* CMsgGCClientVersionUpdated::New() const { return new CMsgGCClientVersionUpdated; } void CMsgGCClientVersionUpdated::Clear() { client_version_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCClientVersionUpdated::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCClientVersionUpdated) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 client_version = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &client_version_))); set_has_client_version(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCClientVersionUpdated) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCClientVersionUpdated) return false; #undef DO_ } void CMsgGCClientVersionUpdated::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCClientVersionUpdated) // optional uint32 client_version = 1; if (has_client_version()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->client_version(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCClientVersionUpdated) } ::google::protobuf::uint8* CMsgGCClientVersionUpdated::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCClientVersionUpdated) // optional uint32 client_version = 1; if (has_client_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->client_version(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCClientVersionUpdated) return target; } int CMsgGCClientVersionUpdated::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 client_version = 1; if (has_client_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->client_version()); } } 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; } void CMsgGCClientVersionUpdated::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCClientVersionUpdated* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCClientVersionUpdated*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCClientVersionUpdated::MergeFrom(const CMsgGCClientVersionUpdated& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_client_version()) { set_client_version(from.client_version()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCClientVersionUpdated::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCClientVersionUpdated::CopyFrom(const CMsgGCClientVersionUpdated& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCClientVersionUpdated::IsInitialized() const { return true; } void CMsgGCClientVersionUpdated::Swap(CMsgGCClientVersionUpdated* other) { if (other != this) { std::swap(client_version_, other->client_version_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCClientVersionUpdated::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCClientVersionUpdated_descriptor_; metadata.reflection = CMsgGCClientVersionUpdated_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER CMsgGCToGCWebAPIAccountChanged::CMsgGCToGCWebAPIAccountChanged() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCToGCWebAPIAccountChanged) } void CMsgGCToGCWebAPIAccountChanged::InitAsDefaultInstance() { } CMsgGCToGCWebAPIAccountChanged::CMsgGCToGCWebAPIAccountChanged(const CMsgGCToGCWebAPIAccountChanged& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCToGCWebAPIAccountChanged) } void CMsgGCToGCWebAPIAccountChanged::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCToGCWebAPIAccountChanged::~CMsgGCToGCWebAPIAccountChanged() { // @@protoc_insertion_point(destructor:CMsgGCToGCWebAPIAccountChanged) SharedDtor(); } void CMsgGCToGCWebAPIAccountChanged::SharedDtor() { if (this != default_instance_) { } } void CMsgGCToGCWebAPIAccountChanged::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCToGCWebAPIAccountChanged::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCToGCWebAPIAccountChanged_descriptor_; } const CMsgGCToGCWebAPIAccountChanged& CMsgGCToGCWebAPIAccountChanged::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCToGCWebAPIAccountChanged* CMsgGCToGCWebAPIAccountChanged::default_instance_ = NULL; CMsgGCToGCWebAPIAccountChanged* CMsgGCToGCWebAPIAccountChanged::New() const { return new CMsgGCToGCWebAPIAccountChanged; } void CMsgGCToGCWebAPIAccountChanged::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCToGCWebAPIAccountChanged::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCToGCWebAPIAccountChanged) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } success: // @@protoc_insertion_point(parse_success:CMsgGCToGCWebAPIAccountChanged) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCToGCWebAPIAccountChanged) return false; #undef DO_ } void CMsgGCToGCWebAPIAccountChanged::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCToGCWebAPIAccountChanged) if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCToGCWebAPIAccountChanged) } ::google::protobuf::uint8* CMsgGCToGCWebAPIAccountChanged::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCToGCWebAPIAccountChanged) if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCToGCWebAPIAccountChanged) return target; } int CMsgGCToGCWebAPIAccountChanged::ByteSize() const { int total_size = 0; 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; } void CMsgGCToGCWebAPIAccountChanged::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCToGCWebAPIAccountChanged* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCToGCWebAPIAccountChanged*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCToGCWebAPIAccountChanged::MergeFrom(const CMsgGCToGCWebAPIAccountChanged& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCToGCWebAPIAccountChanged::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCToGCWebAPIAccountChanged::CopyFrom(const CMsgGCToGCWebAPIAccountChanged& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCToGCWebAPIAccountChanged::IsInitialized() const { return true; } void CMsgGCToGCWebAPIAccountChanged::Swap(CMsgGCToGCWebAPIAccountChanged* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCToGCWebAPIAccountChanged::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCToGCWebAPIAccountChanged_descriptor_; metadata.reflection = CMsgGCToGCWebAPIAccountChanged_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgRecipeComponent::kSubjectItemIdFieldNumber; const int CMsgRecipeComponent::kAttributeIndexFieldNumber; #endif // !_MSC_VER CMsgRecipeComponent::CMsgRecipeComponent() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgRecipeComponent) } void CMsgRecipeComponent::InitAsDefaultInstance() { } CMsgRecipeComponent::CMsgRecipeComponent(const CMsgRecipeComponent& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgRecipeComponent) } void CMsgRecipeComponent::SharedCtor() { _cached_size_ = 0; subject_item_id_ = GOOGLE_ULONGLONG(0); attribute_index_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgRecipeComponent::~CMsgRecipeComponent() { // @@protoc_insertion_point(destructor:CMsgRecipeComponent) SharedDtor(); } void CMsgRecipeComponent::SharedDtor() { if (this != default_instance_) { } } void CMsgRecipeComponent::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgRecipeComponent::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgRecipeComponent_descriptor_; } const CMsgRecipeComponent& CMsgRecipeComponent::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgRecipeComponent* CMsgRecipeComponent::default_instance_ = NULL; CMsgRecipeComponent* CMsgRecipeComponent::New() const { return new CMsgRecipeComponent; } void CMsgRecipeComponent::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgRecipeComponent*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(subject_item_id_, attribute_index_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgRecipeComponent::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgRecipeComponent) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 subject_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &subject_item_id_))); set_has_subject_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_attribute_index; break; } // optional uint64 attribute_index = 2; case 2: { if (tag == 16) { parse_attribute_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &attribute_index_))); set_has_attribute_index(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgRecipeComponent) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgRecipeComponent) return false; #undef DO_ } void CMsgRecipeComponent::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgRecipeComponent) // optional uint64 subject_item_id = 1; if (has_subject_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->subject_item_id(), output); } // optional uint64 attribute_index = 2; if (has_attribute_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->attribute_index(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgRecipeComponent) } ::google::protobuf::uint8* CMsgRecipeComponent::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgRecipeComponent) // optional uint64 subject_item_id = 1; if (has_subject_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->subject_item_id(), target); } // optional uint64 attribute_index = 2; if (has_attribute_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->attribute_index(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgRecipeComponent) return target; } int CMsgRecipeComponent::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 subject_item_id = 1; if (has_subject_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->subject_item_id()); } // optional uint64 attribute_index = 2; if (has_attribute_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->attribute_index()); } } 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; } void CMsgRecipeComponent::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgRecipeComponent* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgRecipeComponent*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgRecipeComponent::MergeFrom(const CMsgRecipeComponent& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_subject_item_id()) { set_subject_item_id(from.subject_item_id()); } if (from.has_attribute_index()) { set_attribute_index(from.attribute_index()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgRecipeComponent::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgRecipeComponent::CopyFrom(const CMsgRecipeComponent& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgRecipeComponent::IsInitialized() const { return true; } void CMsgRecipeComponent::Swap(CMsgRecipeComponent* other) { if (other != this) { std::swap(subject_item_id_, other->subject_item_id_); std::swap(attribute_index_, other->attribute_index_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgRecipeComponent::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgRecipeComponent_descriptor_; metadata.reflection = CMsgRecipeComponent_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgFulfillDynamicRecipeComponent::kToolItemIdFieldNumber; const int CMsgFulfillDynamicRecipeComponent::kConsumptionComponentsFieldNumber; #endif // !_MSC_VER CMsgFulfillDynamicRecipeComponent::CMsgFulfillDynamicRecipeComponent() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgFulfillDynamicRecipeComponent) } void CMsgFulfillDynamicRecipeComponent::InitAsDefaultInstance() { } CMsgFulfillDynamicRecipeComponent::CMsgFulfillDynamicRecipeComponent(const CMsgFulfillDynamicRecipeComponent& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgFulfillDynamicRecipeComponent) } void CMsgFulfillDynamicRecipeComponent::SharedCtor() { _cached_size_ = 0; tool_item_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgFulfillDynamicRecipeComponent::~CMsgFulfillDynamicRecipeComponent() { // @@protoc_insertion_point(destructor:CMsgFulfillDynamicRecipeComponent) SharedDtor(); } void CMsgFulfillDynamicRecipeComponent::SharedDtor() { if (this != default_instance_) { } } void CMsgFulfillDynamicRecipeComponent::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgFulfillDynamicRecipeComponent::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgFulfillDynamicRecipeComponent_descriptor_; } const CMsgFulfillDynamicRecipeComponent& CMsgFulfillDynamicRecipeComponent::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgFulfillDynamicRecipeComponent* CMsgFulfillDynamicRecipeComponent::default_instance_ = NULL; CMsgFulfillDynamicRecipeComponent* CMsgFulfillDynamicRecipeComponent::New() const { return new CMsgFulfillDynamicRecipeComponent; } void CMsgFulfillDynamicRecipeComponent::Clear() { tool_item_id_ = GOOGLE_ULONGLONG(0); consumption_components_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgFulfillDynamicRecipeComponent::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgFulfillDynamicRecipeComponent) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 tool_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &tool_item_id_))); set_has_tool_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_consumption_components; break; } // repeated .CMsgRecipeComponent consumption_components = 2; case 2: { if (tag == 18) { parse_consumption_components: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_consumption_components())); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_consumption_components; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgFulfillDynamicRecipeComponent) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgFulfillDynamicRecipeComponent) return false; #undef DO_ } void CMsgFulfillDynamicRecipeComponent::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgFulfillDynamicRecipeComponent) // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->tool_item_id(), output); } // repeated .CMsgRecipeComponent consumption_components = 2; for (int i = 0; i < this->consumption_components_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2, this->consumption_components(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgFulfillDynamicRecipeComponent) } ::google::protobuf::uint8* CMsgFulfillDynamicRecipeComponent::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgFulfillDynamicRecipeComponent) // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->tool_item_id(), target); } // repeated .CMsgRecipeComponent consumption_components = 2; for (int i = 0; i < this->consumption_components_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 2, this->consumption_components(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgFulfillDynamicRecipeComponent) return target; } int CMsgFulfillDynamicRecipeComponent::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->tool_item_id()); } } // repeated .CMsgRecipeComponent consumption_components = 2; total_size += 1 * this->consumption_components_size(); for (int i = 0; i < this->consumption_components_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->consumption_components(i)); } 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; } void CMsgFulfillDynamicRecipeComponent::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgFulfillDynamicRecipeComponent* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgFulfillDynamicRecipeComponent*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgFulfillDynamicRecipeComponent::MergeFrom(const CMsgFulfillDynamicRecipeComponent& from) { GOOGLE_CHECK_NE(&from, this); consumption_components_.MergeFrom(from.consumption_components_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_tool_item_id()) { set_tool_item_id(from.tool_item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgFulfillDynamicRecipeComponent::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgFulfillDynamicRecipeComponent::CopyFrom(const CMsgFulfillDynamicRecipeComponent& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgFulfillDynamicRecipeComponent::IsInitialized() const { return true; } void CMsgFulfillDynamicRecipeComponent::Swap(CMsgFulfillDynamicRecipeComponent* other) { if (other != this) { std::swap(tool_item_id_, other->tool_item_id_); consumption_components_.Swap(&other->consumption_components_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgFulfillDynamicRecipeComponent::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgFulfillDynamicRecipeComponent_descriptor_; metadata.reflection = CMsgFulfillDynamicRecipeComponent_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCClientMarketDataRequest::kUserCurrencyFieldNumber; #endif // !_MSC_VER CMsgGCClientMarketDataRequest::CMsgGCClientMarketDataRequest() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCClientMarketDataRequest) } void CMsgGCClientMarketDataRequest::InitAsDefaultInstance() { } CMsgGCClientMarketDataRequest::CMsgGCClientMarketDataRequest(const CMsgGCClientMarketDataRequest& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCClientMarketDataRequest) } void CMsgGCClientMarketDataRequest::SharedCtor() { _cached_size_ = 0; user_currency_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCClientMarketDataRequest::~CMsgGCClientMarketDataRequest() { // @@protoc_insertion_point(destructor:CMsgGCClientMarketDataRequest) SharedDtor(); } void CMsgGCClientMarketDataRequest::SharedDtor() { if (this != default_instance_) { } } void CMsgGCClientMarketDataRequest::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCClientMarketDataRequest::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCClientMarketDataRequest_descriptor_; } const CMsgGCClientMarketDataRequest& CMsgGCClientMarketDataRequest::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCClientMarketDataRequest* CMsgGCClientMarketDataRequest::default_instance_ = NULL; CMsgGCClientMarketDataRequest* CMsgGCClientMarketDataRequest::New() const { return new CMsgGCClientMarketDataRequest; } void CMsgGCClientMarketDataRequest::Clear() { user_currency_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCClientMarketDataRequest::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCClientMarketDataRequest) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 user_currency = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &user_currency_))); set_has_user_currency(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCClientMarketDataRequest) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCClientMarketDataRequest) return false; #undef DO_ } void CMsgGCClientMarketDataRequest::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCClientMarketDataRequest) // optional uint32 user_currency = 1; if (has_user_currency()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->user_currency(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCClientMarketDataRequest) } ::google::protobuf::uint8* CMsgGCClientMarketDataRequest::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCClientMarketDataRequest) // optional uint32 user_currency = 1; if (has_user_currency()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->user_currency(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCClientMarketDataRequest) return target; } int CMsgGCClientMarketDataRequest::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 user_currency = 1; if (has_user_currency()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->user_currency()); } } 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; } void CMsgGCClientMarketDataRequest::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCClientMarketDataRequest* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCClientMarketDataRequest*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCClientMarketDataRequest::MergeFrom(const CMsgGCClientMarketDataRequest& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_user_currency()) { set_user_currency(from.user_currency()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCClientMarketDataRequest::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCClientMarketDataRequest::CopyFrom(const CMsgGCClientMarketDataRequest& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCClientMarketDataRequest::IsInitialized() const { return true; } void CMsgGCClientMarketDataRequest::Swap(CMsgGCClientMarketDataRequest* other) { if (other != this) { std::swap(user_currency_, other->user_currency_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCClientMarketDataRequest::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCClientMarketDataRequest_descriptor_; metadata.reflection = CMsgGCClientMarketDataRequest_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCClientMarketDataEntry::kItemDefIndexFieldNumber; const int CMsgGCClientMarketDataEntry::kItemQualityFieldNumber; const int CMsgGCClientMarketDataEntry::kItemSellListingsFieldNumber; const int CMsgGCClientMarketDataEntry::kPriceInLocalCurrencyFieldNumber; #endif // !_MSC_VER CMsgGCClientMarketDataEntry::CMsgGCClientMarketDataEntry() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCClientMarketDataEntry) } void CMsgGCClientMarketDataEntry::InitAsDefaultInstance() { } CMsgGCClientMarketDataEntry::CMsgGCClientMarketDataEntry(const CMsgGCClientMarketDataEntry& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCClientMarketDataEntry) } void CMsgGCClientMarketDataEntry::SharedCtor() { _cached_size_ = 0; item_def_index_ = 0u; item_quality_ = 0u; item_sell_listings_ = 0u; price_in_local_currency_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCClientMarketDataEntry::~CMsgGCClientMarketDataEntry() { // @@protoc_insertion_point(destructor:CMsgGCClientMarketDataEntry) SharedDtor(); } void CMsgGCClientMarketDataEntry::SharedDtor() { if (this != default_instance_) { } } void CMsgGCClientMarketDataEntry::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCClientMarketDataEntry::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCClientMarketDataEntry_descriptor_; } const CMsgGCClientMarketDataEntry& CMsgGCClientMarketDataEntry::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCClientMarketDataEntry* CMsgGCClientMarketDataEntry::default_instance_ = NULL; CMsgGCClientMarketDataEntry* CMsgGCClientMarketDataEntry::New() const { return new CMsgGCClientMarketDataEntry; } void CMsgGCClientMarketDataEntry::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgGCClientMarketDataEntry*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(item_def_index_, price_in_local_currency_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCClientMarketDataEntry::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCClientMarketDataEntry) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 item_def_index = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &item_def_index_))); set_has_item_def_index(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_item_quality; break; } // optional uint32 item_quality = 2; case 2: { if (tag == 16) { parse_item_quality: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &item_quality_))); set_has_item_quality(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_item_sell_listings; break; } // optional uint32 item_sell_listings = 3; case 3: { if (tag == 24) { parse_item_sell_listings: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &item_sell_listings_))); set_has_item_sell_listings(); } else { goto handle_unusual; } if (input->ExpectTag(32)) goto parse_price_in_local_currency; break; } // optional uint32 price_in_local_currency = 4; case 4: { if (tag == 32) { parse_price_in_local_currency: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &price_in_local_currency_))); set_has_price_in_local_currency(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCClientMarketDataEntry) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCClientMarketDataEntry) return false; #undef DO_ } void CMsgGCClientMarketDataEntry::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCClientMarketDataEntry) // optional uint32 item_def_index = 1; if (has_item_def_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->item_def_index(), output); } // optional uint32 item_quality = 2; if (has_item_quality()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->item_quality(), output); } // optional uint32 item_sell_listings = 3; if (has_item_sell_listings()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->item_sell_listings(), output); } // optional uint32 price_in_local_currency = 4; if (has_price_in_local_currency()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->price_in_local_currency(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCClientMarketDataEntry) } ::google::protobuf::uint8* CMsgGCClientMarketDataEntry::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCClientMarketDataEntry) // optional uint32 item_def_index = 1; if (has_item_def_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->item_def_index(), target); } // optional uint32 item_quality = 2; if (has_item_quality()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->item_quality(), target); } // optional uint32 item_sell_listings = 3; if (has_item_sell_listings()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->item_sell_listings(), target); } // optional uint32 price_in_local_currency = 4; if (has_price_in_local_currency()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->price_in_local_currency(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCClientMarketDataEntry) return target; } int CMsgGCClientMarketDataEntry::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint32 item_def_index = 1; if (has_item_def_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->item_def_index()); } // optional uint32 item_quality = 2; if (has_item_quality()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->item_quality()); } // optional uint32 item_sell_listings = 3; if (has_item_sell_listings()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->item_sell_listings()); } // optional uint32 price_in_local_currency = 4; if (has_price_in_local_currency()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->price_in_local_currency()); } } 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; } void CMsgGCClientMarketDataEntry::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCClientMarketDataEntry* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCClientMarketDataEntry*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCClientMarketDataEntry::MergeFrom(const CMsgGCClientMarketDataEntry& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_def_index()) { set_item_def_index(from.item_def_index()); } if (from.has_item_quality()) { set_item_quality(from.item_quality()); } if (from.has_item_sell_listings()) { set_item_sell_listings(from.item_sell_listings()); } if (from.has_price_in_local_currency()) { set_price_in_local_currency(from.price_in_local_currency()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCClientMarketDataEntry::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCClientMarketDataEntry::CopyFrom(const CMsgGCClientMarketDataEntry& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCClientMarketDataEntry::IsInitialized() const { return true; } void CMsgGCClientMarketDataEntry::Swap(CMsgGCClientMarketDataEntry* other) { if (other != this) { std::swap(item_def_index_, other->item_def_index_); std::swap(item_quality_, other->item_quality_); std::swap(item_sell_listings_, other->item_sell_listings_); std::swap(price_in_local_currency_, other->price_in_local_currency_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCClientMarketDataEntry::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCClientMarketDataEntry_descriptor_; metadata.reflection = CMsgGCClientMarketDataEntry_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgGCClientMarketData::kEntriesFieldNumber; #endif // !_MSC_VER CMsgGCClientMarketData::CMsgGCClientMarketData() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgGCClientMarketData) } void CMsgGCClientMarketData::InitAsDefaultInstance() { } CMsgGCClientMarketData::CMsgGCClientMarketData(const CMsgGCClientMarketData& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgGCClientMarketData) } void CMsgGCClientMarketData::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgGCClientMarketData::~CMsgGCClientMarketData() { // @@protoc_insertion_point(destructor:CMsgGCClientMarketData) SharedDtor(); } void CMsgGCClientMarketData::SharedDtor() { if (this != default_instance_) { } } void CMsgGCClientMarketData::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgGCClientMarketData::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgGCClientMarketData_descriptor_; } const CMsgGCClientMarketData& CMsgGCClientMarketData::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgGCClientMarketData* CMsgGCClientMarketData::default_instance_ = NULL; CMsgGCClientMarketData* CMsgGCClientMarketData::New() const { return new CMsgGCClientMarketData; } void CMsgGCClientMarketData::Clear() { entries_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgGCClientMarketData::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgGCClientMarketData) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .CMsgGCClientMarketDataEntry entries = 1; case 1: { if (tag == 10) { parse_entries: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_entries())); } else { goto handle_unusual; } if (input->ExpectTag(10)) goto parse_entries; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgGCClientMarketData) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgGCClientMarketData) return false; #undef DO_ } void CMsgGCClientMarketData::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgGCClientMarketData) // repeated .CMsgGCClientMarketDataEntry entries = 1; for (int i = 0; i < this->entries_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1, this->entries(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgGCClientMarketData) } ::google::protobuf::uint8* CMsgGCClientMarketData::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgGCClientMarketData) // repeated .CMsgGCClientMarketDataEntry entries = 1; for (int i = 0; i < this->entries_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 1, this->entries(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgGCClientMarketData) return target; } int CMsgGCClientMarketData::ByteSize() const { int total_size = 0; // repeated .CMsgGCClientMarketDataEntry entries = 1; total_size += 1 * this->entries_size(); for (int i = 0; i < this->entries_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->entries(i)); } 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; } void CMsgGCClientMarketData::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgGCClientMarketData* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgGCClientMarketData*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgGCClientMarketData::MergeFrom(const CMsgGCClientMarketData& from) { GOOGLE_CHECK_NE(&from, this); entries_.MergeFrom(from.entries_); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgGCClientMarketData::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgGCClientMarketData::CopyFrom(const CMsgGCClientMarketData& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgGCClientMarketData::IsInitialized() const { return true; } void CMsgGCClientMarketData::Swap(CMsgGCClientMarketData* other) { if (other != this) { entries_.Swap(&other->entries_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgGCClientMarketData::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgGCClientMarketData_descriptor_; metadata.reflection = CMsgGCClientMarketData_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgExtractGems::kToolItemIdFieldNumber; const int CMsgExtractGems::kItemItemIdFieldNumber; const int CMsgExtractGems::kItemSocketIdFieldNumber; #endif // !_MSC_VER CMsgExtractGems::CMsgExtractGems() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgExtractGems) } void CMsgExtractGems::InitAsDefaultInstance() { } CMsgExtractGems::CMsgExtractGems(const CMsgExtractGems& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgExtractGems) } void CMsgExtractGems::SharedCtor() { _cached_size_ = 0; tool_item_id_ = GOOGLE_ULONGLONG(0); item_item_id_ = GOOGLE_ULONGLONG(0); item_socket_id_ = 65535u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgExtractGems::~CMsgExtractGems() { // @@protoc_insertion_point(destructor:CMsgExtractGems) SharedDtor(); } void CMsgExtractGems::SharedDtor() { if (this != default_instance_) { } } void CMsgExtractGems::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgExtractGems::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgExtractGems_descriptor_; } const CMsgExtractGems& CMsgExtractGems::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgExtractGems* CMsgExtractGems::default_instance_ = NULL; CMsgExtractGems* CMsgExtractGems::New() const { return new CMsgExtractGems; } void CMsgExtractGems::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgExtractGems*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) if (_has_bits_[0 / 32] & 7) { ZR_(tool_item_id_, item_item_id_); item_socket_id_ = 65535u; } #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgExtractGems::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgExtractGems) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 tool_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &tool_item_id_))); set_has_tool_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_item_item_id; break; } // optional uint64 item_item_id = 2; case 2: { if (tag == 16) { parse_item_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_item_id_))); set_has_item_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_item_socket_id; break; } // optional uint32 item_socket_id = 3 [default = 65535]; case 3: { if (tag == 24) { parse_item_socket_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &item_socket_id_))); set_has_item_socket_id(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgExtractGems) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgExtractGems) return false; #undef DO_ } void CMsgExtractGems::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgExtractGems) // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->tool_item_id(), output); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->item_item_id(), output); } // optional uint32 item_socket_id = 3 [default = 65535]; if (has_item_socket_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->item_socket_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgExtractGems) } ::google::protobuf::uint8* CMsgExtractGems::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgExtractGems) // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->tool_item_id(), target); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->item_item_id(), target); } // optional uint32 item_socket_id = 3 [default = 65535]; if (has_item_socket_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->item_socket_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgExtractGems) return target; } int CMsgExtractGems::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->tool_item_id()); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_item_id()); } // optional uint32 item_socket_id = 3 [default = 65535]; if (has_item_socket_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->item_socket_id()); } } 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; } void CMsgExtractGems::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgExtractGems* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgExtractGems*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgExtractGems::MergeFrom(const CMsgExtractGems& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_tool_item_id()) { set_tool_item_id(from.tool_item_id()); } if (from.has_item_item_id()) { set_item_item_id(from.item_item_id()); } if (from.has_item_socket_id()) { set_item_socket_id(from.item_socket_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgExtractGems::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgExtractGems::CopyFrom(const CMsgExtractGems& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgExtractGems::IsInitialized() const { return true; } void CMsgExtractGems::Swap(CMsgExtractGems* other) { if (other != this) { std::swap(tool_item_id_, other->tool_item_id_); std::swap(item_item_id_, other->item_item_id_); std::swap(item_socket_id_, other->item_socket_id_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgExtractGems::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgExtractGems_descriptor_; metadata.reflection = CMsgExtractGems_reflection_; return metadata; } // =================================================================== const ::google::protobuf::EnumDescriptor* CMsgExtractGemsResponse_EExtractGems_descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgExtractGemsResponse_EExtractGems_descriptor_; } bool CMsgExtractGemsResponse_EExtractGems_IsValid(int value) { switch(value) { case 0: case 1: case 2: case 3: case 4: return true; default: return false; } } #ifndef _MSC_VER const CMsgExtractGemsResponse_EExtractGems CMsgExtractGemsResponse::k_ExtractGems_Succeeded; const CMsgExtractGemsResponse_EExtractGems CMsgExtractGemsResponse::k_ExtractGems_Failed_ToolIsInvalid; const CMsgExtractGemsResponse_EExtractGems CMsgExtractGemsResponse::k_ExtractGems_Failed_ItemIsInvalid; const CMsgExtractGemsResponse_EExtractGems CMsgExtractGemsResponse::k_ExtractGems_Failed_ToolCannotRemoveGem; const CMsgExtractGemsResponse_EExtractGems CMsgExtractGemsResponse::k_ExtractGems_Failed_FailedToRemoveGem; const CMsgExtractGemsResponse_EExtractGems CMsgExtractGemsResponse::EExtractGems_MIN; const CMsgExtractGemsResponse_EExtractGems CMsgExtractGemsResponse::EExtractGems_MAX; const int CMsgExtractGemsResponse::EExtractGems_ARRAYSIZE; #endif // _MSC_VER #ifndef _MSC_VER const int CMsgExtractGemsResponse::kItemIdFieldNumber; const int CMsgExtractGemsResponse::kResponseFieldNumber; #endif // !_MSC_VER CMsgExtractGemsResponse::CMsgExtractGemsResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgExtractGemsResponse) } void CMsgExtractGemsResponse::InitAsDefaultInstance() { } CMsgExtractGemsResponse::CMsgExtractGemsResponse(const CMsgExtractGemsResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgExtractGemsResponse) } void CMsgExtractGemsResponse::SharedCtor() { _cached_size_ = 0; item_id_ = GOOGLE_ULONGLONG(0); response_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgExtractGemsResponse::~CMsgExtractGemsResponse() { // @@protoc_insertion_point(destructor:CMsgExtractGemsResponse) SharedDtor(); } void CMsgExtractGemsResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgExtractGemsResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgExtractGemsResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgExtractGemsResponse_descriptor_; } const CMsgExtractGemsResponse& CMsgExtractGemsResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgExtractGemsResponse* CMsgExtractGemsResponse::default_instance_ = NULL; CMsgExtractGemsResponse* CMsgExtractGemsResponse::New() const { return new CMsgExtractGemsResponse; } void CMsgExtractGemsResponse::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgExtractGemsResponse*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(item_id_, response_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgExtractGemsResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgExtractGemsResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_id_))); set_has_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_response; break; } // optional .CMsgExtractGemsResponse.EExtractGems response = 2 [default = k_ExtractGems_Succeeded]; case 2: { if (tag == 16) { parse_response: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::CMsgExtractGemsResponse_EExtractGems_IsValid(value)) { set_response(static_cast< ::CMsgExtractGemsResponse_EExtractGems >(value)); } else { mutable_unknown_fields()->AddVarint(2, value); } } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgExtractGemsResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgExtractGemsResponse) return false; #undef DO_ } void CMsgExtractGemsResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgExtractGemsResponse) // optional uint64 item_id = 1; if (has_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->item_id(), output); } // optional .CMsgExtractGemsResponse.EExtractGems response = 2 [default = k_ExtractGems_Succeeded]; if (has_response()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 2, this->response(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgExtractGemsResponse) } ::google::protobuf::uint8* CMsgExtractGemsResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgExtractGemsResponse) // optional uint64 item_id = 1; if (has_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->item_id(), target); } // optional .CMsgExtractGemsResponse.EExtractGems response = 2 [default = k_ExtractGems_Succeeded]; if (has_response()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 2, this->response(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgExtractGemsResponse) return target; } int CMsgExtractGemsResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 item_id = 1; if (has_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_id()); } // optional .CMsgExtractGemsResponse.EExtractGems response = 2 [default = k_ExtractGems_Succeeded]; if (has_response()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->response()); } } 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; } void CMsgExtractGemsResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgExtractGemsResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgExtractGemsResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgExtractGemsResponse::MergeFrom(const CMsgExtractGemsResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_id()) { set_item_id(from.item_id()); } if (from.has_response()) { set_response(from.response()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgExtractGemsResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgExtractGemsResponse::CopyFrom(const CMsgExtractGemsResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgExtractGemsResponse::IsInitialized() const { return true; } void CMsgExtractGemsResponse::Swap(CMsgExtractGemsResponse* other) { if (other != this) { std::swap(item_id_, other->item_id_); std::swap(response_, other->response_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgExtractGemsResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgExtractGemsResponse_descriptor_; metadata.reflection = CMsgExtractGemsResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgAddSocket::kToolItemIdFieldNumber; const int CMsgAddSocket::kItemItemIdFieldNumber; const int CMsgAddSocket::kUnusualFieldNumber; #endif // !_MSC_VER CMsgAddSocket::CMsgAddSocket() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgAddSocket) } void CMsgAddSocket::InitAsDefaultInstance() { } CMsgAddSocket::CMsgAddSocket(const CMsgAddSocket& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgAddSocket) } void CMsgAddSocket::SharedCtor() { _cached_size_ = 0; tool_item_id_ = GOOGLE_ULONGLONG(0); item_item_id_ = GOOGLE_ULONGLONG(0); unusual_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgAddSocket::~CMsgAddSocket() { // @@protoc_insertion_point(destructor:CMsgAddSocket) SharedDtor(); } void CMsgAddSocket::SharedDtor() { if (this != default_instance_) { } } void CMsgAddSocket::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgAddSocket::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgAddSocket_descriptor_; } const CMsgAddSocket& CMsgAddSocket::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgAddSocket* CMsgAddSocket::default_instance_ = NULL; CMsgAddSocket* CMsgAddSocket::New() const { return new CMsgAddSocket; } void CMsgAddSocket::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgAddSocket*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(tool_item_id_, unusual_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgAddSocket::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgAddSocket) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 tool_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &tool_item_id_))); set_has_tool_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_item_item_id; break; } // optional uint64 item_item_id = 2; case 2: { if (tag == 16) { parse_item_item_id: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_item_id_))); set_has_item_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(24)) goto parse_unusual; break; } // optional bool unusual = 3; case 3: { if (tag == 24) { parse_unusual: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &unusual_))); set_has_unusual(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgAddSocket) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgAddSocket) return false; #undef DO_ } void CMsgAddSocket::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgAddSocket) // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->tool_item_id(), output); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->item_item_id(), output); } // optional bool unusual = 3; if (has_unusual()) { ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->unusual(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgAddSocket) } ::google::protobuf::uint8* CMsgAddSocket::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgAddSocket) // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->tool_item_id(), target); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->item_item_id(), target); } // optional bool unusual = 3; if (has_unusual()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->unusual(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgAddSocket) return target; } int CMsgAddSocket::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 tool_item_id = 1; if (has_tool_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->tool_item_id()); } // optional uint64 item_item_id = 2; if (has_item_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_item_id()); } // optional bool unusual = 3; if (has_unusual()) { total_size += 1 + 1; } } 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; } void CMsgAddSocket::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgAddSocket* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgAddSocket*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgAddSocket::MergeFrom(const CMsgAddSocket& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_tool_item_id()) { set_tool_item_id(from.tool_item_id()); } if (from.has_item_item_id()) { set_item_item_id(from.item_item_id()); } if (from.has_unusual()) { set_unusual(from.unusual()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgAddSocket::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgAddSocket::CopyFrom(const CMsgAddSocket& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgAddSocket::IsInitialized() const { return true; } void CMsgAddSocket::Swap(CMsgAddSocket* other) { if (other != this) { std::swap(tool_item_id_, other->tool_item_id_); std::swap(item_item_id_, other->item_item_id_); std::swap(unusual_, other->unusual_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgAddSocket::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgAddSocket_descriptor_; metadata.reflection = CMsgAddSocket_reflection_; return metadata; } // =================================================================== const ::google::protobuf::EnumDescriptor* CMsgAddSocketResponse_EAddSocket_descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgAddSocketResponse_EAddSocket_descriptor_; } bool CMsgAddSocketResponse_EAddSocket_IsValid(int value) { switch(value) { case 0: case 1: case 2: case 3: return true; default: return false; } } #ifndef _MSC_VER const CMsgAddSocketResponse_EAddSocket CMsgAddSocketResponse::k_AddSocket_Succeeded; const CMsgAddSocketResponse_EAddSocket CMsgAddSocketResponse::k_AddSocket_Failed_ToolIsInvalid; const CMsgAddSocketResponse_EAddSocket CMsgAddSocketResponse::k_AddSocket_Failed_ItemCannotBeSocketed; const CMsgAddSocketResponse_EAddSocket CMsgAddSocketResponse::k_AddSocket_Failed_FailedToAddSocket; const CMsgAddSocketResponse_EAddSocket CMsgAddSocketResponse::EAddSocket_MIN; const CMsgAddSocketResponse_EAddSocket CMsgAddSocketResponse::EAddSocket_MAX; const int CMsgAddSocketResponse::EAddSocket_ARRAYSIZE; #endif // _MSC_VER #ifndef _MSC_VER const int CMsgAddSocketResponse::kItemIdFieldNumber; const int CMsgAddSocketResponse::kUpdatedSocketIndexFieldNumber; const int CMsgAddSocketResponse::kResponseFieldNumber; #endif // !_MSC_VER CMsgAddSocketResponse::CMsgAddSocketResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgAddSocketResponse) } void CMsgAddSocketResponse::InitAsDefaultInstance() { } CMsgAddSocketResponse::CMsgAddSocketResponse(const CMsgAddSocketResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgAddSocketResponse) } void CMsgAddSocketResponse::SharedCtor() { _cached_size_ = 0; item_id_ = GOOGLE_ULONGLONG(0); response_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgAddSocketResponse::~CMsgAddSocketResponse() { // @@protoc_insertion_point(destructor:CMsgAddSocketResponse) SharedDtor(); } void CMsgAddSocketResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgAddSocketResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgAddSocketResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgAddSocketResponse_descriptor_; } const CMsgAddSocketResponse& CMsgAddSocketResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgAddSocketResponse* CMsgAddSocketResponse::default_instance_ = NULL; CMsgAddSocketResponse* CMsgAddSocketResponse::New() const { return new CMsgAddSocketResponse; } void CMsgAddSocketResponse::Clear() { if (_has_bits_[0 / 32] & 5) { item_id_ = GOOGLE_ULONGLONG(0); response_ = 0; } updated_socket_index_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgAddSocketResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgAddSocketResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_id_))); set_has_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_updated_socket_index; break; } // repeated uint32 updated_socket_index = 2; case 2: { if (tag == 16) { parse_updated_socket_index: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1, 16, input, this->mutable_updated_socket_index()))); } else if (tag == 18) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, this->mutable_updated_socket_index()))); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_updated_socket_index; if (input->ExpectTag(24)) goto parse_response; break; } // optional .CMsgAddSocketResponse.EAddSocket response = 3 [default = k_AddSocket_Succeeded]; case 3: { if (tag == 24) { parse_response: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::CMsgAddSocketResponse_EAddSocket_IsValid(value)) { set_response(static_cast< ::CMsgAddSocketResponse_EAddSocket >(value)); } else { mutable_unknown_fields()->AddVarint(3, value); } } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgAddSocketResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgAddSocketResponse) return false; #undef DO_ } void CMsgAddSocketResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgAddSocketResponse) // optional uint64 item_id = 1; if (has_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->item_id(), output); } // repeated uint32 updated_socket_index = 2; for (int i = 0; i < this->updated_socket_index_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt32( 2, this->updated_socket_index(i), output); } // optional .CMsgAddSocketResponse.EAddSocket response = 3 [default = k_AddSocket_Succeeded]; if (has_response()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 3, this->response(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgAddSocketResponse) } ::google::protobuf::uint8* CMsgAddSocketResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgAddSocketResponse) // optional uint64 item_id = 1; if (has_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->item_id(), target); } // repeated uint32 updated_socket_index = 2; for (int i = 0; i < this->updated_socket_index_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt32ToArray(2, this->updated_socket_index(i), target); } // optional .CMsgAddSocketResponse.EAddSocket response = 3 [default = k_AddSocket_Succeeded]; if (has_response()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 3, this->response(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgAddSocketResponse) return target; } int CMsgAddSocketResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 item_id = 1; if (has_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_id()); } // optional .CMsgAddSocketResponse.EAddSocket response = 3 [default = k_AddSocket_Succeeded]; if (has_response()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->response()); } } // repeated uint32 updated_socket_index = 2; { int data_size = 0; for (int i = 0; i < this->updated_socket_index_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt32Size(this->updated_socket_index(i)); } total_size += 1 * this->updated_socket_index_size() + data_size; } 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; } void CMsgAddSocketResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgAddSocketResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgAddSocketResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgAddSocketResponse::MergeFrom(const CMsgAddSocketResponse& from) { GOOGLE_CHECK_NE(&from, this); updated_socket_index_.MergeFrom(from.updated_socket_index_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_id()) { set_item_id(from.item_id()); } if (from.has_response()) { set_response(from.response()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgAddSocketResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgAddSocketResponse::CopyFrom(const CMsgAddSocketResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgAddSocketResponse::IsInitialized() const { return true; } void CMsgAddSocketResponse::Swap(CMsgAddSocketResponse* other) { if (other != this) { std::swap(item_id_, other->item_id_); updated_socket_index_.Swap(&other->updated_socket_index_); std::swap(response_, other->response_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgAddSocketResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgAddSocketResponse_descriptor_; metadata.reflection = CMsgAddSocketResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgAddItemToSocketData::kGemItemIdFieldNumber; const int CMsgAddItemToSocketData::kSocketIndexFieldNumber; #endif // !_MSC_VER CMsgAddItemToSocketData::CMsgAddItemToSocketData() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgAddItemToSocketData) } void CMsgAddItemToSocketData::InitAsDefaultInstance() { } CMsgAddItemToSocketData::CMsgAddItemToSocketData(const CMsgAddItemToSocketData& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgAddItemToSocketData) } void CMsgAddItemToSocketData::SharedCtor() { _cached_size_ = 0; gem_item_id_ = GOOGLE_ULONGLONG(0); socket_index_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgAddItemToSocketData::~CMsgAddItemToSocketData() { // @@protoc_insertion_point(destructor:CMsgAddItemToSocketData) SharedDtor(); } void CMsgAddItemToSocketData::SharedDtor() { if (this != default_instance_) { } } void CMsgAddItemToSocketData::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgAddItemToSocketData::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgAddItemToSocketData_descriptor_; } const CMsgAddItemToSocketData& CMsgAddItemToSocketData::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgAddItemToSocketData* CMsgAddItemToSocketData::default_instance_ = NULL; CMsgAddItemToSocketData* CMsgAddItemToSocketData::New() const { return new CMsgAddItemToSocketData; } void CMsgAddItemToSocketData::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgAddItemToSocketData*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(gem_item_id_, socket_index_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgAddItemToSocketData::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgAddItemToSocketData) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 gem_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &gem_item_id_))); set_has_gem_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_socket_index; break; } // optional uint32 socket_index = 2; case 2: { if (tag == 16) { parse_socket_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &socket_index_))); set_has_socket_index(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgAddItemToSocketData) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgAddItemToSocketData) return false; #undef DO_ } void CMsgAddItemToSocketData::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgAddItemToSocketData) // optional uint64 gem_item_id = 1; if (has_gem_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->gem_item_id(), output); } // optional uint32 socket_index = 2; if (has_socket_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->socket_index(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgAddItemToSocketData) } ::google::protobuf::uint8* CMsgAddItemToSocketData::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgAddItemToSocketData) // optional uint64 gem_item_id = 1; if (has_gem_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->gem_item_id(), target); } // optional uint32 socket_index = 2; if (has_socket_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->socket_index(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgAddItemToSocketData) return target; } int CMsgAddItemToSocketData::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 gem_item_id = 1; if (has_gem_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->gem_item_id()); } // optional uint32 socket_index = 2; if (has_socket_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->socket_index()); } } 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; } void CMsgAddItemToSocketData::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgAddItemToSocketData* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgAddItemToSocketData*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgAddItemToSocketData::MergeFrom(const CMsgAddItemToSocketData& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_gem_item_id()) { set_gem_item_id(from.gem_item_id()); } if (from.has_socket_index()) { set_socket_index(from.socket_index()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgAddItemToSocketData::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgAddItemToSocketData::CopyFrom(const CMsgAddItemToSocketData& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgAddItemToSocketData::IsInitialized() const { return true; } void CMsgAddItemToSocketData::Swap(CMsgAddItemToSocketData* other) { if (other != this) { std::swap(gem_item_id_, other->gem_item_id_); std::swap(socket_index_, other->socket_index_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgAddItemToSocketData::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgAddItemToSocketData_descriptor_; metadata.reflection = CMsgAddItemToSocketData_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgAddItemToSocket::kItemItemIdFieldNumber; const int CMsgAddItemToSocket::kGemsToSocketFieldNumber; #endif // !_MSC_VER CMsgAddItemToSocket::CMsgAddItemToSocket() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgAddItemToSocket) } void CMsgAddItemToSocket::InitAsDefaultInstance() { } CMsgAddItemToSocket::CMsgAddItemToSocket(const CMsgAddItemToSocket& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgAddItemToSocket) } void CMsgAddItemToSocket::SharedCtor() { _cached_size_ = 0; item_item_id_ = GOOGLE_ULONGLONG(0); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgAddItemToSocket::~CMsgAddItemToSocket() { // @@protoc_insertion_point(destructor:CMsgAddItemToSocket) SharedDtor(); } void CMsgAddItemToSocket::SharedDtor() { if (this != default_instance_) { } } void CMsgAddItemToSocket::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgAddItemToSocket::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgAddItemToSocket_descriptor_; } const CMsgAddItemToSocket& CMsgAddItemToSocket::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgAddItemToSocket* CMsgAddItemToSocket::default_instance_ = NULL; CMsgAddItemToSocket* CMsgAddItemToSocket::New() const { return new CMsgAddItemToSocket; } void CMsgAddItemToSocket::Clear() { item_item_id_ = GOOGLE_ULONGLONG(0); gems_to_socket_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgAddItemToSocket::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgAddItemToSocket) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 item_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_item_id_))); set_has_item_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_gems_to_socket; break; } // repeated .CMsgAddItemToSocketData gems_to_socket = 2; case 2: { if (tag == 18) { parse_gems_to_socket: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_gems_to_socket())); } else { goto handle_unusual; } if (input->ExpectTag(18)) goto parse_gems_to_socket; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgAddItemToSocket) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgAddItemToSocket) return false; #undef DO_ } void CMsgAddItemToSocket::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgAddItemToSocket) // optional uint64 item_item_id = 1; if (has_item_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->item_item_id(), output); } // repeated .CMsgAddItemToSocketData gems_to_socket = 2; for (int i = 0; i < this->gems_to_socket_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2, this->gems_to_socket(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgAddItemToSocket) } ::google::protobuf::uint8* CMsgAddItemToSocket::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgAddItemToSocket) // optional uint64 item_item_id = 1; if (has_item_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->item_item_id(), target); } // repeated .CMsgAddItemToSocketData gems_to_socket = 2; for (int i = 0; i < this->gems_to_socket_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 2, this->gems_to_socket(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgAddItemToSocket) return target; } int CMsgAddItemToSocket::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 item_item_id = 1; if (has_item_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_item_id()); } } // repeated .CMsgAddItemToSocketData gems_to_socket = 2; total_size += 1 * this->gems_to_socket_size(); for (int i = 0; i < this->gems_to_socket_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->gems_to_socket(i)); } 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; } void CMsgAddItemToSocket::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgAddItemToSocket* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgAddItemToSocket*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgAddItemToSocket::MergeFrom(const CMsgAddItemToSocket& from) { GOOGLE_CHECK_NE(&from, this); gems_to_socket_.MergeFrom(from.gems_to_socket_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_item_id()) { set_item_item_id(from.item_item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgAddItemToSocket::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgAddItemToSocket::CopyFrom(const CMsgAddItemToSocket& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgAddItemToSocket::IsInitialized() const { return true; } void CMsgAddItemToSocket::Swap(CMsgAddItemToSocket* other) { if (other != this) { std::swap(item_item_id_, other->item_item_id_); gems_to_socket_.Swap(&other->gems_to_socket_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgAddItemToSocket::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgAddItemToSocket_descriptor_; metadata.reflection = CMsgAddItemToSocket_reflection_; return metadata; } // =================================================================== const ::google::protobuf::EnumDescriptor* CMsgAddItemToSocketResponse_EAddGem_descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgAddItemToSocketResponse_EAddGem_descriptor_; } bool CMsgAddItemToSocketResponse_EAddGem_IsValid(int value) { switch(value) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: return true; default: return false; } } #ifndef _MSC_VER const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::k_AddGem_Succeeded; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::k_AddGem_Failed_GemIsInvalid; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::k_AddGem_Failed_ItemIsInvalid; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::k_AddGem_Failed_FailedToAddGem; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::k_AddGem_Failed_InvalidGemTypeForSocket; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::k_AddGem_Failed_InvalidGemTypeForHero; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::k_AddGem_Failed_InvalidGemTypeForSlot; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::k_AddGem_Failed_SocketContainsUnremovableGem; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::EAddGem_MIN; const CMsgAddItemToSocketResponse_EAddGem CMsgAddItemToSocketResponse::EAddGem_MAX; const int CMsgAddItemToSocketResponse::EAddGem_ARRAYSIZE; #endif // _MSC_VER #ifndef _MSC_VER const int CMsgAddItemToSocketResponse::kItemItemIdFieldNumber; const int CMsgAddItemToSocketResponse::kUpdatedSocketIndexFieldNumber; const int CMsgAddItemToSocketResponse::kResponseFieldNumber; #endif // !_MSC_VER CMsgAddItemToSocketResponse::CMsgAddItemToSocketResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgAddItemToSocketResponse) } void CMsgAddItemToSocketResponse::InitAsDefaultInstance() { } CMsgAddItemToSocketResponse::CMsgAddItemToSocketResponse(const CMsgAddItemToSocketResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgAddItemToSocketResponse) } void CMsgAddItemToSocketResponse::SharedCtor() { _cached_size_ = 0; item_item_id_ = GOOGLE_ULONGLONG(0); response_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgAddItemToSocketResponse::~CMsgAddItemToSocketResponse() { // @@protoc_insertion_point(destructor:CMsgAddItemToSocketResponse) SharedDtor(); } void CMsgAddItemToSocketResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgAddItemToSocketResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgAddItemToSocketResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgAddItemToSocketResponse_descriptor_; } const CMsgAddItemToSocketResponse& CMsgAddItemToSocketResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgAddItemToSocketResponse* CMsgAddItemToSocketResponse::default_instance_ = NULL; CMsgAddItemToSocketResponse* CMsgAddItemToSocketResponse::New() const { return new CMsgAddItemToSocketResponse; } void CMsgAddItemToSocketResponse::Clear() { if (_has_bits_[0 / 32] & 5) { item_item_id_ = GOOGLE_ULONGLONG(0); response_ = 0; } updated_socket_index_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgAddItemToSocketResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgAddItemToSocketResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 item_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_item_id_))); set_has_item_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_updated_socket_index; break; } // repeated uint32 updated_socket_index = 2; case 2: { if (tag == 16) { parse_updated_socket_index: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( 1, 16, input, this->mutable_updated_socket_index()))); } else if (tag == 18) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, this->mutable_updated_socket_index()))); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_updated_socket_index; if (input->ExpectTag(24)) goto parse_response; break; } // optional .CMsgAddItemToSocketResponse.EAddGem response = 3 [default = k_AddGem_Succeeded]; case 3: { if (tag == 24) { parse_response: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::CMsgAddItemToSocketResponse_EAddGem_IsValid(value)) { set_response(static_cast< ::CMsgAddItemToSocketResponse_EAddGem >(value)); } else { mutable_unknown_fields()->AddVarint(3, value); } } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgAddItemToSocketResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgAddItemToSocketResponse) return false; #undef DO_ } void CMsgAddItemToSocketResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgAddItemToSocketResponse) // optional uint64 item_item_id = 1; if (has_item_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->item_item_id(), output); } // repeated uint32 updated_socket_index = 2; for (int i = 0; i < this->updated_socket_index_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteUInt32( 2, this->updated_socket_index(i), output); } // optional .CMsgAddItemToSocketResponse.EAddGem response = 3 [default = k_AddGem_Succeeded]; if (has_response()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 3, this->response(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgAddItemToSocketResponse) } ::google::protobuf::uint8* CMsgAddItemToSocketResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgAddItemToSocketResponse) // optional uint64 item_item_id = 1; if (has_item_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->item_item_id(), target); } // repeated uint32 updated_socket_index = 2; for (int i = 0; i < this->updated_socket_index_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteUInt32ToArray(2, this->updated_socket_index(i), target); } // optional .CMsgAddItemToSocketResponse.EAddGem response = 3 [default = k_AddGem_Succeeded]; if (has_response()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 3, this->response(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgAddItemToSocketResponse) return target; } int CMsgAddItemToSocketResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 item_item_id = 1; if (has_item_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_item_id()); } // optional .CMsgAddItemToSocketResponse.EAddGem response = 3 [default = k_AddGem_Succeeded]; if (has_response()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->response()); } } // repeated uint32 updated_socket_index = 2; { int data_size = 0; for (int i = 0; i < this->updated_socket_index_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: UInt32Size(this->updated_socket_index(i)); } total_size += 1 * this->updated_socket_index_size() + data_size; } 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; } void CMsgAddItemToSocketResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgAddItemToSocketResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgAddItemToSocketResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgAddItemToSocketResponse::MergeFrom(const CMsgAddItemToSocketResponse& from) { GOOGLE_CHECK_NE(&from, this); updated_socket_index_.MergeFrom(from.updated_socket_index_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_item_id()) { set_item_item_id(from.item_item_id()); } if (from.has_response()) { set_response(from.response()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgAddItemToSocketResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgAddItemToSocketResponse::CopyFrom(const CMsgAddItemToSocketResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgAddItemToSocketResponse::IsInitialized() const { return true; } void CMsgAddItemToSocketResponse::Swap(CMsgAddItemToSocketResponse* other) { if (other != this) { std::swap(item_item_id_, other->item_item_id_); updated_socket_index_.Swap(&other->updated_socket_index_); std::swap(response_, other->response_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgAddItemToSocketResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgAddItemToSocketResponse_descriptor_; metadata.reflection = CMsgAddItemToSocketResponse_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CMsgResetStrangeGemCount::kItemItemIdFieldNumber; const int CMsgResetStrangeGemCount::kSocketIndexFieldNumber; #endif // !_MSC_VER CMsgResetStrangeGemCount::CMsgResetStrangeGemCount() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgResetStrangeGemCount) } void CMsgResetStrangeGemCount::InitAsDefaultInstance() { } CMsgResetStrangeGemCount::CMsgResetStrangeGemCount(const CMsgResetStrangeGemCount& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgResetStrangeGemCount) } void CMsgResetStrangeGemCount::SharedCtor() { _cached_size_ = 0; item_item_id_ = GOOGLE_ULONGLONG(0); socket_index_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgResetStrangeGemCount::~CMsgResetStrangeGemCount() { // @@protoc_insertion_point(destructor:CMsgResetStrangeGemCount) SharedDtor(); } void CMsgResetStrangeGemCount::SharedDtor() { if (this != default_instance_) { } } void CMsgResetStrangeGemCount::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgResetStrangeGemCount::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgResetStrangeGemCount_descriptor_; } const CMsgResetStrangeGemCount& CMsgResetStrangeGemCount::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgResetStrangeGemCount* CMsgResetStrangeGemCount::default_instance_ = NULL; CMsgResetStrangeGemCount* CMsgResetStrangeGemCount::New() const { return new CMsgResetStrangeGemCount; } void CMsgResetStrangeGemCount::Clear() { #define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ &reinterpret_cast<CMsgResetStrangeGemCount*>(16)->f) - \ reinterpret_cast<char*>(16)) #define ZR_(first, last) do { \ size_t f = OFFSET_OF_FIELD_(first); \ size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ ::memset(&first, 0, n); \ } while (0) ZR_(item_item_id_, socket_index_); #undef OFFSET_OF_FIELD_ #undef ZR_ ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgResetStrangeGemCount::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgResetStrangeGemCount) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint64 item_item_id = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( input, &item_item_id_))); set_has_item_item_id(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_socket_index; break; } // optional uint32 socket_index = 2; case 2: { if (tag == 16) { parse_socket_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &socket_index_))); set_has_socket_index(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgResetStrangeGemCount) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgResetStrangeGemCount) return false; #undef DO_ } void CMsgResetStrangeGemCount::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgResetStrangeGemCount) // optional uint64 item_item_id = 1; if (has_item_item_id()) { ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->item_item_id(), output); } // optional uint32 socket_index = 2; if (has_socket_index()) { ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->socket_index(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgResetStrangeGemCount) } ::google::protobuf::uint8* CMsgResetStrangeGemCount::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgResetStrangeGemCount) // optional uint64 item_item_id = 1; if (has_item_item_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->item_item_id(), target); } // optional uint32 socket_index = 2; if (has_socket_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->socket_index(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgResetStrangeGemCount) return target; } int CMsgResetStrangeGemCount::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional uint64 item_item_id = 1; if (has_item_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt64Size( this->item_item_id()); } // optional uint32 socket_index = 2; if (has_socket_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::UInt32Size( this->socket_index()); } } 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; } void CMsgResetStrangeGemCount::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgResetStrangeGemCount* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgResetStrangeGemCount*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgResetStrangeGemCount::MergeFrom(const CMsgResetStrangeGemCount& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_item_item_id()) { set_item_item_id(from.item_item_id()); } if (from.has_socket_index()) { set_socket_index(from.socket_index()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgResetStrangeGemCount::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgResetStrangeGemCount::CopyFrom(const CMsgResetStrangeGemCount& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgResetStrangeGemCount::IsInitialized() const { return true; } void CMsgResetStrangeGemCount::Swap(CMsgResetStrangeGemCount* other) { if (other != this) { std::swap(item_item_id_, other->item_item_id_); std::swap(socket_index_, other->socket_index_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgResetStrangeGemCount::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgResetStrangeGemCount_descriptor_; metadata.reflection = CMsgResetStrangeGemCount_reflection_; return metadata; } // =================================================================== const ::google::protobuf::EnumDescriptor* CMsgResetStrangeGemCountResponse_EResetGem_descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgResetStrangeGemCountResponse_EResetGem_descriptor_; } bool CMsgResetStrangeGemCountResponse_EResetGem_IsValid(int value) { switch(value) { case 0: case 1: case 2: case 3: case 4: return true; default: return false; } } #ifndef _MSC_VER const CMsgResetStrangeGemCountResponse_EResetGem CMsgResetStrangeGemCountResponse::k_ResetGem_Succeeded; const CMsgResetStrangeGemCountResponse_EResetGem CMsgResetStrangeGemCountResponse::k_ResetGem_Failed_FailedToResetGem; const CMsgResetStrangeGemCountResponse_EResetGem CMsgResetStrangeGemCountResponse::k_ResetGem_Failed_ItemIsInvalid; const CMsgResetStrangeGemCountResponse_EResetGem CMsgResetStrangeGemCountResponse::k_ResetGem_Failed_InvalidSocketId; const CMsgResetStrangeGemCountResponse_EResetGem CMsgResetStrangeGemCountResponse::k_ResetGem_Failed_SocketCannotBeReset; const CMsgResetStrangeGemCountResponse_EResetGem CMsgResetStrangeGemCountResponse::EResetGem_MIN; const CMsgResetStrangeGemCountResponse_EResetGem CMsgResetStrangeGemCountResponse::EResetGem_MAX; const int CMsgResetStrangeGemCountResponse::EResetGem_ARRAYSIZE; #endif // _MSC_VER #ifndef _MSC_VER const int CMsgResetStrangeGemCountResponse::kResponseFieldNumber; #endif // !_MSC_VER CMsgResetStrangeGemCountResponse::CMsgResetStrangeGemCountResponse() : ::google::protobuf::Message() { SharedCtor(); // @@protoc_insertion_point(constructor:CMsgResetStrangeGemCountResponse) } void CMsgResetStrangeGemCountResponse::InitAsDefaultInstance() { } CMsgResetStrangeGemCountResponse::CMsgResetStrangeGemCountResponse(const CMsgResetStrangeGemCountResponse& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); // @@protoc_insertion_point(copy_constructor:CMsgResetStrangeGemCountResponse) } void CMsgResetStrangeGemCountResponse::SharedCtor() { _cached_size_ = 0; response_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CMsgResetStrangeGemCountResponse::~CMsgResetStrangeGemCountResponse() { // @@protoc_insertion_point(destructor:CMsgResetStrangeGemCountResponse) SharedDtor(); } void CMsgResetStrangeGemCountResponse::SharedDtor() { if (this != default_instance_) { } } void CMsgResetStrangeGemCountResponse::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CMsgResetStrangeGemCountResponse::descriptor() { protobuf_AssignDescriptorsOnce(); return CMsgResetStrangeGemCountResponse_descriptor_; } const CMsgResetStrangeGemCountResponse& CMsgResetStrangeGemCountResponse::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_base_5fgcmessages_2eproto(); return *default_instance_; } CMsgResetStrangeGemCountResponse* CMsgResetStrangeGemCountResponse::default_instance_ = NULL; CMsgResetStrangeGemCountResponse* CMsgResetStrangeGemCountResponse::New() const { return new CMsgResetStrangeGemCountResponse; } void CMsgResetStrangeGemCountResponse::Clear() { response_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CMsgResetStrangeGemCountResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:CMsgResetStrangeGemCountResponse) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional .CMsgResetStrangeGemCountResponse.EResetGem response = 1 [default = k_ResetGem_Succeeded]; case 1: { if (tag == 8) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::CMsgResetStrangeGemCountResponse_EResetGem_IsValid(value)) { set_response(static_cast< ::CMsgResetStrangeGemCountResponse_EResetGem >(value)); } else { mutable_unknown_fields()->AddVarint(1, value); } } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:CMsgResetStrangeGemCountResponse) return true; failure: // @@protoc_insertion_point(parse_failure:CMsgResetStrangeGemCountResponse) return false; #undef DO_ } void CMsgResetStrangeGemCountResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:CMsgResetStrangeGemCountResponse) // optional .CMsgResetStrangeGemCountResponse.EResetGem response = 1 [default = k_ResetGem_Succeeded]; if (has_response()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( 1, this->response(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } // @@protoc_insertion_point(serialize_end:CMsgResetStrangeGemCountResponse) } ::google::protobuf::uint8* CMsgResetStrangeGemCountResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // @@protoc_insertion_point(serialize_to_array_start:CMsgResetStrangeGemCountResponse) // optional .CMsgResetStrangeGemCountResponse.EResetGem response = 1 [default = k_ResetGem_Succeeded]; if (has_response()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 1, this->response(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } // @@protoc_insertion_point(serialize_to_array_end:CMsgResetStrangeGemCountResponse) return target; } int CMsgResetStrangeGemCountResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional .CMsgResetStrangeGemCountResponse.EResetGem response = 1 [default = k_ResetGem_Succeeded]; if (has_response()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize(this->response()); } } 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; } void CMsgResetStrangeGemCountResponse::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CMsgResetStrangeGemCountResponse* source = ::google::protobuf::internal::dynamic_cast_if_available<const CMsgResetStrangeGemCountResponse*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CMsgResetStrangeGemCountResponse::MergeFrom(const CMsgResetStrangeGemCountResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_response()) { set_response(from.response()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CMsgResetStrangeGemCountResponse::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CMsgResetStrangeGemCountResponse::CopyFrom(const CMsgResetStrangeGemCountResponse& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CMsgResetStrangeGemCountResponse::IsInitialized() const { return true; } void CMsgResetStrangeGemCountResponse::Swap(CMsgResetStrangeGemCountResponse* other) { if (other != this) { std::swap(response_, other->response_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata CMsgResetStrangeGemCountResponse::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CMsgResetStrangeGemCountResponse_descriptor_; metadata.reflection = CMsgResetStrangeGemCountResponse_reflection_; return metadata; } // @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(global_scope)
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. // // Copyright (C) 2018 Intel Corporation #ifndef OPENCV_GAPI_CORE_HPP #define OPENCV_GAPI_CORE_HPP #include <math.h> #include <utility> // std::tuple #include <opencv2/imgproc.hpp> #include <opencv2/gapi/gmat.hpp> #include <opencv2/gapi/gscalar.hpp> #include <opencv2/gapi/gkernel.hpp> /** \defgroup gapi_core G-API Core functionality @{ @defgroup gapi_math Graph API: Math operations @defgroup gapi_pixelwise Graph API: Pixelwise operations @defgroup gapi_matrixop Graph API: Operations on matrices @defgroup gapi_transform Graph API: Image and channel composition functions @} */ namespace cv { namespace gapi { namespace core { using GMat2 = std::tuple<GMat,GMat>; using GMat3 = std::tuple<GMat,GMat,GMat>; // FIXME: how to avoid this? using GMat4 = std::tuple<GMat,GMat,GMat,GMat>; using GMatScalar = std::tuple<GMat, GScalar>; G_TYPED_KERNEL(GAdd, <GMat(GMat, GMat, int)>, "org.opencv.core.math.add") { static GMatDesc outMeta(GMatDesc a, GMatDesc b, int ddepth) { if (ddepth == -1) { // OpenCV: When the input arrays in add/subtract/multiply/divide // functions have different depths, the output array depth must be // explicitly specified! // See artim_op() @ arithm.cpp GAPI_Assert(a.chan == b.chan); GAPI_Assert(a.depth == b.depth); return a; } return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GAddC, <GMat(GMat, GScalar, int)>, "org.opencv.core.math.addC") { static GMatDesc outMeta(GMatDesc a, GScalarDesc, int ddepth) { return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GSub, <GMat(GMat, GMat, int)>, "org.opencv.core.math.sub") { static GMatDesc outMeta(GMatDesc a, GMatDesc b, int ddepth) { if (ddepth == -1) { // This macro should select a larger data depth from a and b // considering the number of channels in the same // FIXME!!! Clarify if it is valid for sub() GAPI_Assert(a.chan == b.chan); ddepth = std::max(a.depth, b.depth); } return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GSubC, <GMat(GMat, GScalar, int)>, "org.opencv.core.math.subC") { static GMatDesc outMeta(GMatDesc a, GScalarDesc, int ddepth) { return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GSubRC,<GMat(GScalar, GMat, int)>, "org.opencv.core.math.subRC") { static GMatDesc outMeta(GScalarDesc, GMatDesc b, int ddepth) { return b.withDepth(ddepth); } }; G_TYPED_KERNEL(GMul, <GMat(GMat, GMat, double, int)>, "org.opencv.core.math.mul") { static GMatDesc outMeta(GMatDesc a, GMatDesc, double, int ddepth) { return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GMulCOld, <GMat(GMat, double, int)>, "org.opencv.core.math.mulCOld") { static GMatDesc outMeta(GMatDesc a, double, int ddepth) { return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GMulC, <GMat(GMat, GScalar, int)>, "org.opencv.core.math.mulC"){ static GMatDesc outMeta(GMatDesc a, GScalarDesc, int ddepth) { return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GMulS, <GMat(GMat, GScalar)>, "org.opencv.core.math.muls") { static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a; } }; // FIXME: Merge with MulC G_TYPED_KERNEL(GDiv, <GMat(GMat, GMat, double, int)>, "org.opencv.core.math.div") { static GMatDesc outMeta(GMatDesc a, GMatDesc b, double, int ddepth) { if (ddepth == -1) { GAPI_Assert(a.depth == b.depth); return b; } return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GDivC, <GMat(GMat, GScalar, double, int)>, "org.opencv.core.math.divC") { static GMatDesc outMeta(GMatDesc a, GScalarDesc, double, int ddepth) { return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GDivRC, <GMat(GScalar, GMat, double, int)>, "org.opencv.core.math.divRC") { static GMatDesc outMeta(GScalarDesc, GMatDesc b, double, int ddepth) { return b.withDepth(ddepth); } }; G_TYPED_KERNEL(GMean, <GScalar(GMat)>, "org.opencv.core.math.mean") { static GScalarDesc outMeta(GMatDesc) { return empty_scalar_desc(); } }; G_TYPED_KERNEL_M(GPolarToCart, <GMat2(GMat, GMat, bool)>, "org.opencv.core.math.polarToCart") { static std::tuple<GMatDesc, GMatDesc> outMeta(GMatDesc, GMatDesc a, bool) { return std::make_tuple(a, a); } }; G_TYPED_KERNEL_M(GCartToPolar, <GMat2(GMat, GMat, bool)>, "org.opencv.core.math.cartToPolar") { static std::tuple<GMatDesc, GMatDesc> outMeta(GMatDesc x, GMatDesc, bool) { return std::make_tuple(x, x); } }; G_TYPED_KERNEL(GPhase, <GMat(GMat, GMat, bool)>, "org.opencv.core.math.phase") { static GMatDesc outMeta(const GMatDesc &inx, const GMatDesc &, bool) { return inx; } }; G_TYPED_KERNEL(GMask, <GMat(GMat,GMat)>, "org.opencv.core.pixelwise.mask") { static GMatDesc outMeta(GMatDesc in, GMatDesc) { return in; } }; G_TYPED_KERNEL(GCmpGT, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.compare.cmpGT") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpGE, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.compare.cmpGE") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpLE, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.compare.cmpLE") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpLT, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.compare.cmpLT") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpEQ, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.compare.cmpEQ") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpNE, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.compare.cmpNE") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpGTScalar, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.compare.cmpGTScalar"){ static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpGEScalar, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.compare.cmpGEScalar"){ static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpLEScalar, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.compare.cmpLEScalar"){ static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpLTScalar, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.compare.cmpLTScalar"){ static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpEQScalar, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.compare.cmpEQScalar"){ static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GCmpNEScalar, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.compare.cmpNEScalar"){ static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a.withDepth(CV_8U); } }; G_TYPED_KERNEL(GAnd, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.bitwise_and") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a; } }; G_TYPED_KERNEL(GAndS, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.bitwise_andS") { static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a; } }; G_TYPED_KERNEL(GOr, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.bitwise_or") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a; } }; G_TYPED_KERNEL(GOrS, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.bitwise_orS") { static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a; } }; G_TYPED_KERNEL(GXor, <GMat(GMat, GMat)>, "org.opencv.core.pixelwise.bitwise_xor") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a; } }; G_TYPED_KERNEL(GXorS, <GMat(GMat, GScalar)>, "org.opencv.core.pixelwise.bitwise_xorS") { static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a; } }; G_TYPED_KERNEL(GNot, <GMat(GMat)>, "org.opencv.core.pixelwise.bitwise_not") { static GMatDesc outMeta(GMatDesc a) { return a; } }; G_TYPED_KERNEL(GSelect, <GMat(GMat, GMat, GMat)>, "org.opencv.core.pixelwise.select") { static GMatDesc outMeta(GMatDesc a, GMatDesc, GMatDesc) { return a; } }; G_TYPED_KERNEL(GMin, <GMat(GMat, GMat)>, "org.opencv.core.matrixop.min") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a; } }; G_TYPED_KERNEL(GMax, <GMat(GMat, GMat)>, "org.opencv.core.matrixop.max") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a; } }; G_TYPED_KERNEL(GAbsDiff, <GMat(GMat, GMat)>, "org.opencv.core.matrixop.absdiff") { static GMatDesc outMeta(GMatDesc a, GMatDesc) { return a; } }; G_TYPED_KERNEL(GAbsDiffC, <GMat(GMat, GScalar)>, "org.opencv.core.matrixop.absdiffC") { static GMatDesc outMeta(GMatDesc a, GScalarDesc) { return a; } }; G_TYPED_KERNEL(GSum, <GScalar(GMat)>, "org.opencv.core.matrixop.sum") { static GScalarDesc outMeta(GMatDesc) { return empty_scalar_desc(); } }; G_TYPED_KERNEL(GAddW, <GMat(GMat, double, GMat, double, double, int)>, "org.opencv.core.matrixop.addweighted") { static GMatDesc outMeta(GMatDesc a, double, GMatDesc b, double, double, int ddepth) { if (ddepth == -1) { // OpenCV: When the input arrays in add/subtract/multiply/divide // functions have different depths, the output array depth must be // explicitly specified! // See artim_op() @ arithm.cpp GAPI_Assert(a.chan == b.chan); GAPI_Assert(a.depth == b.depth); return a; } return a.withDepth(ddepth); } }; G_TYPED_KERNEL(GNormL1, <GScalar(GMat)>, "org.opencv.core.matrixop.norml1") { static GScalarDesc outMeta(GMatDesc) { return empty_scalar_desc(); } }; G_TYPED_KERNEL(GNormL2, <GScalar(GMat)>, "org.opencv.core.matrixop.norml2") { static GScalarDesc outMeta(GMatDesc) { return empty_scalar_desc(); } }; G_TYPED_KERNEL(GNormInf, <GScalar(GMat)>, "org.opencv.core.matrixop.norminf") { static GScalarDesc outMeta(GMatDesc) { return empty_scalar_desc(); } }; G_TYPED_KERNEL_M(GIntegral, <GMat2(GMat, int, int)>, "org.opencv.core.matrixop.integral") { static std::tuple<GMatDesc, GMatDesc> outMeta(GMatDesc in, int sd, int sqd) { return std::make_tuple(in.withSizeDelta(1,1).withDepth(sd), in.withSizeDelta(1,1).withDepth(sqd)); } }; G_TYPED_KERNEL(GThreshold, <GMat(GMat, GScalar, GScalar, int)>, "org.opencv.core.matrixop.threshold") { static GMatDesc outMeta(GMatDesc in, GScalarDesc, GScalarDesc, int) { return in; } }; G_TYPED_KERNEL_M(GThresholdOT, <GMatScalar(GMat, GScalar, int)>, "org.opencv.core.matrixop.thresholdOT") { static std::tuple<GMatDesc,GScalarDesc> outMeta(GMatDesc in, GScalarDesc, int) { return std::make_tuple(in, empty_scalar_desc()); } }; G_TYPED_KERNEL(GInRange, <GMat(GMat, GScalar, GScalar)>, "org.opencv.core.matrixop.inrange") { static GMatDesc outMeta(GMatDesc in, GScalarDesc, GScalarDesc) { return in.withType(CV_8U, 1); } }; G_TYPED_KERNEL_M(GSplit3, <GMat3(GMat)>, "org.opencv.core.transform.split3") { static std::tuple<GMatDesc, GMatDesc, GMatDesc> outMeta(GMatDesc in) { const auto out_depth = in.depth; const auto out_desc = in.withType(out_depth, 1); return std::make_tuple(out_desc, out_desc, out_desc); } }; G_TYPED_KERNEL_M(GSplit4, <GMat4(GMat)>,"org.opencv.core.transform.split4") { static std::tuple<GMatDesc, GMatDesc, GMatDesc, GMatDesc> outMeta(GMatDesc in) { const auto out_depth = in.depth; const auto out_desc = in.withType(out_depth, 1); return std::make_tuple(out_desc, out_desc, out_desc, out_desc); } }; G_TYPED_KERNEL(GResize, <GMat(GMat,Size,double,double,int)>, "org.opencv.core.transform.resize") { static GMatDesc outMeta(GMatDesc in, Size sz, double fx, double fy, int) { if (sz.width != 0 && sz.height != 0) { return in.withSize(sz); } else { int outSz_w = static_cast<int>(round(in.size.width * fx)); int outSz_h = static_cast<int>(round(in.size.height * fy)); GAPI_Assert(outSz_w > 0 && outSz_h > 0); return in.withSize(Size(outSz_w, outSz_h)); } } }; G_TYPED_KERNEL(GResizeP, <GMatP(GMatP,Size,int)>, "org.opencv.core.transform.resizeP") { static GMatDesc outMeta(GMatDesc in, Size sz, int interp) { GAPI_Assert(in.depth == CV_8U); GAPI_Assert(in.chan == 3); GAPI_Assert(in.planar); GAPI_Assert(interp == cv::INTER_LINEAR); return in.withSize(sz); } }; G_TYPED_KERNEL(GMerge3, <GMat(GMat,GMat,GMat)>, "org.opencv.core.transform.merge3") { static GMatDesc outMeta(GMatDesc in, GMatDesc, GMatDesc) { // Preserve depth and add channel component return in.withType(in.depth, 3); } }; G_TYPED_KERNEL(GMerge4, <GMat(GMat,GMat,GMat,GMat)>, "org.opencv.core.transform.merge4") { static GMatDesc outMeta(GMatDesc in, GMatDesc, GMatDesc, GMatDesc) { // Preserve depth and add channel component return in.withType(in.depth, 4); } }; G_TYPED_KERNEL(GRemap, <GMat(GMat, Mat, Mat, int, int, Scalar)>, "org.opencv.core.transform.remap") { static GMatDesc outMeta(GMatDesc in, Mat m1, Mat, int, int, Scalar) { return in.withSize(m1.size()); } }; G_TYPED_KERNEL(GFlip, <GMat(GMat, int)>, "org.opencv.core.transform.flip") { static GMatDesc outMeta(GMatDesc in, int) { return in; } }; // TODO: eliminate the need in this kernel (streaming) G_TYPED_KERNEL(GCrop, <GMat(GMat, Rect)>, "org.opencv.core.transform.crop") { static GMatDesc outMeta(GMatDesc in, Rect rc) { return in.withSize(Size(rc.width, rc.height)); } }; G_TYPED_KERNEL(GCopy, <GMat(GMat)>, "org.opencv.core.transform.copy") { static GMatDesc outMeta(GMatDesc in) { return in; } }; G_TYPED_KERNEL(GConcatHor, <GMat(GMat, GMat)>, "org.opencv.imgproc.transform.concatHor") { static GMatDesc outMeta(GMatDesc l, GMatDesc r) { return l.withSizeDelta(+r.size.width, 0); } }; G_TYPED_KERNEL(GConcatVert, <GMat(GMat, GMat)>, "org.opencv.imgproc.transform.concatVert") { static GMatDesc outMeta(GMatDesc t, GMatDesc b) { return t.withSizeDelta(0, +b.size.height); } }; G_TYPED_KERNEL(GLUT, <GMat(GMat, Mat)>, "org.opencv.core.transform.LUT") { static GMatDesc outMeta(GMatDesc in, Mat) { return in; } }; G_TYPED_KERNEL(GConvertTo, <GMat(GMat, int, double, double)>, "org.opencv.core.transform.convertTo") { static GMatDesc outMeta(GMatDesc in, int rdepth, double, double) { return rdepth < 0 ? in : in.withDepth(rdepth); } }; G_TYPED_KERNEL(GSqrt, <GMat(GMat)>, "org.opencv.core.math.sqrt") { static GMatDesc outMeta(GMatDesc in) { return in; } }; G_TYPED_KERNEL(GNormalize, <GMat(GMat, double, double, int, int)>, "org.opencv.core.normalize") { static GMatDesc outMeta(GMatDesc in, double, double, int, int ddepth) { // unlike opencv doesn't have a mask as a parameter return (ddepth < 0 ? in : in.withDepth(ddepth)); } }; G_TYPED_KERNEL(GWarpPerspective, <GMat(GMat, const Mat&, Size, int, int, const cv::Scalar&)>, "org.opencv.core.warpPerspective") { static GMatDesc outMeta(GMatDesc in, const Mat&, Size dsize, int, int borderMode, const cv::Scalar&) { GAPI_Assert((borderMode == cv::BORDER_CONSTANT || borderMode == cv::BORDER_REPLICATE) && "cv::gapi::warpPerspective supports only cv::BORDER_CONSTANT and cv::BORDER_REPLICATE border modes"); return in.withType(in.depth, in.chan).withSize(dsize); } }; G_TYPED_KERNEL(GWarpAffine, <GMat(GMat, const Mat&, Size, int, int, const cv::Scalar&)>, "org.opencv.core.warpAffine") { static GMatDesc outMeta(GMatDesc in, const Mat&, Size dsize, int, int border_mode, const cv::Scalar&) { GAPI_Assert(border_mode != cv::BORDER_TRANSPARENT && "cv::BORDER_TRANSPARENT mode is not supported in cv::gapi::warpAffine"); return in.withType(in.depth, in.chan).withSize(dsize); } }; } //! @addtogroup gapi_math //! @{ /** @brief Calculates the per-element sum of two matrices. The function add calculates sum of two matrices of the same size and the same number of channels: \f[\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) + \texttt{src2}(I)) \quad \texttt{if mask}(I) \ne0\f] The function can be replaced with matrix expressions: \f[\texttt{dst} = \texttt{src1} + \texttt{src2}\f] The input matrices and the output matrix can all have the same or different depths. For example, you can add a 16-bit unsigned matrix to a 8-bit signed matrix and store the sum as a 32-bit floating-point matrix. Depth of the output matrix is determined by the ddepth parameter. If src1.depth() == src2.depth(), ddepth can be set to the default -1. In this case, the output matrix will have the same depth as the input matrices. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.add" @param src1 first input matrix. @param src2 second input matrix. @param ddepth optional depth of the output matrix. @sa sub, addWeighted */ GAPI_EXPORTS_W GMat add(const GMat& src1, const GMat& src2, int ddepth = -1); /** @brief Calculates the per-element sum of matrix and given scalar. The function addC adds a given scalar value to each element of given matrix. The function can be replaced with matrix expressions: \f[\texttt{dst} = \texttt{src1} + \texttt{c}\f] Depth of the output matrix is determined by the ddepth parameter. If ddepth is set to default -1, the depth of output matrix will be the same as the depth of input matrix. The matrices can be single or multi channel. Output matrix must have the same size and number of channels as the input matrix. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.addC" @param src1 first input matrix. @param c scalar value to be added. @param ddepth optional depth of the output matrix. @sa sub, addWeighted */ GAPI_EXPORTS GMat addC(const GMat& src1, const GScalar& c, int ddepth = -1); //! @overload GAPI_EXPORTS GMat addC(const GScalar& c, const GMat& src1, int ddepth = -1); /** @brief Calculates the per-element difference between two matrices. The function sub calculates difference between two matrices, when both matrices have the same size and the same number of channels: \f[\texttt{dst}(I) = \texttt{src1}(I) - \texttt{src2}(I)\f] The function can be replaced with matrix expressions: \f[\texttt{dst} = \texttt{src1} - \texttt{src2}\f] The input matrices and the output matrix can all have the same or different depths. For example, you can subtract two 8-bit unsigned matrices store the result as a 16-bit signed matrix. Depth of the output matrix is determined by the ddepth parameter. If src1.depth() == src2.depth(), ddepth can be set to the default -1. In this case, the output matrix will have the same depth as the input matrices. The matrices can be single or multi channel. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.sub" @param src1 first input matrix. @param src2 second input matrix. @param ddepth optional depth of the output matrix. @sa add, addC */ GAPI_EXPORTS GMat sub(const GMat& src1, const GMat& src2, int ddepth = -1); /** @brief Calculates the per-element difference between matrix and given scalar. The function can be replaced with matrix expressions: \f[\texttt{dst} = \texttt{src} - \texttt{c}\f] Depth of the output matrix is determined by the ddepth parameter. If ddepth is set to default -1, the depth of output matrix will be the same as the depth of input matrix. The matrices can be single or multi channel. Output matrix must have the same size as src. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.subC" @param src first input matrix. @param c scalar value to subtracted. @param ddepth optional depth of the output matrix. @sa add, addC, subRC */ GAPI_EXPORTS GMat subC(const GMat& src, const GScalar& c, int ddepth = -1); /** @brief Calculates the per-element difference between given scalar and the matrix. The function can be replaced with matrix expressions: \f[\texttt{dst} = \texttt{val} - \texttt{src}\f] Depth of the output matrix is determined by the ddepth parameter. If ddepth is set to default -1, the depth of output matrix will be the same as the depth of input matrix. The matrices can be single or multi channel. Output matrix must have the same size as src. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.subRC" @param c scalar value to subtract from. @param src input matrix to be subtracted. @param ddepth optional depth of the output matrix. @sa add, addC, subC */ GAPI_EXPORTS GMat subRC(const GScalar& c, const GMat& src, int ddepth = -1); /** @brief Calculates the per-element scaled product of two matrices. The function mul calculates the per-element product of two matrices: \f[\texttt{dst} (I)= \texttt{saturate} ( \texttt{scale} \cdot \texttt{src1} (I) \cdot \texttt{src2} (I))\f] If src1.depth() == src2.depth(), ddepth can be set to the default -1. In this case, the output matrix will have the same depth as the input matrices. The matrices can be single or multi channel. Output matrix must have the same size as input matrices. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.mul" @param src1 first input matrix. @param src2 second input matrix of the same size and the same depth as src1. @param scale optional scale factor. @param ddepth optional depth of the output matrix. @sa add, sub, div, addWeighted */ GAPI_EXPORTS GMat mul(const GMat& src1, const GMat& src2, double scale = 1.0, int ddepth = -1); /** @brief Multiplies matrix by scalar. The function mulC multiplies each element of matrix src by given scalar value: \f[\texttt{dst} (I)= \texttt{saturate} ( \texttt{src1} (I) \cdot \texttt{multiplier} )\f] The matrices can be single or multi channel. Output matrix must have the same size as src. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.mulC" @param src input matrix. @param multiplier factor to be multiplied. @param ddepth optional depth of the output matrix. If -1, the depth of output matrix will be the same as input matrix depth. @sa add, sub, div, addWeighted */ GAPI_EXPORTS GMat mulC(const GMat& src, double multiplier, int ddepth = -1); //! @overload GAPI_EXPORTS GMat mulC(const GMat& src, const GScalar& multiplier, int ddepth = -1); // FIXME: merge with mulc //! @overload GAPI_EXPORTS GMat mulC(const GScalar& multiplier, const GMat& src, int ddepth = -1); // FIXME: merge with mulc /** @brief Performs per-element division of two matrices. The function divides one matrix by another: \f[\texttt{dst(I) = saturate(src1(I)*scale/src2(I))}\f] When src2(I) is zero, dst(I) will also be zero. Different channels of multi-channel matrices are processed independently. The matrices can be single or multi channel. Output matrix must have the same size and depth as src. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.div" @param src1 first input matrix. @param src2 second input matrix of the same size and depth as src1. @param scale scalar factor. @param ddepth optional depth of the output matrix; you can only pass -1 when src1.depth() == src2.depth(). @sa mul, add, sub */ GAPI_EXPORTS GMat div(const GMat& src1, const GMat& src2, double scale, int ddepth = -1); /** @brief Divides matrix by scalar. The function divC divides each element of matrix src by given scalar value: \f[\texttt{dst(I) = saturate(src(I)*scale/divisor)}\f] When divisor is zero, dst(I) will also be zero. Different channels of multi-channel matrices are processed independently. The matrices can be single or multi channel. Output matrix must have the same size and depth as src. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.divC" @param src input matrix. @param divisor number to be divided by. @param ddepth optional depth of the output matrix. If -1, the depth of output matrix will be the same as input matrix depth. @param scale scale factor. @sa add, sub, div, addWeighted */ GAPI_EXPORTS GMat divC(const GMat& src, const GScalar& divisor, double scale, int ddepth = -1); /** @brief Divides scalar by matrix. The function divRC divides given scalar by each element of matrix src and keep the division result in new matrix of the same size and type as src: \f[\texttt{dst(I) = saturate(divident*scale/src(I))}\f] When src(I) is zero, dst(I) will also be zero. Different channels of multi-channel matrices are processed independently. The matrices can be single or multi channel. Output matrix must have the same size and depth as src. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.divRC" @param src input matrix. @param divident number to be divided. @param ddepth optional depth of the output matrix. If -1, the depth of output matrix will be the same as input matrix depth. @param scale scale factor @sa add, sub, div, addWeighted */ GAPI_EXPORTS GMat divRC(const GScalar& divident, const GMat& src, double scale, int ddepth = -1); /** @brief Applies a mask to a matrix. The function mask set value from given matrix if the corresponding pixel value in mask matrix set to true, and set the matrix value to 0 otherwise. Supported src matrix data types are @ref CV_8UC1, @ref CV_16SC1, @ref CV_16UC1. Supported mask data type is @ref CV_8UC1. @note Function textual ID is "org.opencv.core.math.mask" @param src input matrix. @param mask input mask matrix. */ GAPI_EXPORTS GMat mask(const GMat& src, const GMat& mask); /** @brief Calculates an average (mean) of matrix elements. The function mean calculates the mean value M of matrix elements, independently for each channel, and return it. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.math.mean" @param src input matrix. */ GAPI_EXPORTS GScalar mean(const GMat& src); /** @brief Calculates x and y coordinates of 2D vectors from their magnitude and angle. The function polarToCart calculates the Cartesian coordinates of each 2D vector represented by the corresponding elements of magnitude and angle: \f[\begin{array}{l} \texttt{x} (I) = \texttt{magnitude} (I) \cos ( \texttt{angle} (I)) \\ \texttt{y} (I) = \texttt{magnitude} (I) \sin ( \texttt{angle} (I)) \\ \end{array}\f] The relative accuracy of the estimated coordinates is about 1e-6. First output is a matrix of x-coordinates of 2D vectors. Second output is a matrix of y-coordinates of 2D vectors. Both output must have the same size and depth as input matrices. @note Function textual ID is "org.opencv.core.math.polarToCart" @param magnitude input floating-point @ref CV_32FC1 matrix (1xN) of magnitudes of 2D vectors; @param angle input floating-point @ref CV_32FC1 matrix (1xN) of angles of 2D vectors. @param angleInDegrees when true, the input angles are measured in degrees, otherwise, they are measured in radians. @sa cartToPolar, exp, log, pow, sqrt */ GAPI_EXPORTS std::tuple<GMat, GMat> polarToCart(const GMat& magnitude, const GMat& angle, bool angleInDegrees = false); /** @brief Calculates the magnitude and angle of 2D vectors. The function cartToPolar calculates either the magnitude, angle, or both for every 2D vector (x(I),y(I)): \f[\begin{array}{l} \texttt{magnitude} (I)= \sqrt{\texttt{x}(I)^2+\texttt{y}(I)^2} , \\ \texttt{angle} (I)= \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))[ \cdot180 / \pi ] \end{array}\f] The angles are calculated with accuracy about 0.3 degrees. For the point (0,0), the angle is set to 0. First output is a matrix of magnitudes of the same size and depth as input x. Second output is a matrix of angles that has the same size and depth as x; the angles are measured in radians (from 0 to 2\*Pi) or in degrees (0 to 360 degrees). @note Function textual ID is "org.opencv.core.math.cartToPolar" @param x matrix of @ref CV_32FC1 x-coordinates. @param y array of @ref CV_32FC1 y-coordinates. @param angleInDegrees a flag, indicating whether the angles are measured in radians (which is by default), or in degrees. @sa polarToCart */ GAPI_EXPORTS std::tuple<GMat, GMat> cartToPolar(const GMat& x, const GMat& y, bool angleInDegrees = false); /** @brief Calculates the rotation angle of 2D vectors. The function cv::phase calculates the rotation angle of each 2D vector that is formed from the corresponding elements of x and y : \f[\texttt{angle} (I) = \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))\f] The angle estimation accuracy is about 0.3 degrees. When x(I)=y(I)=0 , the corresponding angle(I) is set to 0. @param x input floating-point array of x-coordinates of 2D vectors. @param y input array of y-coordinates of 2D vectors; it must have the same size and the same type as x. @param angleInDegrees when true, the function calculates the angle in degrees, otherwise, they are measured in radians. @return array of vector angles; it has the same size and same type as x. */ GAPI_EXPORTS GMat phase(const GMat& x, const GMat &y, bool angleInDegrees = false); /** @brief Calculates a square root of array elements. The function cv::gapi::sqrt calculates a square root of each input array element. In case of multi-channel arrays, each channel is processed independently. The accuracy is approximately the same as of the built-in std::sqrt . @param src input floating-point array. @return output array of the same size and type as src. */ GAPI_EXPORTS GMat sqrt(const GMat &src); //! @} gapi_math //! //! @addtogroup gapi_pixelwise //! @{ /** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are greater compare to elements in second. The function compares elements of two matrices src1 and src2 of the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) > \texttt{src2} (I)\f] When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions: \f[\texttt{dst} = \texttt{src1} > \texttt{src2}\f] Output matrix of depth @ref CV_8U must have the same size and the same number of channels as the input matrices/matrix. Supported input matrix data types are @ref CV_8UC1, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpGT" @param src1 first input matrix. @param src2 second input matrix/scalar of the same depth as first input matrix. @sa min, max, threshold, cmpLE, cmpGE, cmpLS */ GAPI_EXPORTS GMat cmpGT(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpGTScalar" */ GAPI_EXPORTS GMat cmpGT(const GMat& src1, const GScalar& src2); /** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are less than elements in second. The function compares elements of two matrices src1 and src2 of the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) < \texttt{src2} (I)\f] When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions: \f[\texttt{dst} = \texttt{src1} < \texttt{src2}\f] Output matrix of depth @ref CV_8U must have the same size and the same number of channels as the input matrices/matrix. Supported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpLT" @param src1 first input matrix. @param src2 second input matrix/scalar of the same depth as first input matrix. @sa min, max, threshold, cmpLE, cmpGE, cmpGT */ GAPI_EXPORTS GMat cmpLT(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpLTScalar" */ GAPI_EXPORTS GMat cmpLT(const GMat& src1, const GScalar& src2); /** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are greater or equal compare to elements in second. The function compares elements of two matrices src1 and src2 of the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) >= \texttt{src2} (I)\f] When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions: \f[\texttt{dst} = \texttt{src1} >= \texttt{src2}\f] Output matrix of depth @ref CV_8U must have the same size and the same number of channels as the input matrices. Supported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpGE" @param src1 first input matrix. @param src2 second input matrix/scalar of the same depth as first input matrix. @sa min, max, threshold, cmpLE, cmpGT, cmpLS */ GAPI_EXPORTS GMat cmpGE(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpLGEcalar" */ GAPI_EXPORTS GMat cmpGE(const GMat& src1, const GScalar& src2); /** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are less or equal compare to elements in second. The function compares elements of two matrices src1 and src2 of the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) <= \texttt{src2} (I)\f] When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions: \f[\texttt{dst} = \texttt{src1} <= \texttt{src2}\f] Output matrix of depth @ref CV_8U must have the same size and the same number of channels as the input matrices. Supported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpLE" @param src1 first input matrix. @param src2 second input matrix/scalar of the same depth as first input matrix. @sa min, max, threshold, cmpGT, cmpGE, cmpLS */ GAPI_EXPORTS GMat cmpLE(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpLEScalar" */ GAPI_EXPORTS GMat cmpLE(const GMat& src1, const GScalar& src2); /** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are equal to elements in second. The function compares elements of two matrices src1 and src2 of the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) == \texttt{src2} (I)\f] When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions: \f[\texttt{dst} = \texttt{src1} == \texttt{src2}\f] Output matrix of depth @ref CV_8U must have the same size and the same number of channels as the input matrices. Supported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpEQ" @param src1 first input matrix. @param src2 second input matrix/scalar of the same depth as first input matrix. @sa min, max, threshold, cmpNE */ GAPI_EXPORTS GMat cmpEQ(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpEQScalar" */ GAPI_EXPORTS GMat cmpEQ(const GMat& src1, const GScalar& src2); /** @brief Performs the per-element comparison of two matrices checking if elements from first matrix are not equal to elements in second. The function compares elements of two matrices src1 and src2 of the same size: \f[\texttt{dst} (I) = \texttt{src1} (I) != \texttt{src2} (I)\f] When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions: \f[\texttt{dst} = \texttt{src1} != \texttt{src2}\f] Output matrix of depth @ref CV_8U must have the same size and the same number of channels as the input matrices. Supported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpNE" @param src1 first input matrix. @param src2 second input matrix/scalar of the same depth as first input matrix. @sa min, max, threshold, cmpEQ */ GAPI_EXPORTS GMat cmpNE(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.cmpNEScalar" */ GAPI_EXPORTS GMat cmpNE(const GMat& src1, const GScalar& src2); /** @brief computes bitwise conjunction of the two matrixes (src1 & src2) Calculates the per-element bit-wise logical conjunction of two matrices of the same size. In case of floating-point matrices, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as the input matrices. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.bitwise_and" @param src1 first input matrix. @param src2 second input matrix. */ GAPI_EXPORTS GMat bitwise_and(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.bitwise_andS" @param src1 first input matrix. @param src2 scalar, which will be per-lemenetly conjuncted with elements of src1. */ GAPI_EXPORTS GMat bitwise_and(const GMat& src1, const GScalar& src2); /** @brief computes bitwise disjunction of the two matrixes (src1 | src2) Calculates the per-element bit-wise logical disjunction of two matrices of the same size. In case of floating-point matrices, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as the input matrices. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.bitwise_or" @param src1 first input matrix. @param src2 second input matrix. */ GAPI_EXPORTS GMat bitwise_or(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.bitwise_orS" @param src1 first input matrix. @param src2 scalar, which will be per-lemenetly disjuncted with elements of src1. */ GAPI_EXPORTS GMat bitwise_or(const GMat& src1, const GScalar& src2); /** @brief computes bitwise logical "exclusive or" of the two matrixes (src1 ^ src2) Calculates the per-element bit-wise logical "exclusive or" of two matrices of the same size. In case of floating-point matrices, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as the input matrices. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.bitwise_xor" @param src1 first input matrix. @param src2 second input matrix. */ GAPI_EXPORTS GMat bitwise_xor(const GMat& src1, const GMat& src2); /** @overload @note Function textual ID is "org.opencv.core.pixelwise.compare.bitwise_xorS" @param src1 first input matrix. @param src2 scalar, for which per-lemenet "logical or" operation on elements of src1 will be performed. */ GAPI_EXPORTS GMat bitwise_xor(const GMat& src1, const GScalar& src2); /** @brief Inverts every bit of an array. The function bitwise_not calculates per-element bit-wise inversion of the input matrix: \f[\texttt{dst} (I) = \neg \texttt{src} (I)\f] In case of floating-point matrices, their machine-specific bit representations (usually IEEE754-compliant) are used for the operation. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as the input matrix. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.bitwise_not" @param src input matrix. */ GAPI_EXPORTS GMat bitwise_not(const GMat& src); /** @brief Select values from either first or second of input matrices by given mask. The function set to the output matrix either the value from the first input matrix if corresponding value of mask matrix is 255, or value from the second input matrix (if value of mask matrix set to 0). Input mask matrix must be of @ref CV_8UC1 type, two other inout matrices and output matrix should be of the same type. The size should be the same for all input and output matrices. Supported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.pixelwise.select" @param src1 first input matrix. @param src2 second input matrix. @param mask mask input matrix. */ GAPI_EXPORTS GMat select(const GMat& src1, const GMat& src2, const GMat& mask); //! @} gapi_pixelwise //! @addtogroup gapi_matrixop //! @{ /** @brief Calculates per-element minimum of two matrices. The function min calculates the per-element minimum of two matrices of the same size, number of channels and depth: \f[\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{src2} (I))\f] where I is a multi-dimensional index of matrix elements. In case of multi-channel matrices, each channel is processed independently. Output matrix must be of the same size and depth as src1. Supported input matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.min" @param src1 first input matrix. @param src2 second input matrix of the same size and depth as src1. @sa max, compareEqual, compareLess, compareLessEqual */ GAPI_EXPORTS GMat min(const GMat& src1, const GMat& src2); /** @brief Calculates per-element maximum of two matrices. The function max calculates the per-element maximum of two matrices of the same size, number of channels and depth: \f[\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{src2} (I))\f] where I is a multi-dimensional index of matrix elements. In case of multi-channel matrices, each channel is processed independently. Output matrix must be of the same size and depth as src1. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.max" @param src1 first input matrix. @param src2 second input matrix of the same size and depth as src1. @sa min, compare, compareEqual, compareGreater, compareGreaterEqual */ GAPI_EXPORTS GMat max(const GMat& src1, const GMat& src2); /** @brief Calculates the per-element absolute difference between two matrices. The function absDiff calculates absolute difference between two matrices of the same size and depth: \f[\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1}(I) - \texttt{src2}(I)|)\f] where I is a multi-dimensional index of matrix elements. In case of multi-channel matrices, each channel is processed independently. Output matrix must have the same size and depth as input matrices. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.absdiff" @param src1 first input matrix. @param src2 second input matrix. @sa abs */ GAPI_EXPORTS GMat absDiff(const GMat& src1, const GMat& src2); /** @brief Calculates absolute value of matrix elements. The function abs calculates absolute difference between matrix elements and given scalar value: \f[\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1}(I) - \texttt{matC}(I)|)\f] where matC is constructed from given scalar c and has the same sizes and depth as input matrix src. Output matrix must be of the same size and depth as src. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.absdiffC" @param src input matrix. @param c scalar to be subtracted. @sa min, max */ GAPI_EXPORTS GMat absDiffC(const GMat& src, const GScalar& c); /** @brief Calculates sum of all matrix elements. The function sum calculates sum of all matrix elements, independently for each channel. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.sum" @param src input matrix. @sa min, max */ GAPI_EXPORTS GScalar sum(const GMat& src); /** @brief Calculates the weighted sum of two matrices. The function addWeighted calculates the weighted sum of two matrices as follows: \f[\texttt{dst} (I)= \texttt{saturate} ( \texttt{src1} (I)* \texttt{alpha} + \texttt{src2} (I)* \texttt{beta} + \texttt{gamma} )\f] where I is a multi-dimensional index of array elements. In case of multi-channel matrices, each channel is processed independently. The function can be replaced with a matrix expression: \f[\texttt{dst}(I) = \texttt{alpha} * \texttt{src1}(I) - \texttt{beta} * \texttt{src2}(I) + \texttt{gamma} \f] Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.addweighted" @param src1 first input matrix. @param alpha weight of the first matrix elements. @param src2 second input matrix of the same size and channel number as src1. @param beta weight of the second matrix elements. @param gamma scalar added to each sum. @param ddepth optional depth of the output matrix. @sa add, sub */ GAPI_EXPORTS GMat addWeighted(const GMat& src1, double alpha, const GMat& src2, double beta, double gamma, int ddepth = -1); /** @brief Calculates the absolute L1 norm of a matrix. This version of normL1 calculates the absolute L1 norm of src. As example for one array consider the function \f$r(x)= \begin{pmatrix} x \\ 1-x \end{pmatrix}, x \in [-1;1]\f$. The \f$ L_{1} \f$ norm for the sample value \f$r(-1) = \begin{pmatrix} -1 \\ 2 \end{pmatrix}\f$ is calculated as follows \f{align*} \| r(-1) \|_{L_1} &= |-1| + |2| = 3 \\ \f} and for \f$r(0.5) = \begin{pmatrix} 0.5 \\ 0.5 \end{pmatrix}\f$ the calculation is \f{align*} \| r(0.5) \|_{L_1} &= |0.5| + |0.5| = 1 \\ \f} Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.norml1" @param src input matrix. @sa normL2, normInf */ GAPI_EXPORTS GScalar normL1(const GMat& src); /** @brief Calculates the absolute L2 norm of a matrix. This version of normL2 calculates the absolute L2 norm of src. As example for one array consider the function \f$r(x)= \begin{pmatrix} x \\ 1-x \end{pmatrix}, x \in [-1;1]\f$. The \f$ L_{2} \f$ norm for the sample value \f$r(-1) = \begin{pmatrix} -1 \\ 2 \end{pmatrix}\f$ is calculated as follows \f{align*} \| r(-1) \|_{L_2} &= \sqrt{(-1)^{2} + (2)^{2}} = \sqrt{5} \\ \f} and for \f$r(0.5) = \begin{pmatrix} 0.5 \\ 0.5 \end{pmatrix}\f$ the calculation is \f{align*} \| r(0.5) \|_{L_2} &= \sqrt{(0.5)^{2} + (0.5)^{2}} = \sqrt{0.5} \\ \f} Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.norml2" @param src input matrix. @sa normL1, normInf */ GAPI_EXPORTS GScalar normL2(const GMat& src); /** @brief Calculates the absolute infinite norm of a matrix. This version of normInf calculates the absolute infinite norm of src. As example for one array consider the function \f$r(x)= \begin{pmatrix} x \\ 1-x \end{pmatrix}, x \in [-1;1]\f$. The \f$ L_{\infty} \f$ norm for the sample value \f$r(-1) = \begin{pmatrix} -1 \\ 2 \end{pmatrix}\f$ is calculated as follows \f{align*} \| r(-1) \|_{L_\infty} &= \max(|-1|,|2|) = 2 \f} and for \f$r(0.5) = \begin{pmatrix} 0.5 \\ 0.5 \end{pmatrix}\f$ the calculation is \f{align*} \| r(0.5) \|_{L_\infty} &= \max(|0.5|,|0.5|) = 0.5. \f} Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.core.matrixop.norminf" @param src input matrix. @sa normL1, normL2 */ GAPI_EXPORTS GScalar normInf(const GMat& src); /** @brief Calculates the integral of an image. The function calculates one or more integral images for the source image as follows: \f[\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)\f] \f[\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2\f] The function return integral image as \f$(W+1)\times (H+1)\f$ , 32-bit integer or floating-point (32f or 64f) and integral image for squared pixel values; it is \f$(W+1)\times (H+)\f$, double-precision floating-point (64f) array. @note Function textual ID is "org.opencv.core.matrixop.integral" @param src input image. @param sdepth desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or CV_64F. @param sqdepth desired depth of the integral image of squared pixel values, CV_32F or CV_64F. */ GAPI_EXPORTS std::tuple<GMat, GMat> integral(const GMat& src, int sdepth = -1, int sqdepth = -1); /** @brief Applies a fixed-level threshold to each matrix element. The function applies fixed-level thresholding to a single- or multiple-channel matrix. The function is typically used to get a bi-level (binary) image out of a grayscale image ( cmp functions could be also used for this purpose) or for removing a noise, that is, filtering out pixels with too small or too large values. There are several types of thresholding supported by the function. They are determined by type parameter. Also, the special values cv::THRESH_OTSU or cv::THRESH_TRIANGLE may be combined with one of the above values. In these cases, the function determines the optimal threshold value using the Otsu's or Triangle algorithm and uses it instead of the specified thresh . The function returns the computed threshold value in addititon to thresholded matrix. The Otsu's and Triangle methods are implemented only for 8-bit matrices. Input image should be single channel only in case of cv::THRESH_OTSU or cv::THRESH_TRIANGLE flags. Output matrix must be of the same size and depth as src. @note Function textual ID is "org.opencv.core.matrixop.threshold" @param src input matrix (@ref CV_8UC1, @ref CV_8UC3, or @ref CV_32FC1). @param thresh threshold value. @param maxval maximum value to use with the cv::THRESH_BINARY and cv::THRESH_BINARY_INV thresholding types. @param type thresholding type (see the cv::ThresholdTypes). @sa min, max, cmpGT, cmpLE, cmpGE, cmpLS */ GAPI_EXPORTS GMat threshold(const GMat& src, const GScalar& thresh, const GScalar& maxval, int type); /** @overload This function applicable for all threshold types except CV_THRESH_OTSU and CV_THRESH_TRIANGLE @note Function textual ID is "org.opencv.core.matrixop.thresholdOT" */ GAPI_EXPORTS std::tuple<GMat, GScalar> threshold(const GMat& src, const GScalar& maxval, int type); /** @brief Applies a range-level threshold to each matrix element. The function applies range-level thresholding to a single- or multiple-channel matrix. It sets output pixel value to OxFF if the corresponding pixel value of input matrix is in specified range,or 0 otherwise. Input and output matrices must be CV_8UC1. @note Function textual ID is "org.opencv.core.matrixop.inRange" @param src input matrix (CV_8UC1). @param threshLow lower boundary value. @param threshUp upper boundary value. @sa threshold */ GAPI_EXPORTS GMat inRange(const GMat& src, const GScalar& threshLow, const GScalar& threshUp); //! @} gapi_matrixop //! @addtogroup gapi_transform //! @{ /** @brief Resizes an image. The function resizes the image src down to or up to the specified size. Output image size will have the size dsize (when dsize is non-zero) or the size computed from src.size(), fx, and fy; the depth of output is the same as of src. If you want to resize src so that it fits the pre-created dst, you may call the function as follows: @code // explicitly specify dsize=dst.size(); fx and fy will be computed from that. resize(src, dst, dst.size(), 0, 0, interpolation); @endcode If you want to decimate the image by factor of 2 in each direction, you can call the function this way: @code // specify fx and fy and let the function compute the destination image size. resize(src, dst, Size(), 0.5, 0.5, interpolation); @endcode To shrink an image, it will generally look best with cv::INTER_AREA interpolation, whereas to enlarge an image, it will generally look best with cv::INTER_CUBIC (slow) or cv::INTER_LINEAR (faster but still looks OK). @note Function textual ID is "org.opencv.core.transform.resize" @param src input image. @param dsize output image size; if it equals zero, it is computed as: \f[\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\f] Either dsize or both fx and fy must be non-zero. @param fx scale factor along the horizontal axis; when it equals 0, it is computed as \f[\texttt{(double)dsize.width/src.cols}\f] @param fy scale factor along the vertical axis; when it equals 0, it is computed as \f[\texttt{(double)dsize.height/src.rows}\f] @param interpolation interpolation method, see cv::InterpolationFlags @sa warpAffine, warpPerspective, remap, resizeP */ GAPI_EXPORTS GMat resize(const GMat& src, const Size& dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR); /** @brief Resizes a planar image. The function resizes the image src down to or up to the specified size. Planar image memory layout is three planes laying in the memory contiguously, so the image height should be plane_height*plane_number, image type is @ref CV_8UC1. Output image size will have the size dsize, the depth of output is the same as of src. @note Function textual ID is "org.opencv.core.transform.resizeP" @param src input image, must be of @ref CV_8UC1 type; @param dsize output image size; @param interpolation interpolation method, only cv::INTER_LINEAR is supported at the moment @sa warpAffine, warpPerspective, remap, resize */ GAPI_EXPORTS GMatP resizeP(const GMatP& src, const Size& dsize, int interpolation = cv::INTER_LINEAR); /** @brief Creates one 3-channel (4-channel) matrix out of 3(4) single-channel ones. The function merges several matrices to make a single multi-channel matrix. That is, each element of the output matrix will be a concatenation of the elements of the input matrices, where elements of i-th input matrix are treated as mv[i].channels()-element vectors. Input matrix must be of @ref CV_8UC3 (@ref CV_8UC4) type. The function split3/split4 does the reverse operation. @note Function textual ID for merge3 is "org.opencv.core.transform.merge3" @note Function textual ID for merge4 is "org.opencv.core.transform.merge4" @param src1 first input matrix to be merged @param src2 second input matrix to be merged @param src3 third input matrix to be merged @param src4 fourth input matrix to be merged @sa split4, split3 */ GAPI_EXPORTS GMat merge4(const GMat& src1, const GMat& src2, const GMat& src3, const GMat& src4); GAPI_EXPORTS GMat merge3(const GMat& src1, const GMat& src2, const GMat& src3); /** @brief Divides a 3-channel (4-channel) matrix into 3(4) single-channel matrices. The function splits a 3-channel (4-channel) matrix into 3(4) single-channel matrices: \f[\texttt{mv} [c](I) = \texttt{src} (I)_c\f] All output matrices must be in @ref CV_8UC1. @note Function textual for split3 ID is "org.opencv.core.transform.split3" @note Function textual for split4 ID is "org.opencv.core.transform.split4" @param src input @ref CV_8UC4 (@ref CV_8UC3) matrix. @sa merge3, merge4 */ GAPI_EXPORTS std::tuple<GMat, GMat, GMat,GMat> split4(const GMat& src); GAPI_EXPORTS std::tuple<GMat, GMat, GMat> split3(const GMat& src); /** @brief Applies a generic geometrical transformation to an image. The function remap transforms the source image using the specified map: \f[\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))\f] where values of pixels with non-integer coordinates are computed using one of available interpolation methods. \f$map_x\f$ and \f$map_y\f$ can be encoded as separate floating-point maps in \f$map_1\f$ and \f$map_2\f$ respectively, or interleaved floating-point maps of \f$(x,y)\f$ in \f$map_1\f$, or fixed-point maps created by using convertMaps. The reason you might want to convert from floating to fixed-point representations of a map is that they can yield much faster (\~2x) remapping operations. In the converted case, \f$map_1\f$ contains pairs (cvFloor(x), cvFloor(y)) and \f$map_2\f$ contains indices in a table of interpolation coefficients. Output image must be of the same size and depth as input one. @note Function textual ID is "org.opencv.core.transform.remap" @param src Source image. @param map1 The first map of either (x,y) points or just x values having the type CV_16SC2, CV_32FC1, or CV_32FC2. @param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map if map1 is (x,y) points), respectively. @param interpolation Interpolation method (see cv::InterpolationFlags). The method INTER_AREA is not supported by this function. @param borderMode Pixel extrapolation method (see cv::BorderTypes). When borderMode=BORDER_TRANSPARENT, it means that the pixels in the destination image that corresponds to the "outliers" in the source image are not modified by the function. @param borderValue Value used in case of a constant border. By default, it is 0. @note Due to current implementation limitations the size of an input and output images should be less than 32767x32767. */ GAPI_EXPORTS GMat remap(const GMat& src, const Mat& map1, const Mat& map2, int interpolation, int borderMode = BORDER_CONSTANT, const Scalar& borderValue = Scalar()); /** @brief Flips a 2D matrix around vertical, horizontal, or both axes. The function flips the matrix in one of three different ways (row and column indices are 0-based): \f[\texttt{dst} _{ij} = \left\{ \begin{array}{l l} \texttt{src} _{\texttt{src.rows}-i-1,j} & if\; \texttt{flipCode} = 0 \\ \texttt{src} _{i, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} > 0 \\ \texttt{src} _{ \texttt{src.rows} -i-1, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} < 0 \\ \end{array} \right.\f] The example scenarios of using the function are the following: * Vertical flipping of the image (flipCode == 0) to switch between top-left and bottom-left image origin. This is a typical operation in video processing on Microsoft Windows\* OS. * Horizontal flipping of the image with the subsequent horizontal shift and absolute difference calculation to check for a vertical-axis symmetry (flipCode \> 0). * Simultaneous horizontal and vertical flipping of the image with the subsequent shift and absolute difference calculation to check for a central symmetry (flipCode \< 0). * Reversing the order of point arrays (flipCode \> 0 or flipCode == 0). Output image must be of the same depth as input one, size should be correct for given flipCode. @note Function textual ID is "org.opencv.core.transform.flip" @param src input matrix. @param flipCode a flag to specify how to flip the array; 0 means flipping around the x-axis and positive value (for example, 1) means flipping around y-axis. Negative value (for example, -1) means flipping around both axes. @sa remap */ GAPI_EXPORTS GMat flip(const GMat& src, int flipCode); /** @brief Crops a 2D matrix. The function crops the matrix by given cv::Rect. Output matrix must be of the same depth as input one, size is specified by given rect size. @note Function textual ID is "org.opencv.core.transform.crop" @param src input matrix. @param rect a rect to crop a matrix to @sa resize */ GAPI_EXPORTS GMat crop(const GMat& src, const Rect& rect); /** @brief Copies a matrix. Copies an input array. Works as a regular Mat::clone but happens in-graph. Mainly is used to workaround some existing limitations (e.g. to forward an input frame to outputs in the streaming mode). Will be deprecated and removed in the future. @note Function textual ID is "org.opencv.core.transform.copy" @param src input matrix. @sa crop */ GAPI_EXPORTS GMat copy(const GMat& src); /** @brief Applies horizontal concatenation to given matrices. The function horizontally concatenates two GMat matrices (with the same number of rows). @code{.cpp} GMat A = { 1, 4, 2, 5, 3, 6 }; GMat B = { 7, 10, 8, 11, 9, 12 }; GMat C = gapi::concatHor(A, B); //C: //[1, 4, 7, 10; // 2, 5, 8, 11; // 3, 6, 9, 12] @endcode Output matrix must the same number of rows and depth as the src1 and src2, and the sum of cols of the src1 and src2. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.imgproc.transform.concatHor" @param src1 first input matrix to be considered for horizontal concatenation. @param src2 second input matrix to be considered for horizontal concatenation. @sa concatVert */ GAPI_EXPORTS GMat concatHor(const GMat& src1, const GMat& src2); /** @overload The function horizontally concatenates given number of GMat matrices (with the same number of columns). Output matrix must the same number of columns and depth as the input matrices, and the sum of rows of input matrices. @param v vector of input matrices to be concatenated horizontally. */ GAPI_EXPORTS GMat concatHor(const std::vector<GMat> &v); /** @brief Applies vertical concatenation to given matrices. The function vertically concatenates two GMat matrices (with the same number of cols). @code{.cpp} GMat A = { 1, 7, 2, 8, 3, 9 }; GMat B = { 4, 10, 5, 11, 6, 12 }; GMat C = gapi::concatVert(A, B); //C: //[1, 7; // 2, 8; // 3, 9; // 4, 10; // 5, 11; // 6, 12] @endcode Output matrix must the same number of cols and depth as the src1 and src2, and the sum of rows of the src1 and src2. Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref CV_16SC1, @ref CV_32FC1. @note Function textual ID is "org.opencv.imgproc.transform.concatVert" @param src1 first input matrix to be considered for vertical concatenation. @param src2 second input matrix to be considered for vertical concatenation. @sa concatHor */ GAPI_EXPORTS GMat concatVert(const GMat& src1, const GMat& src2); /** @overload The function vertically concatenates given number of GMat matrices (with the same number of columns). Output matrix must the same number of columns and depth as the input matrices, and the sum of rows of input matrices. @param v vector of input matrices to be concatenated vertically. */ GAPI_EXPORTS GMat concatVert(const std::vector<GMat> &v); /** @brief Performs a look-up table transform of a matrix. The function LUT fills the output matrix with values from the look-up table. Indices of the entries are taken from the input matrix. That is, the function processes each element of src as follows: \f[\texttt{dst} (I) \leftarrow \texttt{lut(src(I))}\f] Supported matrix data types are @ref CV_8UC1. Output is a matrix of the same size and number of channels as src, and the same depth as lut. @note Function textual ID is "org.opencv.core.transform.LUT" @param src input matrix of 8-bit elements. @param lut look-up table of 256 elements; in case of multi-channel input array, the table should either have a single channel (in this case the same table is used for all channels) or the same number of channels as in the input matrix. */ GAPI_EXPORTS GMat LUT(const GMat& src, const Mat& lut); /** @brief Converts a matrix to another data depth with optional scaling. The method converts source pixel values to the target data depth. saturate_cast\<\> is applied at the end to avoid possible overflows: \f[m(x,y) = saturate \_ cast<rType>( \alpha (*this)(x,y) + \beta )\f] Output matrix must be of the same size as input one. @note Function textual ID is "org.opencv.core.transform.convertTo" @param src input matrix to be converted from. @param rdepth desired output matrix depth or, rather, the depth since the number of channels are the same as the input has; if rdepth is negative, the output matrix will have the same depth as the input. @param alpha optional scale factor. @param beta optional delta added to the scaled values. */ GAPI_EXPORTS GMat convertTo(const GMat& src, int rdepth, double alpha=1, double beta=0); /** @brief Normalizes the norm or value range of an array. The function normalizes scale and shift the input array elements so that \f[\| \texttt{dst} \| _{L_p}= \texttt{alpha}\f] (where p=Inf, 1 or 2) when normType=NORM_INF, NORM_L1, or NORM_L2, respectively; or so that \f[\min _I \texttt{dst} (I)= \texttt{alpha} , \, \, \max _I \texttt{dst} (I)= \texttt{beta}\f] when normType=NORM_MINMAX (for dense arrays only). @note Function textual ID is "org.opencv.core.normalize" @param src input array. @param alpha norm value to normalize to or the lower range boundary in case of the range normalization. @param beta upper range boundary in case of the range normalization; it is not used for the norm normalization. @param norm_type normalization type (see cv::NormTypes). @param ddepth when negative, the output array has the same type as src; otherwise, it has the same number of channels as src and the depth =ddepth. @sa norm, Mat::convertTo */ GAPI_EXPORTS GMat normalize(const GMat& src, double alpha, double beta, int norm_type, int ddepth = -1); /** @brief Applies a perspective transformation to an image. The function warpPerspective transforms the source image using the specified matrix: \f[\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} , \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )\f] when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert and then put in the formula above instead of M. The function cannot operate in-place. @param src input image. @param M \f$3\times 3\f$ transformation matrix. @param dsize size of the output image. @param flags combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation ( \f$\texttt{dst}\rightarrow\texttt{src}\f$ ). @param borderMode pixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE). @param borderValue value used in case of a constant border; by default, it equals 0. @sa warpAffine, resize, remap, getRectSubPix, perspectiveTransform */ GAPI_EXPORTS GMat warpPerspective(const GMat& src, const Mat& M, const Size& dsize, int flags = cv::INTER_LINEAR, int borderMode = cv::BORDER_CONSTANT, const Scalar& borderValue = Scalar()); /** @brief Applies an affine transformation to an image. The function warpAffine transforms the source image using the specified matrix: \f[\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})\f] when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with #invertAffineTransform and then put in the formula above instead of M. The function cannot operate in-place. @param src input image. @param M \f$2\times 3\f$ transformation matrix. @param dsize size of the output image. @param flags combination of interpolation methods (see #InterpolationFlags) and the optional flag #WARP_INVERSE_MAP that means that M is the inverse transformation ( \f$\texttt{dst}\rightarrow\texttt{src}\f$ ). @param borderMode pixel extrapolation method (see #BorderTypes); borderMode=#BORDER_TRANSPARENT isn't supported @param borderValue value used in case of a constant border; by default, it is 0. @sa warpPerspective, resize, remap, getRectSubPix, transform */ GAPI_EXPORTS GMat warpAffine(const GMat& src, const Mat& M, const Size& dsize, int flags = cv::INTER_LINEAR, int borderMode = cv::BORDER_CONSTANT, const Scalar& borderValue = Scalar()); //! @} gapi_transform } //namespace gapi } //namespace cv #endif //OPENCV_GAPI_CORE_HPP
#include "mStorage.hpp" cStorage::cStorage(char *name) { fs = new FATFileSystem(name); mounted = false; } cStorage::~cStorage(void) { if( mounted == true) { fs->unmount(); delete fs; } } mStorageError cStorage::isConnectSdCard() { if (sd.connect()) { return STORG_PASS; } return STORG_FAIL; } mStorageError cStorage::mountSdCard() { if(fs == NULL) { return STORG_FAIL; } else if( fs->mount(&sd) == 0 ) { mounted = true; return STORG_PASS; } return STORG_FAIL; } mStorageError cStorage::unmountSdCard() { if( mounted == true ) { fs->mount(&sd); return STORG_PASS; } return STORG_FAIL; }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_resource_protocols.h" #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" #include "base/path_service.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_checker.h" #include "chrome/common/chrome_paths.h" #include "content/public/browser/browser_thread.h" #include "extensions/common/file_util.h" #include "net/url_request/url_request_file_job.h" namespace { base::FilePath ResolvePath(const GURL& url) { base::FilePath root_path; PathService::Get(chrome::DIR_RESOURCES_EXTENSION, &root_path); return extensions::file_util::ExtensionResourceURLToFilePath(url, root_path); } class ExtensionResourcesJob : public net::URLRequestFileJob { public: ExtensionResourcesJob(net::URLRequest* request, net::NetworkDelegate* network_delegate) : net::URLRequestFileJob( request, network_delegate, base::FilePath(), content::BrowserThread::GetBlockingPool()-> GetTaskRunnerWithShutdownBehavior( base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)), weak_ptr_factory_(this) {} virtual void Start() OVERRIDE; virtual bool IsRedirectResponse(GURL* location, int* http_status_code) override; protected: virtual ~ExtensionResourcesJob() {} void ResolvePathDone(const base::FilePath& resolved_path); private: base::WeakPtrFactory<ExtensionResourcesJob> weak_ptr_factory_; base::ThreadChecker thread_checker_; DISALLOW_COPY_AND_ASSIGN(ExtensionResourcesJob); }; void ExtensionResourcesJob::Start() { DCHECK(thread_checker_.CalledOnValidThread()); content::BrowserThread::PostTaskAndReplyWithResult( content::BrowserThread::FILE, FROM_HERE, base::Bind(&ResolvePath, request()->url()), base::Bind(&ExtensionResourcesJob::ResolvePathDone, weak_ptr_factory_.GetWeakPtr())); } bool ExtensionResourcesJob::IsRedirectResponse(GURL* location, int* http_status_code) { return false; } void ExtensionResourcesJob::ResolvePathDone( const base::FilePath& resolved_path) { DCHECK(thread_checker_.CalledOnValidThread()); file_path_ = resolved_path; net::URLRequestFileJob::Start(); } class ExtensionResourceProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { public: ExtensionResourceProtocolHandler() {} virtual ~ExtensionResourceProtocolHandler() {} virtual net::URLRequestJob* MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(ExtensionResourceProtocolHandler); }; // Creates URLRequestJobs for chrome-extension-resource:// URLs. net::URLRequestJob* ExtensionResourceProtocolHandler::MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const { return new ExtensionResourcesJob(request, network_delegate); } } // namespace net::URLRequestJobFactory::ProtocolHandler* CreateExtensionResourceProtocolHandler() { return new ExtensionResourceProtocolHandler(); }
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <validationinterface.h> static CMainSignals g_signals; CMainSignals& GetMainSignals() { return g_signals; } void RegisterValidationInterface(CValidationInterface* pwalletIn) { g_signals.UpdatedBlockTip.connect(boost::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1)); g_signals.SyncTransaction.connect(boost::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2, _3, _4)); g_signals.UpdatedTransaction.connect(boost::bind(&CValidationInterface::UpdatedTransaction, pwalletIn, _1)); g_signals.SetBestChain.connect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1)); g_signals.Inventory.connect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1)); g_signals.Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1)); g_signals.BlockChecked.connect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2)); g_signals.ScriptForMining.connect(boost::bind(&CValidationInterface::GetScriptForMining, pwalletIn, _1)); g_signals.BlockFound.connect(boost::bind(&CValidationInterface::ResetRequestCount, pwalletIn, _1)); } void UnregisterValidationInterface(CValidationInterface* pwalletIn) { g_signals.BlockFound.disconnect(boost::bind(&CValidationInterface::ResetRequestCount, pwalletIn, _1)); g_signals.ScriptForMining.disconnect(boost::bind(&CValidationInterface::GetScriptForMining, pwalletIn, _1)); g_signals.BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2)); g_signals.Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1)); g_signals.Inventory.disconnect(boost::bind(&CValidationInterface::Inventory, pwalletIn, _1)); g_signals.SetBestChain.disconnect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1)); g_signals.UpdatedTransaction.disconnect(boost::bind(&CValidationInterface::UpdatedTransaction, pwalletIn, _1)); g_signals.SyncTransaction.disconnect(boost::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2, _3, _4)); g_signals.UpdatedBlockTip.disconnect(boost::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1)); } void UnregisterAllValidationInterfaces() { g_signals.BlockFound.disconnect_all_slots(); g_signals.ScriptForMining.disconnect_all_slots(); g_signals.BlockChecked.disconnect_all_slots(); g_signals.Broadcast.disconnect_all_slots(); g_signals.Inventory.disconnect_all_slots(); g_signals.SetBestChain.disconnect_all_slots(); g_signals.UpdatedTransaction.disconnect_all_slots(); g_signals.SyncTransaction.disconnect_all_slots(); g_signals.UpdatedBlockTip.disconnect_all_slots(); } void SyncWithWallets(const CTransaction &tx, const CBlockIndex *pindex, const CBlock *pblock, const bool fConnect) { g_signals.SyncTransaction(tx, pindex, pblock, fConnect); }
/** * Copyright (c) 2011-2017 libbitcoin developers (see AUTHORS) * * This file is part of libbitcoin. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <bitcoin/bitcoin/wallet/ek_public.hpp> #include <iostream> #include <sstream> #include <string> #include <boost/program_options.hpp> #include <bitcoin/bitcoin/define.hpp> #include <bitcoin/bitcoin/formats/base_58.hpp> #include <bitcoin/bitcoin/math/checksum.hpp> namespace libbitcoin { namespace wallet { ek_public::ek_public() : valid_(false), public_() { } ek_public::ek_public(const std::string& encoded) : ek_public(from_string(encoded)) { } ek_public::ek_public(const ek_public& other) : valid_(other.valid_), public_(other.public_) { } ek_public::ek_public(const encrypted_public& value) : valid_(true), public_(value) { } // Factories. // ---------------------------------------------------------------------------- ek_public ek_public::from_string(const std::string& encoded) { // TODO: incorporate existing parser here, setting new members. encrypted_public key; return decode_base58(key, encoded) && verify_checksum(key) ? ek_public(key) : ek_public(); } // Cast operators. // ---------------------------------------------------------------------------- ek_public::operator const bool() const { return valid_; } ek_public::operator const encrypted_public&() const { return public_; } // Serializer. // ---------------------------------------------------------------------------- std::string ek_public::encoded() const { return encode_base58(public_); } // Accessors. // ---------------------------------------------------------------------------- const encrypted_public& ek_public::public_key() const { return public_; } // Operators. // ---------------------------------------------------------------------------- ek_public& ek_public::operator=(const ek_public& other) { valid_ = other.valid_; public_ = other.public_; return *this; } bool ek_public::operator<(const ek_public& other) const { return encoded() < other.encoded(); } bool ek_public::operator==(const ek_public& other) const { return valid_ == other.valid_ && public_ == other.public_; } bool ek_public::operator!=(const ek_public& other) const { return !(*this == other); } std::istream& operator>>(std::istream& in, ek_public& to) { std::string value; in >> value; to = ek_public(value); if (!to) { using namespace boost::program_options; BOOST_THROW_EXCEPTION(invalid_option_value(value)); } return in; } std::ostream& operator<<(std::ostream& out, const ek_public& of) { out << of.encoded(); return out; } } // namespace wallet } // namespace libbitcoin
// // code_1.cpp // Algorithm // // Created by Mohd Shoaib Rayeen on 15/04/19. // Copyright © 2019 Shoaib Rayeen. All rights reserved. // #include <iostream> #include <map> using namespace std; struct bnode { int data; bnode *left; bnode *right; }; class btree { public: bnode *root; btree(); void insert(); void display(); bnode* newNode(int); int diameter(bnode*); int height(bnode* , int&); }; btree::btree() { root = NULL; } bnode* btree:: newNode(int value) { bnode* temp = new bnode; temp->data=value; temp->left=NULL; temp->right=NULL; return temp; } void btree:: insert() { root = newNode(1); root->left = newNode(2); root->right = newNode(3); root->left->left = newNode(4); root->left->right = newNode(5); } void btree::display() { insert(); cout << "\nDiameter of Tree\t:\t" << diameter(root); cout << endl; } int btree::diameter(bnode* root) { if (root == NULL) return 0; int ans = INT_MIN; height(root, ans); return ans; } int btree::height(bnode* root , int & ans) { if (root == NULL) { return 0; } int left_height = height(root->left, ans); int right_height = height(root->right, ans); ans = max(ans, 1 + left_height + right_height); return 1 + max(left_height, right_height); } int main() { btree obj; obj.display(); cout << "\n"; return 0; }
/* * Part of HTTPP. * * Distributed under the 2-clause BSD licence (See LICENCE.TXT file at the * project root). * * Copyright (c) 2016 Thomas Sanchez. All rights reserved. * */ #include <iostream> #include <string> #include <chrono> #include <httpp/HttpServer.hpp> #include <httpp/http/RestDispatcher.hpp> #include <httpp/http/Utils.hpp> #include <httpp/utils/Exception.hpp> using HTTPP::HttpServer; using HTTPP::HTTP::Request; using HTTPP::HTTP::Connection; using HTTPP::HTTP::RestDispatcher; using HTTPP::HTTP::helper::ReadWholeRequest; using HTTPP::HTTP::HttpCode; using HTTPP::HTTP::Method; void handler_with_body(ReadWholeRequest::Handle handle) { auto connection = handle->connection; // do something with handle->body connection->response().setCode(HttpCode::Ok); HTTPP::HTTP::setShouldConnectionBeClosed(connection->request(), connection->response()); connection->sendResponse(); // connection pointer may become invalid } void handler_without_body(Connection* connection) { connection->response().setCode(HttpCode::Ok); HTTPP::HTTP::setShouldConnectionBeClosed(connection->request(), connection->response()); connection->sendResponse(); // connection pointer may become invalid } int main(int, char**) { commonpp::core::init_logging(); commonpp::core::set_logging_level(commonpp::warning); HttpServer server(1); server.start(); RestDispatcher dispatcher(server); dispatcher.add<Method::POST>("/", &handler_with_body); dispatcher.add<Method::GET>("/", &handler_without_body); dispatcher.add<Method::PUT, Method::DELETE_, Method::HEAD, Method::CONNECT>( "/", [](Connection* connection) { connection->response().setCode(HttpCode::Forbidden); HTTPP::HTTP::setShouldConnectionBeClosed(connection->request(), connection->response()); connection->sendResponse(); // connection pointer may become invalid }); server.bind("0.0.0.0", "8080"); while (true) std::this_thread::sleep_for(std::chrono::milliseconds(100)); }
// #! g++ -Wall -Iinclude -o env_client.exe include/docopt.cpp env_client.cpp /** C++ client, using sockets, to simulate a MAB environment. So far, only Bernoulli arms are supported. - Author: Lilian Besson - License: MIT License (https://lbesson.mit-license.org/) - Date: 28-07-2017 - Online: https://smpybandits.github.io/ - Reference: http://www.binarytides.com/code-a-simple-socket-client-class-in-c/ */ // Include libraries #include <arpa/inet.h> // inet_addr #include <chrono> // milliseconds #include <cstdlib> // rand #include <docopt.h> // docopt command line parser #include <iostream> // streams, <<, >> #include <netdb.h> // hostent #include <stdio.h> // printf #include <string.h> // strlen #include <string> // string #include <sys/socket.h> // socket #include <thread> // sleep // No need for std::printf, std::string etc using namespace std; /** TCP Client class */ class tcp_client { private: int sock; string address; int port; struct sockaddr_in server; public: tcp_client(); bool conn(string, int); bool send_data(string data); string receive(int); }; /** Default initializer */ tcp_client::tcp_client() { sock = -1; port = 0; address = ""; } /** Connect to a host on a certain port number */ bool tcp_client::conn(string address, int port) { const char *c_address; c_address = address.c_str(); // create socket if it is not already created if (sock == -1) { // Create socket sock = socket(AF_INET, SOCK_STREAM, 0); if (sock == -1) { perror("Could not create socket"); } printf("Socket created\n"); } else { /* OK , nothing */ } // setup address structure if (inet_addr(c_address) < 0) { struct hostent *he; struct in_addr **addr_list; // resolve the hostname, its not an ip address if ((he = gethostbyname(c_address)) == NULL) { // gethostbyname failed herror("gethostbyname"); printf("Failed to resolve hostname for '%s'... Try again please.\n", c_address); return false; } // Cast the h_addr_list to in_addr , since h_addr_list also has the ip // address in long format only addr_list = (struct in_addr **)he->h_addr_list; for (int i = 0; addr_list[i] != NULL; i++) { server.sin_addr = *addr_list[i]; printf("Address '%s' resolved to '%s'...\n", c_address, inet_ntoa(*addr_list[i])); break; } } // plain ip address else { server.sin_addr.s_addr = inet_addr(c_address); } server.sin_family = AF_INET; server.sin_port = htons(port); // Connect to remote server if (connect(sock, (struct sockaddr *)&server, sizeof(server)) < 0) { perror("Connect failed. Error!"); return false; } printf("Connected to '%s' with port '%d' !\n", c_address, port); return true; } /** Send data to the connected host */ bool tcp_client::send_data(string data) { // Send some data if (send(sock, data.c_str(), strlen(data.c_str()), 0) < 0) { perror("Send failed : "); return false; } printf("\nData '%s' successfully sent!\n", data.c_str()); return true; } /** Receive data from the connected host */ string tcp_client::receive(int size = 4) { char buffer[size]; string reply; // Receive a reply from the server if (recv(sock, buffer, sizeof(buffer), 0) < 0) { printf("recv failed..."); } reply = buffer; return reply; } // Macro to have a random float in [0, 1) #define random_float() (rand() / static_cast<float>(RAND_MAX)) /** Draw one sample from a Bernoulli distribution of a certain mean. */ float bernoulli_draw(float mean) { // send some data, random in [0, 1] if (random_float() < mean) { return 1; } else { return 0; } } /** Infinite loop, sending random rewards on the asked arm. - create the socket and connect, - continuously read the socket for a channel id number #i, - generate a random reward for mean = mu[i], - send back that reward to the socket. */ int loop( string address, int port, vector<float> means, int milli_sleep = 2000 ) { srand(time(0)); // use current time as seed for random generator tcp_client c; string received; float reward; int channel; c.conn(address, port); // connect to host // send some data, just a stupid useless handcheck c.send_data("Hi from env_client.exe !"); while (true) { // receive and echo reply try { received = c.receive(); try { channel = stoi(received); } catch (const invalid_argument &) { channel = 0; } printf("\nReceived '%s' = channel #'%d'...", received.c_str(), channel); reward = bernoulli_draw(means[channel]); c.send_data(to_string(reward)); } catch (const invalid_argument &) { printf("\nReceived something not correctly understood by stoi(), no problem we continue."); } catch (const runtime_error &) { printf("\nRuntime error in the loop, no issue we continue."); } this_thread::sleep_for(chrono::milliseconds(milli_sleep)); }; return 0; // done } /** Convert a string, read from the cli, to a vector of float number. In Python, that would be map(float, arr.split(',')), but it takes 15 lines here. Yay! Finally debugged, OK. */ vector<float> array_from_str(string arr) { // cout << "arr = " << arr << endl; // DEBUG uint nb = 1; uint size_arr = arr.size(); // cout << "size_arr = " << size_arr << endl; // DEBUG // first, find nb uint index = 0; uint found; while (true) { found = arr.find(',', index); // cout << "\nfound = " << found << endl; // DEBUG // cout << "index = " << index << endl; // DEBUG if ((found == string::npos) || (found >= size_arr)) { break; } else { nb += 1; index = found + 1; } } // cout << "nb = " << nb << endl; // DEBUG // allocate vector vector<float> means; // cout << "\nSecond step...\n"; // DEBUG // then iterate on the string, convert and store uint i = 0; index = 0; while (true) { found = arr.find(',', index); // cout << "\nfound = " << found << endl; // DEBUG // cout << "index = " << index << endl; // DEBUG if (i > nb) { break; } else { // cout << "reading = " << stof(arr.substr(index, found)) << endl; // DEBUG means.push_back(stof(arr.substr(index, found))); // cout << "means[i] = " << means[i] << endl; // DEBUG index = found + 1; i += 1; // cout << "i = " << i << endl; // DEBUG } } return means; } /** documentation for the cli generated with docopt */ static const char USAGE[] = R"(C++ Client to play multi-armed bandits problem against. Usage: env_client.exe [--port=<PORT>] [--host=<HOST>] [--speed=<SPEED>] [<bernoulli_means>] env_client.exe (-h|--help) env_client.exe --version Options: -h --help Show this screen. --version Show version. --port=<PORT> Port to use for the TCP connection [default: 10000]. --host=<HOST> Address to use for the TCP connection [default: 0.0.0.0]. --speed=<SPEED> Speed of emission in milliseconds [default: 1000]. )"; /** Main function, parsing the cli arguments with docopt::docopt and calling loop() with the good arguments. */ int main( int argc, const char **argv ) { string address; long port, speed; vector<float> default_means = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}; vector<float> means; // parse the cli arguments, magically with docopt::docopt map<string, docopt::value> args = docopt::docopt(USAGE, {argv + 1, argv + argc}, true, // show help if requested "MAB environment C++ client v0.1" // version string ); address = args["--host"].asString(); port = args["--port"].asLong(); speed = args["--speed"].asLong(); if (args["<bernoulli_means>"].isString()) { printf("Bernoulli means = '%s'\n", args["<bernoulli_means>"].asString()); means = array_from_str(args["<bernoulli_means>"].asString()); } else { means = default_means; } cout << "- address = " << address << endl; // DEBUG cout << "- port = " << port << endl; // DEBUG cout << "- speed = " << speed << endl; // DEBUG for (uint i = 0; i < means.size(); i++) { cout << "- means[" << i << "] = " << means[i] << endl; // DEBUG } cout << endl << "Calling loop... starting..." << endl; // DEBUG return loop(address, port, means, speed); }
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #include "math.h" #include "stdlib.h" #include "angle_list.h" #include "atom.h" #include "neighbor.h" #include "domain.h" #include "comm.h" #include "force.h" #include "math_const.h" #include "memory.h" #include "error.h" #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace LAMMPS_NS; using namespace MathConst; #define SMALL 0.001 /* ---------------------------------------------------------------------- */ AngleList::AngleList(LAMMPS *lmp) : Angle(lmp) {} /* ---------------------------------------------------------------------- */ AngleList::~AngleList() { if (allocated) { memory->destroy(setflag); memory->destroy(k); memory->destroy(theta0); } } /* ---------------------------------------------------------------------- */ void AngleList::compute(int eflag, int vflag) { int i1,i2,i3,n,type; double delx1,dely1,delz1,delx2,dely2,delz2; double eangle,f1[3],f3[3]; double dtheta,tk; double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22; eangle = 0.0; if (eflag || vflag) ev_setup(eflag,vflag); else evflag = 0; double **x = atom->x; int *tag = atom->tag; double **f = atom->f; int **anglelist = neighbor->anglelist; int nanglelist = neighbor->nanglelist; int nlocal = atom->nlocal; int newton_bond = force->newton_bond; for (n = 0; n < nanglelist; n++) { i1 = anglelist[n][0]; i2 = anglelist[n][1]; i3 = anglelist[n][2]; type = tag[i1]+tag[i2] + tag[i3]; // 1st bond delx1 = x[i1][0] - x[i2][0]; dely1 = x[i1][1] - x[i2][1]; delz1 = x[i1][2] - x[i2][2]; rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; r1 = sqrt(rsq1); // 2nd bond delx2 = x[i3][0] - x[i2][0]; dely2 = x[i3][1] - x[i2][1]; delz2 = x[i3][2] - x[i2][2]; rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; r2 = sqrt(rsq2); // angle (cos and sin) c = delx1*delx2 + dely1*dely2 + delz1*delz2; c /= r1*r2; if (c > 1.0) c = 1.0; if (c < -1.0) c = -1.0; s = sqrt(1.0 - c*c); if (s < SMALL) s = SMALL; s = 1.0/s; // force & energy dtheta = acos(c) - theta0[type]; tk = k[type] * dtheta; //printf("%d(%d) %d(%d) %d(%d) %f\n", i1,tag[i1],i2,tag[i2],i3,tag[i3],dtheta); if (eflag) eangle = tk*dtheta; a = -2.0 * tk * s; a11 = a*c / rsq1; a12 = -a / (r1*r2); a22 = a*c / rsq2; f1[0] = a11*delx1 + a12*delx2; f1[1] = a11*dely1 + a12*dely2; f1[2] = a11*delz1 + a12*delz2; f3[0] = a22*delx2 + a12*delx1; f3[1] = a22*dely2 + a12*dely1; f3[2] = a22*delz2 + a12*delz1; // apply force to each of 3 atoms if (newton_bond || i1 < nlocal) { f[i1][0] += f1[0]; f[i1][1] += f1[1]; f[i1][2] += f1[2]; } if (newton_bond || i2 < nlocal) { f[i2][0] -= f1[0] + f3[0]; f[i2][1] -= f1[1] + f3[1]; f[i2][2] -= f1[2] + f3[2]; } if (newton_bond || i3 < nlocal) { f[i3][0] += f3[0]; f[i3][1] += f3[1]; f[i3][2] += f3[2]; } if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3, delx1,dely1,delz1,delx2,dely2,delz2); } } /* ---------------------------------------------------------------------- */ void AngleList::allocate() { allocated = 1; int n = atom->nangletypes; //memory->create(k,n+1,"angle:k"); //memory->create(theta0,n+1,"angle:theta0"); memory->create(setflag,n+1,"angle:setflag"); for (int i = 1; i <= n; i++) setflag[i] = 0; } /* ---------------------------------------------------------------------- global settings ------------------------------------------------------------------------- */ void AngleList::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal angle_style command"); FILE *fp = fopen(arg[0],"r"); char line[1024]; if (fp == NULL) error->all(FLERR,"Cannot open angle list file"); // count lines in file for upper limit of storage needed int num = 1; char *ptr; int idx, id1, id2, id3; while(fgets(line,1024,fp)) { ptr = strtok(line," \t\n\r\f"); // skip empty lines if (!ptr) continue; // skip comment lines starting with # if (*ptr == '#') continue; id1 = atoi(ptr); ptr = strtok(NULL," \t\n\r\f"); // The second site if (!ptr) error->all(FLERR,"Incorrectly formatted angle list file"); id2 = atoi(ptr); // The third site ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted angle list file"); id3 = atoi(ptr); // Setting the idx in the base array if (id1>num) num=id1; if (id2>num) num=id2; if (id3>num) num=id3; } //while(fgets(line,1024,fp)) ++num; rewind(fp); int array_size = 10*(num+2); // Allocate arrays that *should* contain all angles memory->create(k,array_size,"angle:k"); memory->create(theta0,array_size,"angle:theta0"); // Read the first line // Loop through the rest of the lines while(fgets(line,1024,fp)) { ptr = strtok(line," \t\n\r\f"); // skip empty lines if (!ptr) continue; // skip comment lines starting with # if (*ptr == '#') continue; id1 = atoi(ptr); // The second site ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted angle list file"); id2 = atoi(ptr); // The third site ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted angle list file"); id3 = atoi(ptr); // Setting the idx in the base array idx = id1 + id2 + id3; if ((idx-1) > array_size) error->all(FLERR,"Parameter array in angle_list.cpp is too short!"); // theta0 ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted angle list file"); theta0[idx] = force->numeric(FLERR,ptr); theta0[idx] = theta0[idx] /180.0 * MY_PI; // k ptr = strtok(NULL," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted angle list file"); k[idx] = force->numeric(FLERR,ptr); //printf("%d %f %f\n",idx,k[idx],theta0[idx]); } fclose(fp); } /* ---------------------------------------------------------------------- there are no coeffs to be set, but we need to update setflag and pretend ------------------------------------------------------------------------- */ void AngleList::coeff(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Incorrect args for angle coefficients"); if (!allocated) allocate(); int ilo,ihi; force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); // convert theta0 from degrees to radians int count = 0; for (int i = ilo; i <= ihi; i++) { setflag[i] = 1; count++; } if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients"); } /* ---------------------------------------------------------------------- */ double AngleList::equilibrium_angle(int i) { return theta0[i]; } /* ---------------------------------------------------------------------- proc 0 writes out coeffs to restart file ------------------------------------------------------------------------- */ void AngleList::write_restart(FILE *fp) { fwrite(&k[1],sizeof(double),atom->nangletypes,fp); fwrite(&theta0[1],sizeof(double),atom->nangletypes,fp); } /* ---------------------------------------------------------------------- proc 0 reads coeffs from restart file, bcasts them ------------------------------------------------------------------------- */ void AngleList::read_restart(FILE *fp) { allocate(); if (comm->me == 0) { fread(&k[1],sizeof(double),atom->nangletypes,fp); fread(&theta0[1],sizeof(double),atom->nangletypes,fp); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1; } /* ---------------------------------------------------------------------- proc 0 writes to data file ------------------------------------------------------------------------- */ void AngleList::write_data(FILE *fp) { for (int i = 1; i <= atom->nangletypes; i++) fprintf(fp,"%d %g %g\n",i,k[i],theta0[i]/MY_PI*180.0); } /* ---------------------------------------------------------------------- */ double AngleList::single(int type, int i1, int i2, int i3) { double **x = atom->x; double delx1 = x[i1][0] - x[i2][0]; double dely1 = x[i1][1] - x[i2][1]; double delz1 = x[i1][2] - x[i2][2]; domain->minimum_image(delx1,dely1,delz1); double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1); double delx2 = x[i3][0] - x[i2][0]; double dely2 = x[i3][1] - x[i2][1]; double delz2 = x[i3][2] - x[i2][2]; domain->minimum_image(delx2,dely2,delz2); double r2 = sqrt(delx2*delx2 + dely2*dely2 + delz2*delz2); double c = delx1*delx2 + dely1*dely2 + delz1*delz2; c /= r1*r2; if (c > 1.0) c = 1.0; if (c < -1.0) c = -1.0; double dtheta = acos(c) - theta0[type]; double tk = k[type] * dtheta; return tk*dtheta; }
/* Q Light Controller Plus - Test Unit stubwidget.cpp Copyright (C) Heikki Junnila Massimo Callegari Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.txt Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <QXmlStreamReader> #include <QXmlStreamWriter> #include "stubwidget.h" StubWidget::StubWidget(QWidget* parent, Doc* doc) : VCWidget(parent, doc) { } StubWidget::~StubWidget() { } VCWidget* StubWidget::createCopy(VCWidget* parent) { return parent; } bool StubWidget::loadXML(QXmlStreamReader &root) { Q_UNUSED(root); return true; } bool StubWidget::saveXML(QXmlStreamWriter *doc) { Q_UNUSED(doc); return true; }
/* * Copyright (C) 2020-present The Kraken authors. All rights reserved. */ #include "inspector/protocol/runtime_dispatcher_contract.h" #include "inspector/protocol/runtime_dispatcher_impl.h" namespace kraken { namespace debugger { void RuntimeDispatcherContract::wire(kraken::debugger::UberDispatcher *uber, kraken::debugger::RuntimeBackend *backend) { std::unique_ptr<RuntimeDispatcherImpl> dispatcher(new RuntimeDispatcherImpl(uber->channel(), backend)); uber->setupRedirects(dispatcher->redirects()); uber->registerBackend("Runtime", std::move(dispatcher)); } } // namespace debugger } // namespace kraken
#include <iostream> #include <Eigen/Dense> using Eigen::MatrixXd; int main() { MatrixXd m(2, 2); m(0, 0) = 3; m(1, 0) = 2.5; m(0, 1) = -1; m(1, 1) = m(1, 0) + m(0, 1); std::cout << m << std::endl; char input; std::cin >> input; return 0; }
/* Decode String ============= Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer. You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc. Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, k. For example, there won't be input like 3a or 2[4]. Example 1: Input: s = "3[a]2[bc]" Output: "aaabcbc" Example 2: Input: s = "3[a2[c]]" Output: "accaccacc" Example 3: Input: s = "2[abc]3[cd]ef" Output: "abcabccdcdcdef" Example 4: Input: s = "abc3[cd]xyz" Output: "abccdcdcdxyz" Constraints: 1 <= s.length <= 30 s consists of lowercase English letters, digits, and square brackets '[]'. s is guaranteed to be a valid input. All the integers in s are in the range [1, 300]. */ class Solution { public: string decodeString(string s) { stack<int> count; stack<string> substrings; string result; int index = 0; while (index < s.size()) { if (isdigit(s[index])) { int num = 0; while (isdigit(s[index])) { num = num * 10 + (s[index] - '0'); index++; } count.push(num); } else if (s[index] == '[') { substrings.push(result); result = ""; index++; } else if (s[index] == ']') { string temp = substrings.top(); substrings.pop(); int num = count.top(); count.pop(); while (num--) temp += result; result = temp; index++; } else { result += s[index]; index++; } } return result; } };
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory. // Written by the LBANN Research Team (B. Van Essen, et al.) listed in // the CONTRIBUTORS file. <lbann-dev@llnl.gov> // // LLNL-CODE-697807. // All rights reserved. // // This file is part of LBANN: Livermore Big Artificial Neural Network // Toolkit. For details, see http://software.llnl.gov/LBANN or // https://github.com/LLNL/LBANN. // // Licensed under the Apache License, Version 2.0 (the "Licensee"); you // may not use this file except in compliance with the License. You may // obtain a copy of the License at: // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or // implied. See the License for the specific language governing // permissions and limitations under the license. //////////////////////////////////////////////////////////////////////////////// #ifndef LBANN_LAYERS_ACTIVATIONS_IDENTITY_HPP_INCLUDED #define LBANN_LAYERS_ACTIVATIONS_IDENTITY_HPP_INCLUDED #include "lbann/layers/data_type_layer.hpp" #include "lbann/utils/distconv.hpp" namespace lbann { #ifdef LBANN_HAS_DISTCONV template <typename TensorDataType, data_layout Layout, El::Device Device> class identity_distconv_adapter: public data_type_distconv_adapter<TensorDataType> { public: using TensorDevType = typename data_type_distconv_adapter<TensorDataType>::TensorDevType; identity_distconv_adapter(Layer &layer): data_type_distconv_adapter<TensorDataType>(layer) {} virtual ~identity_distconv_adapter() = default; void setup_distributions(tensor_overlap_constraints &constraints) override; std::unique_ptr<TensorDevType> setup_activations_i(int index) const override; std::unique_ptr<TensorDevType> setup_error_signals_i(int index) const override; }; #endif // LBANN_HAS_DISTCONV /** @brief Output a tensor view. * * Forward and backward prop simply involve setting up tensor views, * and hence are very cheap. */ template <typename TensorDataType, data_layout Layout, El::Device Device> class identity_layer : public data_type_layer<TensorDataType> { public: identity_layer(lbann_comm *comm) : data_type_layer<TensorDataType>(comm) {} identity_layer* copy() const override { return new identity_layer(*this); } std::string get_type() const override { return "identity"; } data_layout get_data_layout() const override { return Layout; } El::Device get_device_allocation() const override { return Device; } protected: void setup_dims(DataReaderMetaData& dr_metadata) override { data_type_layer<TensorDataType>::setup_dims(dr_metadata); this->set_output_dims(this->get_input_dims()); } void fp_setup_outputs(El::Int mini_batch_size) override { El::LockedView(this->get_activations(), this->get_prev_activations()); } void bp_setup_gradient_wrt_inputs(El::Int mini_batch_size) override { El::LockedView(this->get_error_signals(), this->get_prev_error_signals()); } void fp_compute() override {} void bp_compute() override {} #ifdef LBANN_HAS_DISTCONV protected: bool is_distconv_supported() const override { return Device == El::Device::GPU && Layout == data_layout::DATA_PARALLEL; } void setup_distconv_adapter() override { this->get_distconv_adapter_ptr() = make_unique<identity_distconv_adapter< TensorDataType, Layout, Device>>(*this); } #endif // LBANN_HAS_DISTCONV }; #ifndef LBANN_IDENTITY_LAYER_INSTANTIATE #define PROTO_DEVICE(T, Device) \ extern template class identity_layer<T, data_layout::DATA_PARALLEL, Device>; \ extern template class identity_layer<T, data_layout::MODEL_PARALLEL, Device> #include "lbann/macros/instantiate_device.hpp" #undef PROTO_DEVICE #endif // LBANN_IDENTITY_LAYER_INSTANTIATE } // namespace lbann #endif // LBANN_LAYERS_ACTIVATIONS_IDENTITY_HPP_INCLUDED
/******************************************************************************** * ReactPhysics3D physics library, http://www.reactphysics3d.com * * Copyright (c) 2010-2020 Daniel Chappuis * ********************************************************************************* * * * This software is provided 'as-is', without any express or implied warranty. * * In no event will the authors be held liable for any damages arising from the * * use of this software. * * * * Permission is granted to anyone to use this software for any purpose, * * including commercial applications, and to alter it and redistribute it * * freely, subject to the following restrictions: * * * * 1. The origin of this software must not be misrepresented; you must not claim * * that you wrote the original software. If you use this software in a * * product, an acknowledgment in the product documentation would be * * appreciated but is not required. * * * * 2. Altered source versions must be plainly marked as such, and must not be * * misrepresented as being the original software. * * * * 3. This notice may not be removed or altered from any source distribution. * * * ********************************************************************************/ // Libraries #include <reactphysics3d/collision/narrowphase/NarrowPhaseInfoBatch.h> #include <reactphysics3d/collision/ContactPointInfo.h> #include <reactphysics3d/collision/shapes/TriangleShape.h> #include <reactphysics3d/engine/OverlappingPairs.h> #include <iostream> using namespace reactphysics3d; // Constructor NarrowPhaseInfoBatch::NarrowPhaseInfoBatch(MemoryAllocator& allocator, OverlappingPairs& overlappingPairs) : mMemoryAllocator(allocator), mOverlappingPairs(overlappingPairs), overlappingPairIds(allocator), colliderEntities1(allocator), colliderEntities2(allocator), collisionShapes1(allocator), collisionShapes2(allocator), shape1ToWorldTransforms(allocator), shape2ToWorldTransforms(allocator), reportContacts(allocator), isColliding(allocator), contactPoints(allocator), collisionShapeAllocators(allocator), lastFrameCollisionInfos(allocator) { } // Destructor NarrowPhaseInfoBatch::~NarrowPhaseInfoBatch() { clear(); } // Add shapes to be tested during narrow-phase collision detection into the batch void NarrowPhaseInfoBatch::addNarrowPhaseInfo(uint64 pairId, uint64 pairIndex, Entity collider1, Entity collider2, CollisionShape* shape1, CollisionShape* shape2, const Transform& shape1Transform, const Transform& shape2Transform, bool needToReportContacts, MemoryAllocator& shapeAllocator) { overlappingPairIds.add(pairId); colliderEntities1.add(collider1); colliderEntities2.add(collider2); collisionShapes1.add(shape1); collisionShapes2.add(shape2); shape1ToWorldTransforms.add(shape1Transform); shape2ToWorldTransforms.add(shape2Transform); reportContacts.add(needToReportContacts); collisionShapeAllocators.add(&shapeAllocator); contactPoints.add(List<ContactPointInfo*>(mMemoryAllocator)); isColliding.add(false); // Add a collision info for the two collision shapes into the overlapping pair (if not present yet) LastFrameCollisionInfo* lastFrameInfo = mOverlappingPairs.addLastFrameInfoIfNecessary(pairIndex, shape1->getId(), shape2->getId()); lastFrameCollisionInfos.add(lastFrameInfo); } // Add a new contact point void NarrowPhaseInfoBatch::addContactPoint(uint index, const Vector3& contactNormal, decimal penDepth, const Vector3& localPt1, const Vector3& localPt2) { assert(reportContacts[index]); assert(penDepth > decimal(0.0)); // Get the memory allocator MemoryAllocator& allocator = mOverlappingPairs.getTemporaryAllocator(); // Create the contact point info ContactPointInfo* contactPointInfo = new (allocator.allocate(sizeof(ContactPointInfo))) ContactPointInfo(contactNormal, penDepth, localPt1, localPt2); // Add it into the list of contact points contactPoints[index].add(contactPointInfo); } // Reset the remaining contact points void NarrowPhaseInfoBatch::resetContactPoints(uint index) { // Get the memory allocator MemoryAllocator& allocator = mOverlappingPairs.getTemporaryAllocator(); // For each remaining contact point info for (uint i=0; i < contactPoints[index].size(); i++) { ContactPointInfo* contactPoint = contactPoints[index][i]; // Call the destructor contactPoint->~ContactPointInfo(); // Delete the current element allocator.release(contactPoint, sizeof(ContactPointInfo)); } contactPoints[index].clear(); } // Initialize the containers using cached capacity void NarrowPhaseInfoBatch::reserveMemory() { overlappingPairIds.reserve(mCachedCapacity); colliderEntities1.reserve(mCachedCapacity); colliderEntities2.reserve(mCachedCapacity); collisionShapes1.reserve(mCachedCapacity); collisionShapes2.reserve(mCachedCapacity); shape1ToWorldTransforms.reserve(mCachedCapacity); shape2ToWorldTransforms.reserve(mCachedCapacity); reportContacts.reserve(mCachedCapacity); collisionShapeAllocators.reserve(mCachedCapacity); lastFrameCollisionInfos.reserve(mCachedCapacity); isColliding.reserve(mCachedCapacity); contactPoints.reserve(mCachedCapacity); } // Clear all the objects in the batch void NarrowPhaseInfoBatch::clear() { for (uint i=0; i < overlappingPairIds.size(); i++) { assert(contactPoints[i].size() == 0); // Release the memory of the TriangleShape (this memory was allocated in the // MiddlePhaseTriangleCallback::testTriangle() method) if (collisionShapes1.size() > 0 && collisionShapes1[i]->getName() == CollisionShapeName::TRIANGLE) { collisionShapes1[i]->~CollisionShape(); collisionShapeAllocators[i]->release(collisionShapes1[i], sizeof(TriangleShape)); } if (collisionShapes2.size() > 0 && collisionShapes2[i]->getName() == CollisionShapeName::TRIANGLE) { collisionShapes2[i]->~CollisionShape(); collisionShapeAllocators[i]->release(collisionShapes2[i], sizeof(TriangleShape)); } } // Note that we clear the following containers and we release their allocated memory. Therefore, // if the memory allocator is a single frame allocator, the memory is deallocated and will be // allocated in the next frame at a possibly different location in memory (remember that the // location of the allocated memory of a single frame allocator might change between two frames) mCachedCapacity = overlappingPairIds.size(); overlappingPairIds.clear(true); colliderEntities1.clear(true); colliderEntities2.clear(true); collisionShapes1.clear(true); collisionShapes2.clear(true); shape1ToWorldTransforms.clear(true); shape2ToWorldTransforms.clear(true); reportContacts.clear(true); collisionShapeAllocators.clear(true); lastFrameCollisionInfos.clear(true); isColliding.clear(true); contactPoints.clear(true); }
/* Copyright (c) 2012-2015, Kai Hugo Hustoft Endresen <kai.endresen@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <settings.h> #include <opencv2/opencv.hpp> std::atomic_int Settings::demosaicing_method(cv::COLOR_BayerBG2BGR_EA); std::atomic_bool Settings::use_raw(false); Settings::show Settings::show_mode = Settings::show::BOTH; bool Settings::force_noscale = false;
#include "qrcodedialog.h" #include "ui_qrcodedialog.h" #include "bitcoinunits.h" #include "guiconstants.h" #include "guiutil.h" #include "optionsmodel.h" #include <QPixmap> #include <QUrl> #include <qrencode.h> QRCodeDialog::QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent) : QDialog(parent), ui(new Ui::QRCodeDialog), model(0), address(addr) { ui->setupUi(this); setWindowTitle(QString("%1").arg(address)); ui->chkReqPayment->setVisible(enableReq); ui->lblAmount->setVisible(enableReq); ui->lnReqAmount->setVisible(enableReq); ui->lnLabel->setText(label); ui->btnSaveAs->setEnabled(false); genCode(); } QRCodeDialog::~QRCodeDialog() { delete ui; } void QRCodeDialog::setModel(OptionsModel *model) { this->model = model; if (model) connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); // update the display unit, to not use the default ("BTC") updateDisplayUnit(); } void QRCodeDialog::genCode() { QString uri = getURI(); if (uri != "") { ui->lblQRCode->setText(""); QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1); if (!code) { ui->lblQRCode->setText(tr("Error encoding URI into QR Code.")); return; } myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32); myImage.fill(0xffffff); unsigned char *p = code->data; for (int y = 0; y < code->width; y++) { for (int x = 0; x < code->width; x++) { myImage.setPixel(x + 4, y + 4, ((*p & 1) ? 0x0 : 0xffffff)); p++; } } QRcode_free(code); ui->lblQRCode->setPixmap(QPixmap::fromImage(myImage).scaled(300, 300)); ui->outUri->setPlainText(uri); } } QString QRCodeDialog::getURI() { QString ret = QString("pos:%1").arg(address); int paramCount = 0; ui->outUri->clear(); if (ui->chkReqPayment->isChecked()) { if (ui->lnReqAmount->validate()) { // even if we allow a non BTC unit input in lnReqAmount, we generate the URI with BTC as unit (as defined in BIP21) ret += QString("?amount=%1").arg(BitcoinUnits::format(BitcoinUnits::BTC, ui->lnReqAmount->value())); paramCount++; } else { ui->btnSaveAs->setEnabled(false); ui->lblQRCode->setText(tr("The entered amount is invalid, please check.")); return QString(""); } } if (!ui->lnLabel->text().isEmpty()) { QString lbl(QUrl::toPercentEncoding(ui->lnLabel->text())); ret += QString("%1label=%2").arg(paramCount == 0 ? "?" : "&").arg(lbl); paramCount++; } if (!ui->lnMessage->text().isEmpty()) { QString msg(QUrl::toPercentEncoding(ui->lnMessage->text())); ret += QString("%1message=%2").arg(paramCount == 0 ? "?" : "&").arg(msg); paramCount++; } // limit URI length to prevent a DoS against the QR-Code dialog if (ret.length() > MAX_URI_LENGTH) { ui->btnSaveAs->setEnabled(false); ui->lblQRCode->setText(tr("Resulting URI too long, try to reduce the text for label / message.")); return QString(""); } ui->btnSaveAs->setEnabled(true); return ret; } void QRCodeDialog::on_lnReqAmount_textChanged() { genCode(); } void QRCodeDialog::on_lnLabel_textChanged() { genCode(); } void QRCodeDialog::on_lnMessage_textChanged() { genCode(); } void QRCodeDialog::on_btnSaveAs_clicked() { QString fn = GUIUtil::getSaveFileName(this, tr("Save QR Code"), QString(), tr("PNG Images (*.png)")); if (!fn.isEmpty()) myImage.scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE).save(fn); } void QRCodeDialog::on_chkReqPayment_toggled(bool fChecked) { if (!fChecked) // if chkReqPayment is not active, don't display lnReqAmount as invalid ui->lnReqAmount->setValid(true); genCode(); } void QRCodeDialog::updateDisplayUnit() { if (model) { // Update lnReqAmount with the current unit ui->lnReqAmount->setDisplayUnit(model->getDisplayUnit()); } }
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "rpcserver.h" #include "rpcclient.h" #include "init.h" #include <boost/algorithm/string/predicate.hpp> void WaitForShutdown(boost::thread_group* threadGroup) { bool fShutdown = ShutdownRequested(); // Tell the main threads to shutdown. while (!fShutdown) { MilliSleep(200); fShutdown = ShutdownRequested(); } if (threadGroup) { threadGroup->interrupt_all(); threadGroup->join_all(); } } ////////////////////////////////////////////////////////////////////////////// // // Start // bool AppInit(int argc, char* argv[]) { boost::thread_group threadGroup; bool fRet = false; fHaveGUI = false; try { // // Parameters // // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main() ParseParameters(argc, argv); if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified directory does not exist\n"); Shutdown(); } ReadConfigFile(mapArgs, mapMultiArgs); if (mapArgs.count("-?") || mapArgs.count("--help")) { // First part of help message is specific to bitcoind / RPC client std::string strUsage = _("EMC version") + " " + FormatFullVersion() + "\n\n" + _("Usage:") + "\n" + " emcd [options] " + "\n" + " emcd [options] <command> [params] " + _("Send command to -server or emcd") + "\n" + " emcd [options] help " + _("List commands") + "\n" + " emcd [options] help <command> " + _("Get help for a command") + "\n"; strUsage += "\n" + HelpMessage(); fprintf(stdout, "%s", strUsage.c_str()); return false; } // Command-line RPC for (int i = 1; i < argc; i++) if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "emc:")) fCommandLine = true; if (fCommandLine) { if (!SelectParamsFromCommandLine()) { fprintf(stderr, "Error: invalid combination of -regtest and -testnet.\n"); return false; } int ret = CommandLineRPC(argc, argv); exit(ret); } #if !WIN32 fDaemon = GetBoolArg("-daemon", false); if (fDaemon) { // Daemonize pid_t pid = fork(); if (pid < 0) { fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno); return false; } if (pid > 0) // Parent process, pid is child process id { CreatePidFile(GetPidFile(), pid); return true; } // Child process falls through to rest of initialization pid_t sid = setsid(); if (sid < 0) fprintf(stderr, "Error: setsid() returned %d errno %d\n", sid, errno); } #endif fRet = AppInit2(threadGroup); } catch (std::exception& e) { PrintException(&e, "AppInit()"); } catch (...) { PrintException(NULL, "AppInit()"); } if (!fRet) { threadGroup.interrupt_all(); // threadGroup.join_all(); was left out intentionally here, because we didn't re-test all of // the startup-failure cases to make sure they don't result in a hang due to some // thread-blocking-waiting-for-another-thread-during-startup case } else { WaitForShutdown(&threadGroup); } Shutdown(); return fRet; } extern void noui_connect(); int main(int argc, char* argv[]) { bool fRet = false; // Connect bitcoind signal handlers noui_connect(); fRet = AppInit(argc, argv); if (fRet && fDaemon) return 0; return (fRet ? 0 : 1); }
#pragma once #include "../base_def.hpp" namespace lol { struct RosterPlayerAggregatedStatsDTO { std::map<std::string, int32_t> rawStatsSum; std::map<std::string, int32_t> rawStatsMax; }; inline void to_json(json& j, const RosterPlayerAggregatedStatsDTO& v) { j["rawStatsSum"] = v.rawStatsSum; j["rawStatsMax"] = v.rawStatsMax; } inline void from_json(const json& j, RosterPlayerAggregatedStatsDTO& v) { v.rawStatsSum = j.at("rawStatsSum").get<std::map<std::string, int32_t>>(); v.rawStatsMax = j.at("rawStatsMax").get<std::map<std::string, int32_t>>(); } }
/* * Copyright 2014 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "src/core/SkAutoMalloc.h" #include "src/gpu/GrShaderUtils.h" #include "src/gpu/gl/GrGLGpu.h" #include "src/gpu/gl/builders/GrGLShaderStringBuilder.h" #include "src/sksl/SkSLCompiler.h" #include "src/sksl/SkSLGLSLCodeGenerator.h" #include "src/sksl/ir/SkSLProgram.h" // Print the source code for all shaders generated. static const bool gPrintSKSL = false; static const bool gPrintGLSL = false; std::unique_ptr<SkSL::Program> GrSkSLtoGLSL(const GrGLContext& context, SkSL::Program::Kind programKind, const SkSL::String& sksl, const SkSL::Program::Settings& settings, SkSL::String* glsl, GrContextOptions::ShaderErrorHandler* errorHandler) { SkSL::Compiler* compiler = context.compiler(); std::unique_ptr<SkSL::Program> program; #ifdef SK_DEBUG SkSL::String src = GrShaderUtils::PrettyPrint(sksl); #else const SkSL::String& src = sksl; #endif program = compiler->convertProgram(programKind, src, settings); if (!program || !compiler->toGLSL(*program, glsl)) { errorHandler->compileError(src.c_str(), compiler->errorText().c_str()); return nullptr; } if (gPrintSKSL || gPrintGLSL) { GrShaderUtils::PrintShaderBanner(programKind); if (gPrintSKSL) { SkDebugf("SKSL:\n"); GrShaderUtils::PrintLineByLine(GrShaderUtils::PrettyPrint(sksl)); } if (gPrintGLSL) { SkDebugf("GLSL:\n"); GrShaderUtils::PrintLineByLine(GrShaderUtils::PrettyPrint(*glsl)); } } return program; } GrGLuint GrGLCompileAndAttachShader(const GrGLContext& glCtx, GrGLuint programId, GrGLenum type, const SkSL::String& glsl, GrGpu::Stats* stats, GrContextOptions::ShaderErrorHandler* errorHandler) { const GrGLInterface* gli = glCtx.glInterface(); // Specify GLSL source to the driver. GrGLuint shaderId; GR_GL_CALL_RET(gli, shaderId, CreateShader(type)); if (0 == shaderId) { return 0; } const GrGLchar* source = glsl.c_str(); GrGLint sourceLength = glsl.size(); GR_GL_CALL(gli, ShaderSource(shaderId, 1, &source, &sourceLength)); stats->incShaderCompilations(); GR_GL_CALL(gli, CompileShader(shaderId)); bool checkCompiled = !glCtx.caps()->skipErrorChecks(); if (checkCompiled) { GrGLint compiled = GR_GL_INIT_ZERO; GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_COMPILE_STATUS, &compiled)); if (!compiled) { GrGLint infoLen = GR_GL_INIT_ZERO; GR_GL_CALL(gli, GetShaderiv(shaderId, GR_GL_INFO_LOG_LENGTH, &infoLen)); SkAutoMalloc log(sizeof(char)*(infoLen+1)); // outside if for debugger if (infoLen > 0) { // retrieve length even though we don't need it to workaround bug in Chromium cmd // buffer param validation. GrGLsizei length = GR_GL_INIT_ZERO; GR_GL_CALL(gli, GetShaderInfoLog(shaderId, infoLen+1, &length, (char*)log.get())); } errorHandler->compileError(glsl.c_str(), infoLen > 0 ? (const char*)log.get() : ""); GR_GL_CALL(gli, DeleteShader(shaderId)); return 0; } } // Attach the shader, but defer deletion until after we have linked the program. // This works around a bug in the Android emulator's GLES2 wrapper which // will immediately delete the shader object and free its memory even though it's // attached to a program, which then causes glLinkProgram to fail. GR_GL_CALL(gli, AttachShader(programId, shaderId)); return shaderId; }
/********************************************************************** * LeechCraft - modular cross-platform feature rich internet client. * Copyright (C) 2013 Slava Barinov <rayslava@gmail.com> * * Boost Software License - Version 1.0 - August 17th, 2003 * * Permission is hereby granted, free of charge, to any person or organization * obtaining a copy of the software and accompanying documentation covered by * this license (the "Software") to use, reproduce, display, distribute, * execute, and transmit the Software, and to prepare derivative works of the * Software, and to permit third-parties to whom the Software is furnished to * do so, all subject to the following: * * The copyright notices in the Software and this entire statement, including * the above license grant, this restriction and the following disclaimer, * must be included in all copies of the Software, in whole or in part, and * all derivative works of the Software, unless such copies or derivative * works are solely in the form of machine-executable object code generated by * a source language processor. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. **********************************************************************/ #include "woodpecker.h" #include <QIcon> #include <interfaces/entitytesthandleresult.h> #include <xmlsettingsdialog/xmlsettingsdialog.h> #include <util/util.h> #include "core.h" #include "twitterpage.h" #include "xmlsettingsmanager.h" namespace LeechCraft { namespace Azoth { namespace Woodpecker { void Plugin::Init (ICoreProxy_ptr proxy) { Util::InstallTranslator ("azoth_woodpecker"); XmlSettingsDialog_.reset (new Util::XmlSettingsDialog ()); XmlSettingsDialog_->RegisterObject (XmlSettingsManager::Instance (), "azothwoodpeckersettings.xml"); Core::Instance ().SetProxy (proxy); HomeTC_ = { GetUniqueID () + "_home", tr ("Own timeline"), tr ("Own Twitter timeline"), GetIcon (), 2, TFOpenableByRequest }; UserTC_ = { GetUniqueID () + "_user", tr ("User timeline"), tr ("Arbitrary Twitter user timeline"), GetIcon (), 2, TFEmpty }; SearchTC_ = { GetUniqueID () + "_search", tr ("Search timeline"), tr ("Search result timeline"), GetIcon (), 2, TFEmpty }; FavoriteTC_ = { GetUniqueID () + "_favorites", tr ("Favorite twits"), tr ("Favorite statuses timeline"), GetIcon (), 2, TFEmpty }; TabClasses_.append ({ HomeTC_, [this] (const TabClassInfo& tc) {MakeTab (new TwitterPage (tc, this), tc); }}); TabClasses_.append ({ UserTC_, nullptr }); TabClasses_.append ({ SearchTC_, nullptr }); TabClasses_.append ({ FavoriteTC_, nullptr }); } void Plugin::AddTab (const TabClassInfo& tc, const QString& name, const FeedMode mode, const KQOAuthParameters& params) { if (name.isEmpty ()) return; auto newtab = new TwitterPage (tc, this, mode, params); MakeTab (newtab, tc); } void Plugin::SecondInit () { } void Plugin::Release () { } QByteArray Plugin::GetUniqueID () const { return "org.LeechCraft.Azoth.Woodpecker"; } QString Plugin::GetName () const { return "Azoth Woodpecker"; } QString Plugin::GetInfo () const { return tr ("Simple twitter client."); } QIcon Plugin::GetIcon () const { static QIcon icon ("lcicons:/plugins/azoth/woodpecker/resources/images/woodpecker.svg"); return icon; } TabClasses_t Plugin::GetTabClasses () const { TabClasses_t result; for (const auto& item : TabClasses_) result << item.first; return result; } QSet<QByteArray> Plugin::GetPluginClasses () const { QSet<QByteArray> classes; classes << "org.LeechCraft.Plugins.Azoth.Plugins.IProtocolPlugin"; return classes; } void Plugin::TabOpenRequested (const QByteArray& tc) { const auto pos = std::find_if (TabClasses_.begin (), TabClasses_.end (), [&tc] (decltype (TabClasses_.at (0)) pair) { return pair.first.TabClass_ == tc; }); if (pos == TabClasses_.end ()) { qWarning () << Q_FUNC_INFO << "unknown tab class" << tc; return; } pos->second (pos->first); } std::shared_ptr<Util::XmlSettingsDialog> Plugin::GetSettingsDialog () const { return XmlSettingsDialog_; } void Plugin::MakeTab (QWidget *tab, const TabClassInfo& tc) { connect (tab, SIGNAL (removeTab (QWidget*)), this, SIGNAL (removeTab (QWidget*))); emit addNewTab (tc.VisibleName_, tab); emit changeTabIcon (tab, tc.Icon_); emit raiseTab (tab); } void Plugin::RecoverTabs (const QList<TabRecoverInfo>& infos) { for (const auto& recInfo : infos) { QDataStream stream (recInfo.Data_); char *buf; stream >> buf; const QString type (buf); if (type.startsWith ("org.LeechCraft.Woodpecker_home")) { for (const auto& pair : recInfo.DynProperties_) setProperty (pair.first, pair.second); TabOpenRequested (GetUniqueID () + "_home"); } else if (type.startsWith ("org.LeechCraft.Woodpecker_user")) { for (const auto& pair : recInfo.DynProperties_) setProperty (pair.first, pair.second); KQOAuthParameters param; stream >> param; const auto& username = param.take ("screen_name");; param.insert ("screen_name", username); AddTab (UserTC_, tr ("User %1").arg (username), FeedMode::UserTimeline, param); } else if (type.startsWith ("org.LeechCraft.Woodpecker_search")) { for (const auto& pair : recInfo.DynProperties_) setProperty (pair.first, pair.second); KQOAuthParameters param; stream >> param; const auto& search = param.take ("q").toUtf8 ().constData (); param.insert ("q", search); AddTab (SearchTC_, tr ("Search").append (search), FeedMode::SearchResult, param); } else if (type.startsWith ("org.LeechCraft.Woodpecker_favorites")) { for (const auto& pair : recInfo.DynProperties_) setProperty (pair.first, pair.second); KQOAuthParameters param; stream >> param; const auto& username = param.take ("screen_name");; param.insert ("screen_name", username); AddTab (FavoriteTC_, tr ("@%1 favorites").arg (username), FeedMode::Favorites, param); } else qWarning () << Q_FUNC_INFO << "unknown context" << recInfo.Data_; } } bool Plugin::HasSimilarTab (const QByteArray& data, const QList<QByteArray>& existing) const { // TODO implement me #pragma warning Implement me. Q_UNUSED (data) Q_UNUSED (existing) return false; } } } } LC_EXPORT_PLUGIN (leechcraft_azoth_woodpecker, LeechCraft::Azoth::Woodpecker::Plugin);