blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
28a869f3980f74c5d82a62d99dbdfab37f232051
8193108a50b92916226ba62d0bee1023d4717824
/FutVasf2D/src/BehaviorDefense.cpp
21772bf5c8811ce6af400c84d86d196041550cd2
[ "BSD-2-Clause", "MIT" ]
permissive
joaopedrofn/UndergraduateDissertation
ee4f801fbb9b988ea5c4824336540a6d05540b88
f6179a286d3a1940288c8ad54fd992d97c5684d7
refs/heads/master
2020-06-30T22:47:21.195354
2019-08-22T02:02:20
2019-08-22T02:02:20
200,972,616
0
0
null
null
null
null
UTF-8
C++
false
false
10,131
cpp
/************************************************************************************ * WrightEagle (Soccer Simulation League 2D) * * BASE SOURCE CODE RELEASE 2016 * * Copyright (c) 1998-2016 WrightEagle 2D Soccer Simulation Team, * * Multi-Agent Systems Lab., * * School of Computer Science and Technology, * * University of Science and Technology of China * * 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 WrightEagle 2D Soccer Simulation Team 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 WrightEagle 2D Soccer Simulation Team 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 "BehaviorDefense.h" #include "BehaviorFormation.h" #include "BehaviorBlock.h" #include "BehaviorMark.h" #include "WorldState.h" #include "Agent.h" #include "Formation.h" #include "Dasher.h" #include "Logger.h" #include "BehaviorIntercept.h" #include "Utilities.h" #include <fstream> #include "qLearning.h" #include "PossibleActions.h" #include "PossibleStates.h" BehaviorDefensePlanner::BehaviorDefensePlanner(Agent &agent) : BehaviorPlannerBase<BehaviorDefenseData>(agent) { } BehaviorDefensePlanner::~BehaviorDefensePlanner() { } void BehaviorDefensePlanner::Plan(std::list<ActiveBehavior> &behavior_list) { // while(mAgent.isQTableLocked()); // mAgent.lockQTable(); // ifstream qTableFileIn("qTable", ios::binary); std::stringstream qTableString; qTableString << "qTable" << mSelfState.GetUnum(); std::ifstream qTableFileIn(qTableString.str(), std::ios::binary); double qTable[648][10]; qTableFileIn.read((char *)&qTable, sizeof(qTable)); qTableFileIn.close(); // mAgent.unlockQTable(); mAgent.lastPosition = mSelfState.GetPos(); mAgent.lastBallPosition = mWorldState.GetBall().GetPos(); //GETTING VARIABLES double distToBall = mPositionInfo.GetBallDistToTeammate(mSelfState.GetUnum()); Unum closestTeammate = mPositionInfo.GetCloseTeammateToBall()[0]; double amITheClosest = closestTeammate == mSelfState.GetUnum(); double teammateDistToBall = amITheClosest ? distToBall : mPositionInfo.GetBallDistToTeammate(closestTeammate); Unum opponent = mPositionInfo.GetOpponentWithBall(); Vector oppPosition = mWorldState.GetOpponent(opponent).GetPos(); Vector goaliePosition = mWorldState.GetTeammate(mWorldState.GetTeammateGoalieUnum()).GetPos(); Vector goalPosition(goaliePosition.X() > 0 ? 51.162 : -51.162, 0); double oppDistToGoal = oppPosition.Dist(goalPosition); double teammatesDistToOpp[10]; int index = 0; double avgDist = 0; for (int i = 1; i <= 11; i++) { if (i != mWorldState.GetTeammateGoalieUnum()) { double aux = mWorldState.GetTeammate(i).GetPos().Dist(oppPosition); teammatesDistToOpp[index++] = aux; } } int n = sizeof(teammatesDistToOpp) / sizeof(teammatesDistToOpp[0]); std::sort(teammatesDistToOpp, teammatesDistToOpp + (n)); avgDist = teammatesDistToOpp[0] + teammatesDistToOpp[1] + teammatesDistToOpp[2] + teammatesDistToOpp[3]; avgDist /= 4; // avgDist /= 10; double sum = 0; for (int i = 0; i < 4; i++) { sum += (teammatesDistToOpp[i] - avgDist) * (teammatesDistToOpp[i] - avgDist); } double density = sqrt(sum / 4); // double density = sqrt(0.1*sum); Vector ballPosition = mWorldState.GetBall().GetPos(); Vector position = mSelfState.GetPos(); bool north = ballPosition.Y() > position.Y(); bool west = ballPosition.X() < position.X(); int curState = GetState(distToBall, teammateDistToBall, amITheClosest, oppDistToGoal, density, north, west); mAgent.lastStateOccurred = curState; // int actionToTake = greedySelection(vector<double>(std::begin(qTable[curState]), std::end(qTable[curState]))); vector<double> actionSpace{qTable[curState][0], qTable[curState][1], qTable[curState][2], qTable[curState][3], qTable[curState][4], qTable[curState][5], qTable[curState][6], qTable[curState][7], qTable[curState][8]}; int actionToTake = greedyEpSelection(actionSpace, (1 - (qTable[curState][9] / 100000))); // if (qTable[curState][actionToTake] == .0) // // std::cout << curState << " | " << actionToTake << std::endl; mAgent.lastActionTaken = actionToTake; double power = mSelfState.CorrectDashPowerForStamina(ServerParam::instance().maxDashPower()); // std::cout << ballPosition << std::endl; switch (actionToTake) { case MoveNorth: if (mSelfState.GetPos().Y() + 2 <= 25) Dasher::instance().GoToPoint(mAgent, Vector(mSelfState.GetPos().X(), mSelfState.GetPos().Y() + 10), 1.0, power, false, true); break; case MoveSouth: if (mSelfState.GetPos().Y() - 2 >= -25) Dasher::instance().GoToPoint(mAgent, Vector(mSelfState.GetPos().X(), mSelfState.GetPos().Y() - 10), 1.0, power, false, true); break; case MoveWest: if (mSelfState.GetPos().X() - 2 >= -51) Dasher::instance().GoToPoint(mAgent, Vector(mSelfState.GetPos().X() - 10, mSelfState.GetPos().Y()), 1.0, power, false, true); break; case MoveEast: if (mSelfState.GetPos().X() + 2 >= 51) Dasher::instance().GoToPoint(mAgent, Vector(mSelfState.GetPos().X() + 10, mSelfState.GetPos().Y()), 1.0, power, false, true); break; case MoveToBall: Dasher::instance().GoToPoint(mAgent, ballPosition, 1.0, power, false, true); break; case InterceptAction: BehaviorInterceptPlanner(mAgent).Plan(behavior_list); break; case BlockAction: BehaviorBlockPlanner(mAgent).Plan(behavior_list); break; case MarkAction: BehaviorMarkPlanner(mAgent).Plan(behavior_list); break; case StayStill: default: break; } // if(mAgent.lastActions.size() == 5){ // double reward; // int thatState = mAgent.lastActionsState[0]; // int thatAction = mAgent.lastActions[0]; // PlayMode thatPM = mAgent.lastActionsPM[0]; // mAgent.lastActions.erase(mAgent.lastActions.begin()); // mAgent.lastActionsState.erase(mAgent.lastActionsState.begin()); // mAgent.lastActionsPM.erase(mAgent.lastActionsPM.begin()); // switch (thatPM) // { // case PM_Captured: // cout << "CAPTURED BY DEFENSE\n"; // reward = 20; // break; // case PM_OutOfBounds: // cout << "OUT OF BOUNDS\n"; // reward = 5; // case PM_Goal_Opps: // cout << "GOAL :(\n"; // reward = -20; // case PM_Play_On_11: // case PM_Play_On_10: // case PM_Play_On_9: // case PM_Play_On_8: // case PM_Play_On_7: // case PM_Play_On_6: // case PM_Play_On_5: // case PM_Play_On_4: // case PM_Play_On_3: // case PM_Play_On_2: // case PM_Play_On_1: // if(thatPM == mWorldState.GetPlayMode()){ // cout << "PASSED...\n"; // reward = 0; // } else reward = -5; // break; // default: // reward = 0; // break; // } // qTable[thatState][thatAction] = learn(qTable[thatState][thatAction], qTable[curState][actionToTake], reward); // } mAgent.lastActions.push_back(actionToTake); mAgent.lastActionsState.push_back(curState); PlayMode pm = mWorldState.GetPlayMode(); ServerPlayMode spm = SPM_Null; switch (pm) { case PM_Goal_Opps: spm = SPM_Goal_Train; break; case PM_Captured: spm = SPM_Captured; break; case PM_OutOfBounds: spm = SPM_OutOfBounds; break; case PM_Play_On_11: spm = SPM_PlayOn_11; break; case PM_Play_On_10: spm = SPM_PlayOn_1; break; case PM_Play_On_9: spm = SPM_PlayOn_9; break; case PM_Play_On_8: spm = SPM_PlayOn_8; break; case PM_Play_On_7: spm = SPM_PlayOn_7; break; case PM_Play_On_6: spm = SPM_PlayOn_6; break; case PM_Play_On_5: spm = SPM_PlayOn_5; break; case PM_Play_On_4: spm = SPM_PlayOn_4; break; case PM_Play_On_3: spm = SPM_PlayOn_3; break; case PM_Play_On_2: spm = SPM_PlayOn_2; break; case PM_Play_On_1: spm = SPM_PlayOn_1; break; default: break; } mAgent.lastActionsPM.push_back(spm); mAgent.cycleCounter++; if (!mActiveBehaviorList.empty()) { mActiveBehaviorList.sort(std::greater<ActiveBehavior>()); behavior_list.push_back(mActiveBehaviorList.front()); if (mActiveBehaviorList.size() > 1) { //允许非最优行为提交视觉请求 double plus = 1.0; ActiveBehaviorPtr it = mActiveBehaviorList.begin(); for (++it; it != mActiveBehaviorList.end(); ++it) { it->SubmitVisualRequest(plus); plus *= 2.0; } } } }
[ "joaopedrofn@gmail.com" ]
joaopedrofn@gmail.com
7879bd6683f9aae4b5877a6e4c80909eb79897c4
94bc03ffdf3291935f07c8bd5fe566269221bf18
/dom/camera/TestGonkCameraHardware.cpp
d3c79e907b75225253f2d2c51fa2616dd58fe137
[]
no_license
testitesti22/palemoon27
7dd331b4ab582b40c2e6b7967a18153259dc5f38
7529dc68e857243d3587ccee6378cc51193b8df5
refs/heads/master
2023-04-09T14:32:33.535467
2021-04-19T03:02:56
2021-04-19T03:02:56
null
0
0
null
null
null
null
UTF-8
C++
false
false
18,334
cpp
/* * Copyright (C) 2013-2015 Mozilla Foundation * * 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 "TestGonkCameraHardware.h" #include "CameraPreferences.h" #include "nsThreadUtils.h" #include "mozilla/dom/EventListenerBinding.h" #include "mozilla/dom/BlobEvent.h" #include "mozilla/dom/ErrorEvent.h" #include "mozilla/dom/CameraFacesDetectedEvent.h" #include "mozilla/dom/CameraStateChangeEvent.h" #include "DOMCameraDetectedFace.h" #include "nsNetUtil.h" #include "nsServiceManagerUtils.h" #include "nsICameraTestHardware.h" using namespace android; using namespace mozilla; using namespace mozilla::dom; #ifndef MOZ_WIDGET_GONK NS_IMPL_ISUPPORTS_INHERITED0(TestGonkCameraHardware, GonkCameraHardware); #endif static void CopyFaceFeature(int32_t (&aDst)[2], bool aExists, const DOMPoint* aSrc) { if (aExists && aSrc) { aDst[0] = static_cast<int32_t>(aSrc->X()); aDst[1] = static_cast<int32_t>(aSrc->Y()); } else { aDst[0] = -2000; aDst[1] = -2000; } } class TestGonkCameraHardwareListener : public nsIDOMEventListener { public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMEVENTLISTENER TestGonkCameraHardwareListener(nsGonkCameraControl* aTarget, nsIThread* aCameraThread) : mTarget(aTarget) , mCameraThread(aCameraThread) { MOZ_COUNT_CTOR(TestGonkCameraHardwareListener); } protected: virtual ~TestGonkCameraHardwareListener() { MOZ_COUNT_DTOR(TestGonkCameraHardwareListener); } nsRefPtr<nsGonkCameraControl> mTarget; nsCOMPtr<nsIThread> mCameraThread; }; NS_IMETHODIMP TestGonkCameraHardwareListener::HandleEvent(nsIDOMEvent* aEvent) { nsString eventType; aEvent->GetType(eventType); DOM_CAMERA_LOGI("Inject '%s' event", NS_ConvertUTF16toUTF8(eventType).get()); if (eventType.EqualsLiteral("focus")) { CameraStateChangeEvent* event = aEvent->InternalDOMEvent()->AsCameraStateChangeEvent(); if (!NS_WARN_IF(!event)) { nsString state; event->GetNewState(state); if (state.EqualsLiteral("focused")) { OnAutoFocusComplete(mTarget, true); } else if (state.EqualsLiteral("unfocused")) { OnAutoFocusComplete(mTarget, false); } else if (state.EqualsLiteral("focusing")) { OnAutoFocusMoving(mTarget, true); } else if (state.EqualsLiteral("not_focusing")) { OnAutoFocusMoving(mTarget, false); } else { DOM_CAMERA_LOGE("Unhandled focus state '%s'\n", NS_ConvertUTF16toUTF8(state).get()); } } } else if (eventType.EqualsLiteral("shutter")) { DOM_CAMERA_LOGI("Inject shutter event"); OnShutter(mTarget); } else if (eventType.EqualsLiteral("picture")) { BlobEvent* event = aEvent->InternalDOMEvent()->AsBlobEvent(); if (!NS_WARN_IF(!event)) { Blob* blob = event->GetData(); if (blob) { static const uint64_t MAX_FILE_SIZE = 2147483647; ErrorResult rv; uint64_t dataLength = blob->GetSize(rv); if (NS_WARN_IF(rv.Failed()) || NS_WARN_IF(dataLength > MAX_FILE_SIZE)) { rv.SuppressException(); return NS_OK; } nsCOMPtr<nsIInputStream> inputStream; blob->GetInternalStream(getter_AddRefs(inputStream), rv); if (NS_WARN_IF(rv.Failed())) { rv.SuppressException(); return NS_OK; } uint8_t* data = new uint8_t[dataLength]; rv = NS_ReadInputStreamToBuffer(inputStream, reinterpret_cast<void**>(&data), static_cast<uint32_t>(dataLength)); if (NS_WARN_IF(rv.Failed())) { rv.SuppressException(); delete [] data; return NS_OK; } OnTakePictureComplete(mTarget, data, dataLength); delete [] data; } else { OnTakePictureComplete(mTarget, nullptr, 0); } } } else if(eventType.EqualsLiteral("error")) { ErrorEvent* event = aEvent->InternalDOMEvent()->AsErrorEvent(); if (!NS_WARN_IF(!event)) { nsString errorType; event->GetMessage(errorType); if (errorType.EqualsLiteral("picture")) { OnTakePictureError(mTarget); } else if (errorType.EqualsLiteral("system")) { if (!NS_WARN_IF(!mCameraThread)) { class DeferredSystemFailure : public nsRunnable { public: DeferredSystemFailure(nsGonkCameraControl* aTarget) : mTarget(aTarget) { } NS_IMETHODIMP Run() { OnSystemError(mTarget, CameraControlListener::kSystemService, 100, 0); return NS_OK; } protected: nsRefPtr<nsGonkCameraControl> mTarget; }; mCameraThread->Dispatch(new DeferredSystemFailure(mTarget), NS_DISPATCH_NORMAL); } } else { DOM_CAMERA_LOGE("Unhandled error event type '%s'\n", NS_ConvertUTF16toUTF8(errorType).get()); } } } else if(eventType.EqualsLiteral("facesdetected")) { CameraFacesDetectedEvent* event = aEvent->InternalDOMEvent()->AsCameraFacesDetectedEvent(); if (!NS_WARN_IF(!event)) { Nullable<nsTArray<nsRefPtr<DOMCameraDetectedFace>>> faces; event->GetFaces(faces); camera_frame_metadata_t metadata; memset(&metadata, 0, sizeof(metadata)); if (faces.IsNull()) { OnFacesDetected(mTarget, &metadata); } else { const nsTArray<nsRefPtr<DOMCameraDetectedFace>>& facesData = faces.Value(); uint32_t i = facesData.Length(); metadata.number_of_faces = i; metadata.faces = new camera_face_t[i]; memset(metadata.faces, 0, sizeof(camera_face_t) * i); while (i > 0) { --i; const nsRefPtr<DOMCameraDetectedFace>& face = facesData[i]; camera_face_t& f = metadata.faces[i]; const DOMRect& bounds = *face->Bounds(); f.rect[0] = static_cast<int32_t>(bounds.Left()); f.rect[1] = static_cast<int32_t>(bounds.Top()); f.rect[2] = static_cast<int32_t>(bounds.Right()); f.rect[3] = static_cast<int32_t>(bounds.Bottom()); CopyFaceFeature(f.left_eye, face->HasLeftEye(), face->GetLeftEye()); CopyFaceFeature(f.right_eye, face->HasRightEye(), face->GetRightEye()); CopyFaceFeature(f.mouth, face->HasMouth(), face->GetMouth()); f.id = face->Id(); f.score = face->Score(); } OnFacesDetected(mTarget, &metadata); delete [] metadata.faces; } } } else { DOM_CAMERA_LOGE("Unhandled injected event '%s'", NS_ConvertUTF16toUTF8(eventType).get()); } return NS_OK; } NS_IMPL_ISUPPORTS(TestGonkCameraHardwareListener, nsIDOMEventListener) class TestGonkCameraHardware::ControlMessage : public nsRunnable { public: ControlMessage(TestGonkCameraHardware* aTestHw) : mTestHw(aTestHw) { } NS_IMETHOD Run() override { if (NS_WARN_IF(!mTestHw)) { return NS_ERROR_INVALID_ARG; } MutexAutoLock lock(mTestHw->mMutex); mTestHw->mStatus = RunInline(); nsresult rv = mTestHw->mCondVar.Notify(); NS_WARN_IF(NS_FAILED(rv)); return NS_OK; } nsresult RunInline() { if (NS_WARN_IF(!mTestHw)) { return NS_ERROR_INVALID_ARG; } nsresult rv; mJSTestWrapper = do_GetService("@mozilla.org/cameratesthardware;1", &rv); if (NS_WARN_IF(NS_FAILED(rv))) { DOM_CAMERA_LOGE("Cannot get camera test service\n"); return rv; } rv = RunImpl(); mJSTestWrapper = nullptr; return rv; } protected: NS_IMETHOD RunImpl() = 0; virtual ~ControlMessage() { } nsCOMPtr<nsICameraTestHardware> mJSTestWrapper; /* Since we block the control thread until we have finished processing the request on the main thread, we know that this pointer will not go out of scope because the control thread and calling class is the owner. */ TestGonkCameraHardware* mTestHw; }; TestGonkCameraHardware::TestGonkCameraHardware(nsGonkCameraControl* aTarget, uint32_t aCameraId, const sp<Camera>& aCamera) : GonkCameraHardware(aTarget, aCameraId, aCamera) , mMutex("TestGonkCameraHardware::mMutex") , mCondVar(mMutex, "TestGonkCameraHardware::mCondVar") { DOM_CAMERA_LOGA("v===== Created TestGonkCameraHardware =====v\n"); DOM_CAMERA_LOGT("%s:%d : this=%p (aTarget=%p)\n", __func__, __LINE__, this, aTarget); MOZ_COUNT_CTOR(TestGonkCameraHardware); mCameraThread = NS_GetCurrentThread(); } TestGonkCameraHardware::~TestGonkCameraHardware() { MOZ_COUNT_DTOR(TestGonkCameraHardware); class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { if (mTestHw->mDomListener) { mTestHw->mDomListener = nullptr; nsresult rv = mJSTestWrapper->SetHandler(nullptr); NS_WARN_IF(NS_FAILED(rv)); } return NS_OK; } }; nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); NS_WARN_IF(NS_FAILED(rv)); DOM_CAMERA_LOGA("^===== Destroyed TestGonkCameraHardware =====^\n"); } nsresult TestGonkCameraHardware::WaitWhileRunningOnMainThread(nsRefPtr<ControlMessage> aRunnable) { MutexAutoLock lock(mMutex); if (NS_WARN_IF(!aRunnable)) { mStatus = NS_ERROR_INVALID_ARG; } else if (!NS_IsMainThread()) { nsresult rv = NS_DispatchToMainThread(aRunnable); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } rv = mCondVar.Wait(); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } } else { /* Cannot dispatch to main thread since we would block on the condvar, so we need to run inline. */ mStatus = aRunnable->RunInline(); } return mStatus; } nsresult TestGonkCameraHardware::Init() { DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { nsresult rv = mJSTestWrapper->InitCamera(); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } mTestHw->mDomListener = new TestGonkCameraHardwareListener(mTestHw->mTarget, mTestHw->mCameraThread); if (NS_WARN_IF(!mTestHw->mDomListener)) { return NS_ERROR_FAILURE; } rv = mJSTestWrapper->SetHandler(mTestHw->mDomListener); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } return NS_OK; } }; nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); NS_WARN_IF(NS_FAILED(rv)); return rv; } int TestGonkCameraHardware::AutoFocus() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->AutoFocus(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } int TestGonkCameraHardware::StartFaceDetection() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->StartFaceDetection(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } int TestGonkCameraHardware::StopFaceDetection() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->StopFaceDetection(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } int TestGonkCameraHardware::TakePicture() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->TakePicture(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } void TestGonkCameraHardware::CancelTakePicture() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->CancelTakePicture(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); NS_WARN_IF(NS_FAILED(rv)); } int TestGonkCameraHardware::StartPreview() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->StartPreview(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } void TestGonkCameraHardware::StopPreview() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->StopPreview(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); NS_WARN_IF(NS_FAILED(rv)); } class TestGonkCameraHardware::PushParametersDelegate : public ControlMessage { public: PushParametersDelegate(TestGonkCameraHardware* aTestHw, String8* aParams) : ControlMessage(aTestHw) , mParams(aParams) { } protected: NS_IMETHOD RunImpl() override { if (NS_WARN_IF(!mParams)) { return NS_ERROR_INVALID_ARG; } DOM_CAMERA_LOGI("Push test parameters: %s\n", mParams->string()); return mJSTestWrapper->PushParameters(NS_ConvertASCIItoUTF16(mParams->string())); } String8* mParams; }; class TestGonkCameraHardware::PullParametersDelegate : public ControlMessage { public: PullParametersDelegate(TestGonkCameraHardware* aTestHw, nsString* aParams) : ControlMessage(aTestHw) , mParams(aParams) { } protected: NS_IMETHOD RunImpl() override { if (NS_WARN_IF(!mParams)) { return NS_ERROR_INVALID_ARG; } nsresult rv = mJSTestWrapper->PullParameters(*mParams); DOM_CAMERA_LOGI("Pull test parameters: %s\n", NS_LossyConvertUTF16toASCII(*mParams).get()); return rv; } nsString* mParams; }; int TestGonkCameraHardware::PushParameters(const GonkCameraParameters& aParams) { DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); String8 s = aParams.Flatten(); nsresult rv = WaitWhileRunningOnMainThread(new PushParametersDelegate(this, &s)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } nsresult TestGonkCameraHardware::PullParameters(GonkCameraParameters& aParams) { DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsString as; nsresult rv = WaitWhileRunningOnMainThread(new PullParametersDelegate(this, &as)); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } String8 s(NS_LossyConvertUTF16toASCII(as).get()); aParams.Unflatten(s); return NS_OK; } #ifdef MOZ_WIDGET_GONK int TestGonkCameraHardware::PushParameters(const CameraParameters& aParams) { DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); String8 s = aParams.flatten(); nsresult rv = WaitWhileRunningOnMainThread(new PushParametersDelegate(this, &s)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } void TestGonkCameraHardware::PullParameters(CameraParameters& aParams) { DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsString as; nsresult rv = WaitWhileRunningOnMainThread(new PullParametersDelegate(this, &as)); if (NS_WARN_IF(NS_FAILED(rv))) { as.Truncate(); } String8 s(NS_LossyConvertUTF16toASCII(as).get()); aParams.unflatten(s); } #endif int TestGonkCameraHardware::StartRecording() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->StartRecording(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } int TestGonkCameraHardware::StopRecording() { class Delegate : public ControlMessage { public: Delegate(TestGonkCameraHardware* aTestHw) : ControlMessage(aTestHw) { } protected: NS_IMETHOD RunImpl() override { return mJSTestWrapper->StopRecording(); } }; DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); nsresult rv = WaitWhileRunningOnMainThread(new Delegate(this)); if (NS_WARN_IF(NS_FAILED(rv))) { return UNKNOWN_ERROR; } return OK; } int TestGonkCameraHardware::StoreMetaDataInBuffers(bool aEnabled) { DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__); return OK; }
[ "roytam@gmail.com" ]
roytam@gmail.com
d4b1e8137c4a3a887dc890bdf4d108c25603811f
87a953395833e367ad2c4394fbbd68bff7cd5686
/Pibrary/include/INIReader.h
95be262433e3fc759dc013b6bcae0957159a2e6f
[]
no_license
Gurman8r/Pi
1232833302b5755f3bee9dfba0ef6a4f4d0e3290
e4e505c9cd8b7a2fa9bd286082d1ef72dabc7c67
refs/heads/master
2020-03-22T08:28:16.763142
2018-09-05T14:45:32
2018-09-05T14:45:32
139,768,350
0
0
null
null
null
null
UTF-8
C++
false
false
12,058
h
// Read an INI file into easy-to-access name/value pairs. // inih and INIReader are released under the New BSD license (see LICENSE.txt). // Go to the project home page for more info: // // https://github.com/benhoyt/inih /* inih -- simple .INI file parser inih is released under the New BSD license (see LICENSE.txt). Go to the project home page for more info: https://github.com/benhoyt/inih */ #ifndef __INI_H__ #define __INI_H__ /* Make this header file easier to include in C++ code */ #ifdef __cplusplus extern "C" { #endif #include <stdio.h> /* Typedef for prototype of handler function. */ typedef int(*ini_handler)(void* user, const char* section, const char* name, const char* value); /* Typedef for prototype of fgets-style reader function. */ typedef char* (*ini_reader)(char* str, int num, void* stream); /* Parse given INI-style file. May have [section]s, name=value pairs (whitespace stripped), and comments starting with ';' (semicolon). Section is "" if name=value pair parsed before any section heading. name:value pairs are also supported as a concession to Python's configparser. For each name=value pair parsed, call handler function with given user pointer as well as section, name, and value (data only valid for duration of handler call). Handler should return nonzero on success, zero on error. Returns 0 on success, line number of first error on parse error (doesn't stop on first error), -1 on file open error, or -2 on memory allocation error (only when INI_USE_STACK is zero). */ int ini_parse(const char* filename, ini_handler handler, void* user); /* Same as ini_parse(), but takes a FILE* instead of filename. This doesn't close the file when it's finished -- the caller must do that. */ int ini_parse_file(FILE* file, ini_handler handler, void* user); /* Same as ini_parse(), but takes an ini_reader function pointer instead of filename. Used for implementing custom or string-based I/O. */ int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler, void* user); /* Nonzero to allow multi-line value parsing, in the style of Python's configparser. If allowed, ini_parse() will call the handler with the same name for each subsequent line parsed. */ #ifndef INI_ALLOW_MULTILINE #define INI_ALLOW_MULTILINE 1 #endif /* Nonzero to allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of the file. See http://code.google.com/p/inih/issues/detail?id=21 */ #ifndef INI_ALLOW_BOM #define INI_ALLOW_BOM 1 #endif /* Nonzero to allow inline comments (with valid inline comment characters specified by INI_INLINE_COMMENT_PREFIXES). Set to 0 to turn off and match Python 3.2+ configparser behaviour. */ #ifndef INI_ALLOW_INLINE_COMMENTS #define INI_ALLOW_INLINE_COMMENTS 1 #endif #ifndef INI_INLINE_COMMENT_PREFIXES #define INI_INLINE_COMMENT_PREFIXES ";" #endif /* Nonzero to use stack, zero to use heap (malloc/free). */ #ifndef INI_USE_STACK #define INI_USE_STACK 1 #endif /* Stop parsing on first error (default is to keep parsing). */ #ifndef INI_STOP_ON_FIRST_ERROR #define INI_STOP_ON_FIRST_ERROR 0 #endif /* Maximum line length for any line in INI file. */ #ifndef INI_MAX_LINE #define INI_MAX_LINE 200 #endif #ifdef __cplusplus } #endif /* inih -- simple .INI file parser inih is released under the New BSD license (see LICENSE.txt). Go to the project home page for more info: https://github.com/benhoyt/inih */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS #endif #include <stdio.h> #include <ctype.h> #include <string.h> #if !INI_USE_STACK #include <stdlib.h> #endif #define MAX_SECTION 50 #define MAX_NAME 50 /* Strip whitespace chars off end of given string, in place. Return s. */ inline static char* rstrip(char* s) { char* p = s + strlen(s); while (p > s && isspace((unsigned char)(*--p))) *p = '\0'; return s; } /* Return pointer to first non-whitespace char in given string. */ inline static char* lskip(const char* s) { while (*s && isspace((unsigned char)(*s))) s++; return (char*)s; } /* Return pointer to first char (of chars) or inline comment in given string, or pointer to null at end of string if neither found. Inline comment must be prefixed by a whitespace character to register as a comment. */ inline static char* find_chars_or_comment(const char* s, const char* chars) { #if INI_ALLOW_INLINE_COMMENTS int was_space = 0; while (*s && (!chars || !strchr(chars, *s)) && !(was_space && strchr(INI_INLINE_COMMENT_PREFIXES, *s))) { was_space = isspace((unsigned char)(*s)); s++; } #else while (*s && (!chars || !strchr(chars, *s))) { s++; } #endif return (char*)s; } /* Version of strncpy that ensures dest (size bytes) is null-terminated. */ inline static char* strncpy0(char* dest, const char* src, size_t size) { strncpy(dest, src, size); dest[size - 1] = '\0'; return dest; } /* See documentation in header file. */ inline int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler, void* user) { /* Uses a fair bit of stack (use heap instead if you need to) */ #if INI_USE_STACK char line[INI_MAX_LINE]; #else char* line; #endif char section[MAX_SECTION] = ""; char prev_name[MAX_NAME] = ""; char* start; char* end; char* name; char* value; int lineno = 0; int error = 0; #if !INI_USE_STACK line = (char*)malloc(INI_MAX_LINE); if (!line) { return -2; } #endif /* Scan through stream line by line */ while (reader(line, INI_MAX_LINE, stream) != NULL) { lineno++; start = line; #if INI_ALLOW_BOM if (lineno == 1 && (unsigned char)start[0] == 0xEF && (unsigned char)start[1] == 0xBB && (unsigned char)start[2] == 0xBF) { start += 3; } #endif start = lskip(rstrip(start)); if (*start == ';' || *start == '#') { /* Per Python configparser, allow both ; and # comments at the start of a line */ } #if INI_ALLOW_MULTILINE else if (*prev_name && *start && start > line) { #if INI_ALLOW_INLINE_COMMENTS end = find_chars_or_comment(start, NULL); if (*end) *end = '\0'; rstrip(start); #endif /* Non-blank line with leading whitespace, treat as continuation of previous name's value (as per Python configparser). */ if (!handler(user, section, prev_name, start) && !error) error = lineno; } #endif else if (*start == '[') { /* A "[section]" line */ end = find_chars_or_comment(start + 1, "]"); if (*end == ']') { *end = '\0'; strncpy0(section, start + 1, sizeof(section)); *prev_name = '\0'; } else if (!error) { /* No ']' found on section line */ error = lineno; } } else if (*start) { /* Not a comment, must be a name[=:]value pair */ end = find_chars_or_comment(start, "=:"); if (*end == '=' || *end == ':') { *end = '\0'; name = rstrip(start); value = lskip(end + 1); #if INI_ALLOW_INLINE_COMMENTS end = find_chars_or_comment(value, NULL); if (*end) *end = '\0'; #endif rstrip(value); /* Valid name[=:]value pair found, call handler */ strncpy0(prev_name, name, sizeof(prev_name)); if (!handler(user, section, name, value) && !error) error = lineno; } else if (!error) { /* No '=' or ':' found on name[=:]value line */ error = lineno; } } #if INI_STOP_ON_FIRST_ERROR if (error) break; #endif } #if !INI_USE_STACK free(line); #endif return error; } /* See documentation in header file. */ inline int ini_parse_file(FILE* file, ini_handler handler, void* user) { return ini_parse_stream((ini_reader)fgets, file, handler, user); } /* See documentation in header file. */ inline int ini_parse(const char* filename, ini_handler handler, void* user) { FILE* file; int error; file = fopen(filename, "r"); if (!file) return -1; error = ini_parse_file(file, handler, user); fclose(file); return error; } #endif /* __INI_H__ */ #ifndef __INIREADER_H__ #define __INIREADER_H__ #include <map> #include <set> #include <string> // Read an INI file into easy-to-access name/value pairs. (Note that I've gone // for simplicity here rather than speed, but it should be pretty decent.) class INIReader { public: // Empty Constructor INIReader() {}; // Construct INIReader and parse given filename. See ini.h for more info // about the parsing. INIReader(std::string filename); // Return the result of ini_parse(), i.e., 0 on success, line number of // first error on parse error, or -1 on file open error. int ParseError() const; // Return the list of sections found in ini file std::set<std::string> Sections(); // Get a string value from INI file, returning default_value if not found. std::string Get(std::string section, std::string name, std::string default_value); // Get an integer (long) value from INI file, returning default_value if // not found or not a valid integer (decimal "1234", "-1234", or hex "0x4d2"). long GetInteger(std::string section, std::string name, long default_value); // Get a real (floating point double) value from INI file, returning // default_value if not found or not a valid floating point value // according to strtod(). double GetReal(std::string section, std::string name, double default_value); // Get a boolean value from INI file, returning default_value if not found or if // not a valid true/false value. Valid true values are "true", "yes", "on", "1", // and valid false values are "false", "no", "off", "0" (not case sensitive). bool GetBoolean(std::string section, std::string name, bool default_value); private: int _error; std::map<std::string, std::string> _values; std::set<std::string> _sections; static std::string MakeKey(std::string section, std::string name); static int ValueHandler(void* user, const char* section, const char* name, const char* value); }; #endif // __INIREADER_H__ #ifndef __INIREADER__ #define __INIREADER__ #include <algorithm> #include <cctype> #include <cstdlib> using std::string; inline INIReader::INIReader(string filename) { _error = ini_parse(filename.c_str(), ValueHandler, this); } inline int INIReader::ParseError() const { return _error; } inline std::set<string> INIReader::Sections() { return _sections; } inline string INIReader::Get(string section, string name, string default_value) { string key = MakeKey(section, name); return _values.count(key) ? _values[key] : default_value; } inline long INIReader::GetInteger(string section, string name, long default_value) { string valstr = Get(section, name, ""); const char* value = valstr.c_str(); char* end; // This parses "1234" (decimal) and also "0x4D2" (hex) long n = strtol(value, &end, 0); return end > value ? n : default_value; } inline double INIReader::GetReal(string section, string name, double default_value) { string valstr = Get(section, name, ""); const char* value = valstr.c_str(); char* end; double n = strtod(value, &end); return end > value ? n : default_value; } inline bool INIReader::GetBoolean(string section, string name, bool default_value) { string valstr = Get(section, name, ""); // Convert to lower case to make string comparisons case-insensitive std::transform(valstr.begin(), valstr.end(), valstr.begin(), ::tolower); if (valstr == "true" || valstr == "yes" || valstr == "on" || valstr == "1") return true; else if (valstr == "false" || valstr == "no" || valstr == "off" || valstr == "0") return false; else return default_value; } inline string INIReader::MakeKey(string section, string name) { string key = section + "=" + name; // Convert to lower case to make section/name lookups case-insensitive std::transform(key.begin(), key.end(), key.begin(), ::tolower); return key; } inline int INIReader::ValueHandler(void* user, const char* section, const char* name, const char* value) { INIReader* reader = (INIReader*)user; string key = MakeKey(section, name); if (reader->_values[key].size() > 0) reader->_values[key] += "\n"; reader->_values[key] += value; reader->_sections.insert(section); return 1; } #endif // __INIREADER__
[ "gurman8r@gmail.com" ]
gurman8r@gmail.com
2b349f670ef7f04de40c29369e8175ceb26c95de
5447b996093629956847d692aa1f92f7bb48ad92
/ROS/stuff/sweepServos/src/sweepServos.ino
42fd6818601b50a417eb8359eca8e3a0aa122515
[]
no_license
AndreasGerken/selfRegulation
ff6f31544eade0880c0b8ee59672c389d336339f
7f41d7c0270f2c0e61744e9cb0fd57dda6c630d2
refs/heads/master
2021-01-13T01:08:10.076866
2017-05-26T13:39:00
2017-05-26T13:39:00
81,458,302
0
0
null
null
null
null
UTF-8
C++
false
false
1,389
ino
/* Sweep by BARRAGAN <http://barraganstudio.com> This example code is in the public domain. modified 8 Nov 2013 by Scott Fitzgerald http://www.arduino.cc/en/Tutorial/Sweep */ #include <Servo.h> #define SERVO_PIN 9 #define SERVO_PIN2 5 Servo myservo; // create servo object to control a servo Servo myservo2; // create servo object to control a servo // twelve servo objects can be created on most boards int pos = 0; // variable to store the servo position void setup() { myservo.attach(SERVO_PIN); // attaches the servo on pin 9 to the servo object myservo2.attach(SERVO_PIN2); // attaches the servo on pin 9 to the servo object } void loop() { for (pos = 30; pos <= 150; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' myservo2.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for (pos = 150; pos >= 30; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' myservo2.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } }
[ "andi.gerken@gmail.com" ]
andi.gerken@gmail.com
2412526d0478dfd43e0321e220094123c3417324
f313c6df81673cfb79c478359d00aad4a38d4c54
/sb-movie-demo-ps2/SB04_Multi_Sku/Engine/Game/zPickupTable.cpp
495af78fe9631dbb06addbcf683347711f022ae0
[]
no_license
seilweiss/dwarfdb
2ee1a1d748d83f6d14413bd58312c99059af99bc
9afc2132cd69f11ed6e69bd4b2b67805bc1828b9
refs/heads/main
2023-08-14T23:48:48.254038
2021-10-07T05:40:50
2021-10-07T05:40:50
414,475,004
2
0
null
null
null
null
UTF-8
C++
false
false
549
cpp
void zPickupTableInit(); // zPickupTableInit__Fv // Start address: 0x30de00 void zPickupTableInit() { zAssetPickup* ptbl; uint32 i; uint32 j; // Line 48, Address: 0x30de00, Func Offset: 0 // Line 52, Address: 0x30de04, Func Offset: 0x4 // Line 48, Address: 0x30de08, Func Offset: 0x8 // Line 63, Address: 0x30de18, Func Offset: 0x18 // Line 52, Address: 0x30de1c, Func Offset: 0x1c // Line 63, Address: 0x30de20, Func Offset: 0x20 // Line 90, Address: 0x30de30, Func Offset: 0x30 // Func End, Address: 0x30def0, Func Offset: 0xf0 }
[ "32021834+seilweiss@users.noreply.github.com" ]
32021834+seilweiss@users.noreply.github.com
b4a817413cb2d17ed84ffdbc20175623c72ffacb
28a0090863d4bc49106240a5c94eb88f7c860a49
/base/filerotatingstream.cc
7b3c1672b93b58412b39728a6bee514142436df1
[]
no_license
luohuanjun123/ProjKits
284d26b19ed7dd72e7fc10ffc4ad9d8801efc25b
2a29ec34c2396d3b35cecd17bcb0a1370b727d46
refs/heads/master
2021-01-17T08:37:58.566717
2016-07-17T10:39:04
2016-07-17T10:39:04
63,526,382
0
0
null
null
null
null
UTF-8
C++
false
false
12,495
cc
/* * Copyright 2015 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "base/filerotatingstream.h" #include <algorithm> #include <iostream> #include <string> #include "base/checks.h" #include "base/fileutils.h" #include "base/pathutils.h" // Note: We use std::cerr for logging in the write paths of this stream to avoid // infinite loops when logging. namespace rtc { FileRotatingStream::FileRotatingStream(const std::string& dir_path, const std::string& file_prefix) : FileRotatingStream(dir_path, file_prefix, 0, 0, kRead) { } FileRotatingStream::FileRotatingStream(const std::string& dir_path, const std::string& file_prefix, size_t max_file_size, size_t num_files) : FileRotatingStream(dir_path, file_prefix, max_file_size, num_files, kWrite) { RTC_DCHECK_GT(max_file_size, 0u); RTC_DCHECK_GT(num_files, 1u); } FileRotatingStream::FileRotatingStream(const std::string& dir_path, const std::string& file_prefix, size_t max_file_size, size_t num_files, Mode mode) : dir_path_(dir_path), file_prefix_(file_prefix), mode_(mode), file_stream_(nullptr), max_file_size_(max_file_size), current_file_index_(0), rotation_index_(0), current_bytes_written_(0), disable_buffering_(false) { RTC_DCHECK(Filesystem::IsFolder(dir_path)); switch (mode) { case kWrite: { file_names_.clear(); for (size_t i = 0; i < num_files; ++i) { file_names_.push_back(GetFilePath(i, num_files)); } rotation_index_ = num_files - 1; break; } case kRead: { file_names_ = GetFilesWithPrefix(); std::sort(file_names_.begin(), file_names_.end()); if (file_names_.size() > 0) { // |file_names_| is sorted newest first, so read from the end. current_file_index_ = file_names_.size() - 1; } break; } } } FileRotatingStream::~FileRotatingStream() { } StreamState FileRotatingStream::GetState() const { if (mode_ == kRead && current_file_index_ < file_names_.size()) { return SS_OPEN; } if (!file_stream_) { return SS_CLOSED; } return file_stream_->GetState(); } StreamResult FileRotatingStream::Read(void* buffer, size_t buffer_len, size_t* read, int* error) { RTC_DCHECK(buffer); if (mode_ != kRead) { return SR_EOS; } if (current_file_index_ >= file_names_.size()) { return SR_EOS; } // We will have no file stream initially, and when we are finished with the // previous file. if (!file_stream_) { if (!OpenCurrentFile()) { return SR_ERROR; } } int local_error = 0; if (!error) { error = &local_error; } StreamResult result = file_stream_->Read(buffer, buffer_len, read, error); if (result == SR_EOS || result == SR_ERROR) { if (result == SR_ERROR) { LOG(LS_ERROR) << "Failed to read from: " << file_names_[current_file_index_] << "Error: " << error; } // Reached the end of the file, read next file. If there is an error return // the error status but allow for a next read by reading next file. CloseCurrentFile(); if (current_file_index_ == 0) { // Just finished reading the last file, signal EOS by setting index. current_file_index_ = file_names_.size(); } else { --current_file_index_; } if (read) { *read = 0; } return result == SR_EOS ? SR_SUCCESS : result; } else if (result == SR_SUCCESS) { // Succeeded, continue reading from this file. return SR_SUCCESS; } else { RTC_NOTREACHED(); } return result; } StreamResult FileRotatingStream::Write(const void* data, size_t data_len, size_t* written, int* error) { if (mode_ != kWrite) { return SR_EOS; } if (!file_stream_) { std::cerr << "Open() must be called before Write." << std::endl; return SR_ERROR; } // Write as much as will fit in to the current file. RTC_DCHECK_LT(current_bytes_written_, max_file_size_); size_t remaining_bytes = max_file_size_ - current_bytes_written_; size_t write_length = std::min<size_t>(data_len, remaining_bytes); size_t local_written = 0; if (!written) { written = &local_written; } StreamResult result = file_stream_->Write(data, write_length, written, error); current_bytes_written_ += *written; // If we're done with this file, rotate it out. if (current_bytes_written_ >= max_file_size_) { RTC_DCHECK_EQ(current_bytes_written_, max_file_size_); RotateFiles(); } return result; } bool FileRotatingStream::Flush() { if (!file_stream_) { return false; } return file_stream_->Flush(); } bool FileRotatingStream::GetSize(size_t* size) const { if (mode_ != kRead) { // Not possible to get accurate size on disk when writing because of // potential buffering. return false; } RTC_DCHECK(size); *size = 0; size_t total_size = 0; for (auto file_name : file_names_) { Pathname pathname(file_name); size_t file_size = 0; if (Filesystem::GetFileSize(file_name, &file_size)) { total_size += file_size; } } *size = total_size; return true; } void FileRotatingStream::Close() { CloseCurrentFile(); } bool FileRotatingStream::Open() { switch (mode_) { case kRead: // Defer opening to when we first read since we want to return read error // if we fail to open next file. return true; case kWrite: { // Delete existing files when opening for write. std::vector<std::string> matching_files = GetFilesWithPrefix(); for (auto matching_file : matching_files) { if (!Filesystem::DeleteFile(matching_file)) { std::cerr << "Failed to delete: " << matching_file << std::endl; } } return OpenCurrentFile(); } } return false; } bool FileRotatingStream::DisableBuffering() { disable_buffering_ = true; if (!file_stream_) { std::cerr << "Open() must be called before DisableBuffering()." << std::endl; return false; } return file_stream_->DisableBuffering(); } std::string FileRotatingStream::GetFilePath(size_t index) const { RTC_DCHECK_LT(index, file_names_.size()); return file_names_[index]; } bool FileRotatingStream::OpenCurrentFile() { CloseCurrentFile(); // Opens the appropriate file in the appropriate mode. RTC_DCHECK_LT(current_file_index_, file_names_.size()); std::string file_path = file_names_[current_file_index_]; file_stream_.reset(new FileStream()); const char* mode = nullptr; switch (mode_) { case kWrite: mode = "w+"; // We should always we writing to the zero-th file. RTC_DCHECK_EQ(current_file_index_, 0u); break; case kRead: mode = "r"; break; } int error = 0; if (!file_stream_->Open(file_path, mode, &error)) { std::cerr << "Failed to open: " << file_path << "Error: " << error << std::endl; file_stream_.reset(); return false; } if (disable_buffering_) { file_stream_->DisableBuffering(); } return true; } void FileRotatingStream::CloseCurrentFile() { if (!file_stream_) { return; } current_bytes_written_ = 0; file_stream_.reset(); } void FileRotatingStream::RotateFiles() { RTC_DCHECK_EQ(mode_, kWrite); CloseCurrentFile(); // Rotates the files by deleting the file at |rotation_index_|, which is the // oldest file and then renaming the newer files to have an incremented index. // See header file comments for example. RTC_DCHECK_LE(rotation_index_, file_names_.size()); std::string file_to_delete = file_names_[rotation_index_]; if (Filesystem::IsFile(file_to_delete)) { if (!Filesystem::DeleteFile(file_to_delete)) { std::cerr << "Failed to delete: " << file_to_delete << std::endl; } } for (auto i = rotation_index_; i > 0; --i) { std::string rotated_name = file_names_[i]; std::string unrotated_name = file_names_[i - 1]; if (Filesystem::IsFile(unrotated_name)) { if (!Filesystem::MoveFile(unrotated_name, rotated_name)) { std::cerr << "Failed to move: " << unrotated_name << " to " << rotated_name << std::endl; } } } // Create a new file for 0th index. OpenCurrentFile(); OnRotation(); } std::vector<std::string> FileRotatingStream::GetFilesWithPrefix() const { std::vector<std::string> files; // Iterate over the files in the directory. DirectoryIterator it; Pathname dir_path; dir_path.SetFolder(dir_path_); if (!it.Iterate(dir_path)) { return files; } do { std::string current_name = it.Name(); if (current_name.size() && !it.IsDirectory() && current_name.compare(0, file_prefix_.size(), file_prefix_) == 0) { Pathname path(dir_path_, current_name); files.push_back(path.pathname()); } } while (it.Next()); return files; } std::string FileRotatingStream::GetFilePath(size_t index, size_t num_files) const { RTC_DCHECK_LT(index, num_files); std::ostringstream file_name; // The format will be "_%<num_digits>zu". We want to zero pad the index so // that it will sort nicely. size_t max_digits = ((num_files - 1) / 10) + 1; size_t num_digits = (index / 10) + 1; RTC_DCHECK_LE(num_digits, max_digits); size_t padding = max_digits - num_digits; file_name << file_prefix_ << "_"; for (size_t i = 0; i < padding; ++i) { file_name << "0"; } file_name << index; Pathname file_path(dir_path_, file_name.str()); return file_path.pathname(); } CallSessionFileRotatingStream::CallSessionFileRotatingStream( const std::string& dir_path) : FileRotatingStream(dir_path, kLogPrefix), max_total_log_size_(0), num_rotations_(0) { } CallSessionFileRotatingStream::CallSessionFileRotatingStream( const std::string& dir_path, size_t max_total_log_size) : FileRotatingStream(dir_path, kLogPrefix, max_total_log_size / 2, GetNumRotatingLogFiles(max_total_log_size) + 1), max_total_log_size_(max_total_log_size), num_rotations_(0) { RTC_DCHECK_GE(max_total_log_size, 4u); } const char* CallSessionFileRotatingStream::kLogPrefix = "webrtc_log"; const size_t CallSessionFileRotatingStream::kRotatingLogFileDefaultSize = 1024 * 1024; void CallSessionFileRotatingStream::OnRotation() { ++num_rotations_; if (num_rotations_ == 1) { // On the first rotation adjust the max file size so subsequent files after // the first are smaller. SetMaxFileSize(GetRotatingLogSize(max_total_log_size_)); } else if (num_rotations_ == (GetNumFiles() - 1)) { // On the next rotation the very first file is going to be deleted. Change // the rotation index so this doesn't happen. SetRotationIndex(GetRotationIndex() - 1); } } size_t CallSessionFileRotatingStream::GetRotatingLogSize( size_t max_total_log_size) { size_t num_rotating_log_files = GetNumRotatingLogFiles(max_total_log_size); size_t rotating_log_size = num_rotating_log_files > 2 ? kRotatingLogFileDefaultSize : max_total_log_size / 4; return rotating_log_size; } size_t CallSessionFileRotatingStream::GetNumRotatingLogFiles( size_t max_total_log_size) { // At minimum have two rotating files. Otherwise split the available log size // evenly across 1MB files. return std::max<int>((size_t)2, (max_total_log_size / 2) / kRotatingLogFileDefaultSize); } } // namespace rtc
[ "luohuanjun@xuexibao.cn" ]
luohuanjun@xuexibao.cn
9659efeb17619cfaada832af8c4a75dbf94cb537
777c71c2721bda3bf45b9600f54e226d1595a967
/JCudaCommonJNI/src/Logger.cpp
12517882f0b0a709146406bec0bd1214ef8f2545
[ "MIT" ]
permissive
kiszk/jcuda-common
44ac2810d3e87c6b032f3bda273bc7ffd8397c7c
f9a6079fa0745865a64e1d45acca5d67d08fa77d
refs/heads/master
2021-01-15T09:56:48.368968
2017-02-24T17:25:23
2017-02-24T17:25:23
43,773,145
1
0
null
2015-10-06T19:22:18
2015-10-06T19:22:18
null
UTF-8
C++
false
false
1,732
cpp
/* * JCuda - Java bindings for NVIDIA CUDA driver and runtime API * * Copyright (c) 2009-2015 Marco Hutter - http://www.jcuda.org * * 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 "Logger.hpp" #include <cstdio> LogLevel Logger::currentLogLevel = LOG_ERROR; //LogLevel Logger::currentLogLevel = LOG_DEBUGTRACE;; void Logger::log(LogLevel level, const char *message, ...) { if (level <= Logger::currentLogLevel) { va_list argp; va_start(argp, message); vfprintf(stdout, message, argp); va_end(argp); } } void Logger::setLogLevel(LogLevel level) { Logger::currentLogLevel = level; }
[ "jcuda@jcuda.org" ]
jcuda@jcuda.org
928b5452a638a8d7405ebe03008a99ec51d6611d
9030ce2789a58888904d0c50c21591632eddffd7
/SDK/ARKSurvivalEvolved_BogSpider_AnimBlueprint_classes.hpp
53e5536b31dd349c326625f92e70d176923112e5
[ "MIT" ]
permissive
2bite/ARK-SDK
8ce93f504b2e3bd4f8e7ced184980b13f127b7bf
ce1f4906ccf82ed38518558c0163c4f92f5f7b14
refs/heads/master
2022-09-19T06:28:20.076298
2022-09-03T17:21:00
2022-09-03T17:21:00
232,411,353
14
5
null
null
null
null
UTF-8
C++
false
false
131,181
hpp
#pragma once // ARKSurvivalEvolved (332.8) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "ARKSurvivalEvolved_BogSpider_AnimBlueprint_structs.hpp" namespace sdk { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // AnimBlueprintGeneratedClass BogSpider_AnimBlueprint.BogSpider_AnimBlueprint_C // 0x45B8 (0x48F8 - 0x0340) class UBogSpider_AnimBlueprint_C : public UAnimInstance { public: struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_3859CC30468EB3FDC5555B9B5A6A73D9;// 0x0340(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_A5B2B62F41A0740F356D0DACB08BE2AC;// 0x03A0(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_7F6B34D14CB4BBA1EB1D0DB2717BA93E;// 0x0400(0x0060) struct FAnimNode_ConvertComponentToLocalSpace AnimGraphNode_ComponentToLocalSpace_50B9857C4DE2389EDE63969A147CE05C;// 0x0460(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_24902DAD496B043FB131C89233CD6F42;// 0x0488(0x0028) struct FAnimNode_ConvertLocalToComponentSpace AnimGraphNode_LocalToComponentSpace_6EB5B9944848B3C1731B529C24B3F181;// 0x04B0(0x0028) unsigned char UnknownData00[0x8]; // 0x04D8(0x0008) MISSED OFFSET struct FAnimNode_ModifyBone AnimGraphNode_ModifyBone_D02B2E214FB791667D0FECA6282E1A0B;// 0x04E0(0x00B0) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_765C4032498C7524786B49ABD1CD93C7;// 0x0590(0x0060) struct FAnimNode_MultiFabrik_Dinos AnimGraphNode_MultiFabrik_Dinos_EEE7045243EB1B3E33632492A732BD66;// 0x05F0(0x0058) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_C058A092475494E42D4938861A80AEAF;// 0x0648(0x0060) struct FAnimNode_GroundBones AnimGraphNode_GroundBones_2054029E47AB4071619B37933801327E;// 0x06A8(0x00B8) struct FAnimNode_GroundBones AnimGraphNode_GroundBones_9C8636E24027868058CB5F916EEA68A1;// 0x0760(0x00B8) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_E5C27BA2405200F3840C7F98407DAB18;// 0x0818(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_9708D3D04E08CDBE0E8D098E1AB08210;// 0x0878(0x0060) struct FAnimNode_ConvertComponentToLocalSpace AnimGraphNode_ComponentToLocalSpace_431E8BD2436C014FA58620A5BAAE5328;// 0x08D8(0x0028) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_A9D7F65848B505A5E04B09BB8063D88F;// 0x0900(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_C64B843D4B822CB2A2609C88440B33A1;// 0x0940(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_07EF294246432882FE4C349DFCCB1A0E;// 0x0968(0x0028) struct FAnimNode_ConvertLocalToComponentSpace AnimGraphNode_LocalToComponentSpace_E0E711F448A34AC25211AB9C69DE3ADD;// 0x0990(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_2638F2D7460BE0D20FF245B8BE033736;// 0x09B8(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_330DBFC3422A1F21B65EC2A940164A9A;// 0x0A18(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_5F5DC67C4FACD3BE735A3A9BCB5C93EE;// 0x0A48(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_4039B3FA468A347B00B5D0A8CD880804;// 0x0A78(0x0030) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_1A1ECF104548E0640B62C8B4AC3F78A2;// 0x0AA8(0x0040) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_23F2333F4A233150FEE273B29642AF37;// 0x0AE8(0x0030) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_14CB097B4CE66E925DD2AAB284EE7B94;// 0x0B18(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_E286587F4C6E84B704BCFF99B7C01A43;// 0x0B58(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_E0F05F5D4757249F2384FEBF499B06FD;// 0x0B80(0x0028) struct FAnimNode_RotationOffsetBlendSpace AnimGraphNode_RotationOffsetBlendSpace_58AD9C884F39F685977AE681182F6F43;// 0x0BA8(0x00F8) struct FAnimNode_RotationOffsetBlendSpace AnimGraphNode_RotationOffsetBlendSpace_F987A5FD45515209A1BEBA93E8887947;// 0x0CA0(0x00F8) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_271494B84570F95595631FA80BEC446D;// 0x0D98(0x0060) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_ECC5BEA54FB9EA08C6330381803EA7AF;// 0x0DF8(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_A842A8D942D7437CC70A89A0397A9242;// 0x0E20(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_DED8FD3B46438C597138B59CB3E2E07D;// 0x0E48(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_86FA9C684AEF140617583BA376F915AD;// 0x0EA8(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_407899AF482025D7CE8107BBCB1D8125;// 0x0F08(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_55C7594E43F9B49DE665A1BF5C2A6B25;// 0x0F68(0x0060) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_86BF610448C6F441E8B33D8169EAE632;// 0x0FC8(0x00E0) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_A6BECED9411AF2DA26FB6D92626C0BD5;// 0x10A8(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_39F1A6E34E63DF9961E2DAB52E167EB6;// 0x1108(0x0030) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_1F6DF4BB4EF6DDC4F795D9AE2DC814DE;// 0x1138(0x0060) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_E04B4AD24F873F700019A9A62CA05472;// 0x1198(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_66B5295E440249B61168DABB789B3FA4;// 0x11D8(0x0028) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_71EBE3204E6F07A57278C3AC775F62DC;// 0x1200(0x00E0) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_1FBFEA7E449BD537816D4C8DF323E388;// 0x12E0(0x00E0) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_D6ED834C4044D2C4B47E1792CC8C32F9;// 0x13C0(0x0060) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_575210714414E829716512970EEBF303;// 0x1420(0x00E0) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_E084469E40974B10C4A0EDAE01B2AB8F;// 0x1500(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_58EE5C564337A041156460A9B639B219;// 0x1560(0x0060) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_3DA12AE641FABAA29F1BA79E3E7EE252;// 0x15C0(0x00E0) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_E62D115E43FDE7ED3BA55BAD0B1D64BB;// 0x16A0(0x0060) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_5F8E17794BEE9AA1B27D97B149C715E8;// 0x1700(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_7B85EB2E45B5B77151C944AE4373B5CE;// 0x1740(0x0028) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_2E426F3740EC572D2D9B1BBF151764B3;// 0x1768(0x0030) struct FAnimNode_ApplyAdditive AnimGraphNode_ApplyAdditive_36FDDE9C406E247752F92EAB4E79856D;// 0x1798(0x0050) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_035967204CBD705645AF82B42DECC37C;// 0x17E8(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_F9DB0BE645725BC54E36DD95D06F8E4E;// 0x1810(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_F7607EDB4D7422EFCA652898E7B2506A;// 0x1870(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_F9310214494CCC127F458E880089F6DC;// 0x18D0(0x0030) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_7EB5C278435070D28631C4BB786A527E;// 0x1900(0x00E0) struct FAnimNode_Slot AnimGraphNode_Slot_49259C8C41DB2D63F70AEE946A74F856; // 0x19E0(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_A539CB0E4722E94A64D57E816F3E5CDC; // 0x1A18(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_F5355E9E48FE2549605602AF8221060A; // 0x1A50(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_7631929A44AF3ABA8465D8A825D42FC4; // 0x1A88(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_DA3033024C74DFB2D77D58AD00AC24B4; // 0x1AC0(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_6FB6A0F54B3DF11BD098CDB7C7632528; // 0x1AF8(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_7F5B6D0C454D80CB7542C79534FA3EC7; // 0x1B30(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_54D584A04D156F6B43D7E6980EABEC69; // 0x1B68(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_FC0051C64E6C1FEADEBCA9BBEF1D2403; // 0x1BA0(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_A7BD245646153E8D96E477B5B0804F01; // 0x1BD8(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_5385B85F45362F4D0033228E470C6795; // 0x1C10(0x0038) struct FAnimNode_Slot AnimGraphNode_Slot_0BC6FEC544D668A22159DBA43F58BC61; // 0x1C48(0x0038) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_98B74A104428E584810237B09A72C0FF;// 0x1C80(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_77518CF142BB6391E94F80B14A422570;// 0x1CC0(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_58D6E69D48E0C70FDE2566A3D72E3048;// 0x1CE8(0x0028) struct FAnimNode_LayeredBoneBlend AnimGraphNode_LayeredBoneBlend_1814984149AB01B7F76BF9AE71AB3BC2;// 0x1D10(0x0080) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_E6ECAFC846ECBD977B1239912AD8D002;// 0x1D90(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_7419FD0D45A453B15D702D9B81037FDE;// 0x1DD0(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_EF9D70494453741B191ECCBDC2B4911C;// 0x1DF8(0x0028) struct FAnimNode_LayeredBoneBlend AnimGraphNode_LayeredBoneBlend_1E778213411A313325E3D6A67377DFC8;// 0x1E20(0x0080) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_C827B46D4F091EF30988E3B500B7B2CF;// 0x1EA0(0x0040) struct FAnimNode_LayeredBoneBlend AnimGraphNode_LayeredBoneBlend_53E64E524D7A204A692A199B80A49326;// 0x1EE0(0x0080) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_02D0D9DB495061636AA3719C01D65EEE;// 0x1F60(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_7F347DFD4CBA9424191249A000B832A6;// 0x1F88(0x0028) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_62B155D9473205BB44E596AD74FCE88F;// 0x1FB0(0x00E0) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_006DBB9F41A03FE8B84BF3BBCA75799D;// 0x2090(0x00E0) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_F28DEB9B4FC8F3AEECB579A169E0FCB7;// 0x2170(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_625140C84CA35521B41D309C3DD0AF2D;// 0x21D0(0x0030) struct FAnimNode_ApplyAdditive AnimGraphNode_ApplyAdditive_9EDC1FA442F21CE094A2BFAC4C6B406D;// 0x2200(0x0050) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_3B8469ED47344F15B994FD9BEECA64B9;// 0x2250(0x0030) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_114AC64144AE08E9D7E145ADD9CEB118;// 0x2280(0x0060) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_AECB76954727F24F3513BF8DD5DFD28C;// 0x22E0(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_A71A531F4DF2B93550F425B987716495;// 0x2320(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_83D61AAA453FA19E4F01EBB9CBE9B663;// 0x2348(0x0028) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_4D11AAED4DEEBB1F8921EF90BED072EB;// 0x2370(0x00E0) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_0D0E6FBB4591AEE8A3188295B8F9D06B;// 0x2450(0x0060) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_FAC88C4D463191B0BFEE60A61AB2FE20;// 0x24B0(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_0283924B455E9E2745CCCA9534D61CBE;// 0x24F0(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_E3E120754C79429F02EB49B40929732E;// 0x2518(0x0060) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_7B3A126E4DC8BEDFC5661D915AEE1C09;// 0x2578(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_6DAB1347440D304AFE94898987CBA1F9;// 0x25A0(0x0060) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_7EE9F750439BDE1E01E5C688B93AA5F5;// 0x2600(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_D9728971406A83D8E676ADB96D3311F8;// 0x2640(0x0028) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_34960ED840024D449F879CB67BE5BEDF;// 0x2668(0x0030) struct FAnimNode_LayeredBoneBlend AnimGraphNode_LayeredBoneBlend_5843C8CA48637F84A182499B92E187D5;// 0x2698(0x0080) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_5A7ECEC64AC41917642212B924F95233;// 0x2718(0x0060) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_FDD8F78B4858A7E91A43B3A30F28FB40;// 0x2778(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_A822F0EB40C3416F377EBF99EE0E727D;// 0x27B8(0x0028) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_BFCFC6EE4B3A68ADAB79DBBF06B96F0F;// 0x27E0(0x0030) struct FAnimNode_LayeredBoneBlend AnimGraphNode_LayeredBoneBlend_D2BEAD1C4A773C0715D8EFA661790F8F;// 0x2810(0x0080) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_D69E7EEA40B2E3EDF5EF3AA24179CB5B;// 0x2890(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_D59F543F46107346A52A98BFC8658B12;// 0x28B8(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_9FBA8823466B1331A23BCD8B17355B0E;// 0x28E0(0x0060) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_584B7CFB4DE9296AA4C893BBE0DBAE75;// 0x2940(0x0028) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_CCF0D5154F1686D7738E7580ED49DE7D;// 0x2968(0x0030) struct FAnimNode_ApplyAdditive AnimGraphNode_ApplyAdditive_9894735643F86550E33F3E8B529CB559;// 0x2998(0x0050) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_E135E30D44B8F0FDFE6D74A5D583D895;// 0x29E8(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_DC18F1E04C13FEA34E13EF8E2F5EAEFE;// 0x2A48(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_5569E169478C7032EB0D78BECDA4F7EF;// 0x2A78(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_DE67D2B64A50261669055EBEE5BFD90B;// 0x2AA8(0x0030) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_B0D172B34F99B4F7BDD8DE9255B888DD;// 0x2AD8(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_0CE0EF3D4253B8A0B76150995DBE5ED1;// 0x2B18(0x0028) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_8EE2C40A43801E808BA0F8AA517E08A9;// 0x2B40(0x00E0) struct FAnimationNode_TwoWayBlend AnimGraphNode_TwoWayBlend_CE25867547A87AF22D84159D145E19A9;// 0x2C20(0x0050) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_40C6D9B34227679A2A1A3CB860CF363E;// 0x2C70(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_D83165154E10975FC752AD87EBA68799;// 0x2CD0(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_D7AA44144F9AF0904FDD859B8EFB22A1;// 0x2D30(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_2F0D7D64471FBED002E978BE0DC539F5;// 0x2D90(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_D8DFB40E4161D6EC77DF45A6BB573C05;// 0x2DC0(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_EB24E0854A5219A62C1E7DB5B78AE02F;// 0x2DF0(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_4344010E4E0D5A4F91C3D9B17A15C48D;// 0x2E20(0x0030) struct FAnimationNode_TwoWayBlend AnimGraphNode_TwoWayBlend_F960ECE8477E76F3538754A89E4E701D;// 0x2E50(0x0050) struct FAnimationNode_TwoWayBlend AnimGraphNode_TwoWayBlend_F687DCE942871B17643DA3AB66FF0544;// 0x2EA0(0x0050) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_352BFA644673844139DF9C828B21A0EE;// 0x2EF0(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_2781FC3A431F4944BEE28E9A877E8C6A;// 0x2F50(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_397D98FF49D71C7F43883A875A049067;// 0x2F80(0x0030) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_82F7F17146B5EE95C649958A5A7768F7;// 0x2FB0(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_8129ECBD45CCC2607A2615850AA2F49B;// 0x3010(0x0030) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_9FCB3D6D4CF50C6BE4E0D2B5811076FE;// 0x3040(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_2DCD53F440BD394CEBDAEBAD7A00C3CA;// 0x30A0(0x0060) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_BEDB1D4E420950EC3AE4E181410588E8;// 0x3100(0x0028) struct FAnimNode_LayeredBoneBlend AnimGraphNode_LayeredBoneBlend_7DD265CB4C81A2F2AC33488DCCC2DD32;// 0x3128(0x0080) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_DA34180F43D27A225F0E4E84027786FE;// 0x31A8(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_43CA87414F2F8C6E01C79F839343FAD9;// 0x3208(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_9EC1F6974FD8099D3B7BD187519B03A3;// 0x3238(0x0030) struct FAnimationNode_TwoWayBlend AnimGraphNode_TwoWayBlend_E640EAE04F75EEC5F6D0FCB5D184AFB3;// 0x3268(0x0050) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_231A3AEB4F0411AC812F41A946558D89;// 0x32B8(0x0060) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_1A1905BB4A488250E3E758929CAC0D98;// 0x3318(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_39FB8CD84AC230C8E772B6A40A4F6418;// 0x3358(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_6066031A4D4408F91FF056A9CEF4B804;// 0x3380(0x0028) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_58BADC2348B95F9B34C4D8B8A59EC1E3;// 0x33A8(0x0028) struct FAnimNode_ApplyAdditive AnimGraphNode_ApplyAdditive_075C14E54E8831B218CD5385157DA7B4;// 0x33D0(0x0050) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_2AACDFAE4CC815121445058814C3EB58;// 0x3420(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_DABBFB144152CF13BFF7BDA20F4FCCC7;// 0x3480(0x0030) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_6DD265834F8C65521D2AE288D316E28D;// 0x34B0(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_DA186F34430B9C394CEED5BF5C4BD28C;// 0x34D8(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_4E1C48A54B9FD35C6E6A428DE00D6676;// 0x3538(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_CD91F88648A33C1AF26DB6B1DDAC4B2E;// 0x3568(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_ED9AA3D744AC692E66C1818B2D18CB5D;// 0x3598(0x0030) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_6ED0E70A429D42D7B4FA44AD33E287AE;// 0x35C8(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_BB9E1DDF4BBAB9D15C1145B2F16DC928;// 0x3628(0x0030) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_7BAD9B3C47AF0247CE7EF79F3A68E35A;// 0x3658(0x0060) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_AC1E66424F3A0ED26D66C78FBDCA028A;// 0x36B8(0x0030) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_5F20890C4FF6EB2C8561649350ED55DD;// 0x36E8(0x0060) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_449CAD114D755CE09E3514A55BEDE738;// 0x3748(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_F0293980425AF44AE1D9E2A7156E3F13;// 0x3770(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_6508C6CC448696270B8CD8995F61979B;// 0x37D0(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_A5850AF44FAD21F0E0960FA2F21EB940;// 0x3830(0x0060) struct FAnimNode_ConvertComponentToLocalSpace AnimGraphNode_ComponentToLocalSpace_2F1D210D4B4028B81E8FF081C81C15F9;// 0x3890(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_0E49723F4FE177AC44544FB3853BC1FE;// 0x38B8(0x0060) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_B5D0235C475480945AFED28A5C5EA9AF;// 0x3918(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_BB6102CB4668D012BA1213941FBBDBE1;// 0x3940(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_49F2A42A41D3B14AFECECE94D94E00F6;// 0x39A0(0x0060) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_D0972CEC4B8377AFB16DAD97964018E1;// 0x3A00(0x0060) struct FAnimationNode_TwoWayBlend AnimGraphNode_TwoWayBlend_928706C847C07613FB606CAEE6265D6A;// 0x3A60(0x0050) struct FAnimNode_ModifyBone AnimGraphNode_ModifyBone_142D53694074649ACE62C89E6BE60BB4;// 0x3AB0(0x00B0) struct FAnimNode_ConvertLocalToComponentSpace AnimGraphNode_LocalToComponentSpace_3557DCDA4B3DF4D17C37A3A7D7F474C3;// 0x3B60(0x0028) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_6A915238441A182A6A675794D434C7E1;// 0x3B88(0x0060) struct FAnimNode_Root AnimGraphNode_Root_12E8EC2F4D6CA5ED5BA853854982E57B; // 0x3BE8(0x0028) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_295C25CF457542BEC41FA68530B90DE0;// 0x3C10(0x0030) struct FAnimNode_SaveCachedPose AnimGraphNode_SaveCachedPose_5305F49640A043FEA26D52B542239183;// 0x3C40(0x0040) struct FAnimNode_UseCachedPose AnimGraphNode_UseCachedPose_C6A2B75E4E399FDEFABDFAB8766F1DAA;// 0x3C80(0x0028) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_AA26FD29466205A5F5DF3497FDB27905;// 0x3CA8(0x00E0) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_7146EF344DD7F270EFDA36ABE0453F73;// 0x3D88(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_029850DB496F6CA840355DB96148DD14;// 0x3DB8(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_06ACAB7F4A1C68A1D7D69E857BEDC77A;// 0x3DE8(0x0030) struct FAnimNode_SequencePlayer AnimGraphNode_SequencePlayer_BC3F5E20471E4175267F749A4D7CB982;// 0x3E18(0x0030) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_B8DF8CEC42421E426C2787928A2612A4;// 0x3E48(0x0060) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_ECA9FD8945995210C9878196697C489A;// 0x3EA8(0x00E0) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_119494E04BDFB1D84B4860BD21480D9F;// 0x3F88(0x00E0) struct FAnimNode_BlendListByBool AnimGraphNode_BlendListByBool_FA2EB2F34B1AFCCB351BC2A35E0B6752;// 0x4068(0x0060) struct FAnimNode_BlendSpacePlayer AnimGraphNode_BlendSpacePlayer_C337E1DC4F9B19EAEA04CEAF8C1434F0;// 0x40C8(0x00E0) bool bIsMoving; // 0x41A8(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData01[0x3]; // 0x41A9(0x0003) MISSED OFFSET struct FRotator RootRotationOffset; // 0x41AC(0x000C) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float AimPitch; // 0x41B8(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float AimYaw; // 0x41BC(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector RootLocationOffset; // 0x41C0(0x000C) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bUseAimOffset; // 0x41CC(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData02[0x3]; // 0x41CD(0x0003) MISSED OFFSET float MovementAnimRate; // 0x41D0(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bIsFalling; // 0x41D4(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData03[0x3]; // 0x41D5(0x0003) MISSED OFFSET float MaxMovementAnimRate; // 0x41D8(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bUseFalling; // 0x41DC(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData04[0x3]; // 0x41DD(0x0003) MISSED OFFSET float MovingAnimSpeedTreshold; // 0x41E0(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float MinMovementAnimRate; // 0x41E4(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bIsTurning; // 0x41E8(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bUseTurning; // 0x41E9(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bTurningRight; // 0x41EA(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData05[0x1]; // 0x41EB(0x0001) MISSED OFFSET float TurningEnabledBlendTime; // 0x41EC(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float TurningDisabledBlendTime; // 0x41F0(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D TurningDirectionBlendTime_TallMode; // 0x41F4(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float MinTurnRateForTurnAnimation; // 0x41FC(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bUseSwimming; // 0x4200(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bIsSwimming; // 0x4201(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData06[0x2]; // 0x4202(0x0002) MISSED OFFSET float SwimmingMovingAnimSpeedThreshold; // 0x4204(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float FallingAnimPlayRate; // 0x4208(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float FallingBlendInTime; // 0x420C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float FallingBlendOutTime; // 0x4210(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D MovingBlendTimes; // 0x4214(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bIsRunning; // 0x421C(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bUseRunning; // 0x421D(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bUseSleepingAnim; // 0x421E(0x0001) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData) bool bIsSleeping; // 0x421F(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector SleepingAnimTranslationOffset; // 0x4220(0x000C) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float MovementAnimRatePower; // 0x422C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bUseTurnInPlaceAnimation; // 0x4230(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bSkipAnimGraph; // 0x4231(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData07[0x2]; // 0x4232(0x0002) MISSED OFFSET float AlignGroundAlpha; // 0x4234(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bUseAlignGround; // 0x4238(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData08[0x3]; // 0x4239(0x0003) MISSED OFFSET float IKAlpha; // 0x423C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float RunningBlendInTime; // 0x4240(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float RunningBlendOutTime; // 0x4244(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float RunningMovementAnimRate; // 0x4248(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bUseRunningMovementAnimRate; // 0x424C(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bDisableIK; // 0x424D(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData09[0x2]; // 0x424E(0x0002) MISSED OFFSET float AimOffsetPitchScale; // 0x4250(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float AimOffsetYawScale; // 0x4254(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bSleepingEnableIK; // 0x4258(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bTallMode; // 0x4259(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bHasWebsAttached; // 0x425A(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bSpiderStuckToWall; // 0x425B(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) struct FVector2D MoveAnimBlends; // 0x425C(0x0008) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bIsSpiderJesus; // 0x4264(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData10[0x3]; // 0x4265(0x0003) MISSED OFFSET float StopSwimmingAfterUnsubmergedTime; // 0x4268(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bSwimmingVertically; // 0x426C(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bBothWebs; // 0x426D(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) TEnumAsByte<EGrappleState> CurrGrappleState; // 0x426E(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bCharEnsnared; // 0x426F(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) float currTurnRate; // 0x4270(0x0004) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) float MinTurnRateForTurnAnimation_StuckToWall; // 0x4274(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float FallingVelocityBlend; // 0x4278(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bIsSkidding; // 0x427C(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData11[0x3]; // 0x427D(0x0003) MISSED OFFSET float StartSkiddingAboveWalkAnimRate; // 0x4280(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float SkidPlayRate; // 0x4284(0x0004) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) struct FVector2D SkidPlayRateRanges; // 0x4288(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float SlingshotStretchRatio; // 0x4290(0x0004) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bForceSkid; // 0x4294(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData12[0x3]; // 0x4295(0x0003) MISSED OFFSET float TurnInPlaceBlendRatio; // 0x4298(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D TurningBlendTime; // 0x429C(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D TurningBlendTime_TallMode; // 0x42A4(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D TurnInPlaceBlendTimes; // 0x42AC(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D TurningDirectionBlendTime_TurnInPlace_TallMode; // 0x42B4(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D TurnInPlaceBlendTimes_TallMode; // 0x42BC(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bHasRider; // 0x42C4(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bSpiderWantsToStickToWall; // 0x42C5(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData13[0x2]; // 0x42C6(0x0002) MISSED OFFSET struct FVector2D WantsToStickToWallBlendTimes; // 0x42C8(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bHasGrappledChar; // 0x42D0(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData14[0x3]; // 0x42D1(0x0003) MISSED OFFSET float ReelingAnimPlayRate; // 0x42D4(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float MovingAnimSpeedTreshold_TallMode; // 0x42D8(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D WebSwingingBlendTimes; // 0x42DC(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float WebSwinging_Vertical_CurrAlpha; // 0x42E4(0x0004) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) float WebSwinging_Vertical_DotThreshold; // 0x42E8(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float WebSwinging_Vertical_RequiredSpeed; // 0x42EC(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float WebSwinging_Vertical_BlendInterpSpeed; // 0x42F0(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float WebSwinging_Vertical_AnimBlend; // 0x42F4(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float CurrentTurningBlendAlpha; // 0x42F8(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float TurningBlendAlphaInterpSpeed_Up; // 0x42FC(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float TurningBlendAlphaInterpSpeed_Down; // 0x4300(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float MaxAnimTurnRate; // 0x4304(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float MaxAnimTurnRate_Running; // 0x4308(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float TurningBlendAlphaInterpSpeed_Running_Up; // 0x430C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float TurningBlendAlphaInterpSpeed_Running_Down; // 0x4310(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D TurningBlendTime_Running; // 0x4314(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bIsAirBraking; // 0x431C(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bIsWebSwingingIdle; // 0x431D(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData15[0x2]; // 0x431E(0x0002) MISSED OFFSET float WebSwingingIdleVelocity; // 0x4320(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float AgainstSurfaceSkiddingBaseVelocity; // 0x4324(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float ChargeJumpRatio; // 0x4328(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float BaseTurnRate_StuckToWall; // 0x432C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float BaseTurnRate; // 0x4330(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bSpiderHangry; // 0x4334(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bIsSpiderAtWebTetherEnd; // 0x4335(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bSpiderWantsToSwing; // 0x4336(0x0001) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) TEnumAsByte<E_DinoClimberState> CurrentClimberState; // 0x4337(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) struct FVector2D MovingBlendTimes_Climbing; // 0x4338(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D TurningBlendTime_Climbing; // 0x4340(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float SwingingBlendMaxMeshYawDelta; // 0x4348(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float MaxAnimBlendDirectionalFallingVelocityPercentage; // 0x434C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool bIsDirectionalFalling; // 0x4350(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData16[0x3]; // 0x4351(0x0003) MISSED OFFSET float DirectionalFallingRequiredVelocity; // 0x4354(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) struct FVector2D DirectionalFallingBlendTimes; // 0x4358(0x0008) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) float currMeshSwingingYawDelta; // 0x4360(0x0004) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bSpiderImpendingLand; // 0x4364(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) bool bIsDiving; // 0x4365(0x0001) (Edit, BlueprintVisible, ZeroConstructor, Transient, DisableEditOnInstance, IsPlainOldData) unsigned char UnknownData17[0x2]; // 0x4366(0x0002) MISSED OFFSET float MaxMovementAnimRate_Skidding; // 0x4368(0x0004) (Edit, BlueprintVisible, ZeroConstructor, DisableEditOnInstance, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue; // 0x436C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue; // 0x436D(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData18[0x2]; // 0x436E(0x0002) MISSED OFFSET float CallFunc_BreakVector2D_X; // 0x4370(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y; // 0x4374(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue2; // 0x4378(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue; // 0x4379(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData19[0x2]; // 0x437A(0x0002) MISSED OFFSET float CallFunc_BreakVector2D_X2; // 0x437C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y2; // 0x4380(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_EqualEqual_ByteByte_ReturnValue; // 0x4384(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData20[0x3]; // 0x4385(0x0003) MISSED OFFSET float CallFunc_BreakVector2D_X3; // 0x4388(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y3; // 0x438C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Lerp_ReturnValue; // 0x4390(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X4; // 0x4394(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y4; // 0x4398(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X5; // 0x439C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y5; // 0x43A0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X6; // 0x43A4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y6; // 0x43A8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector2D K2Node_Select_ReturnValue; // 0x43AC(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool K2Node_Select_CmpSuccess; // 0x43B4(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData21[0x3]; // 0x43B5(0x0003) MISSED OFFSET float CallFunc_BreakVector2D_X7; // 0x43B8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y7; // 0x43BC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue; // 0x43C0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue; // 0x43C4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue2; // 0x43C8(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData22[0x3]; // 0x43C9(0x0003) MISSED OFFSET float CallFunc_BreakVector2D_X8; // 0x43CC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y8; // 0x43D0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X9; // 0x43D4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y9; // 0x43D8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue2; // 0x43DC(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue3; // 0x43DD(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData23[0x2]; // 0x43DE(0x0002) MISSED OFFSET float CallFunc_BreakVector2D_X10; // 0x43E0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y10; // 0x43E4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X11; // 0x43E8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y11; // 0x43EC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue3; // 0x43F0(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData24[0x3]; // 0x43F1(0x0003) MISSED OFFSET float CallFunc_BreakVector2D_X12; // 0x43F4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y12; // 0x43F8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue4; // 0x43FC(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue5; // 0x43FD(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_EqualEqual_ByteByte_ReturnValue2; // 0x43FE(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue6; // 0x43FF(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanOR_ReturnValue; // 0x4400(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanOR_ReturnValue2; // 0x4401(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue3; // 0x4402(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue4; // 0x4403(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_EqualEqual_ByteByte_ReturnValue3; // 0x4404(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanOR_ReturnValue3; // 0x4405(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue4; // 0x4406(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue5; // 0x4407(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X13; // 0x4408(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y13; // 0x440C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue7; // 0x4410(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData25[0x3]; // 0x4411(0x0003) MISSED OFFSET float CallFunc_BreakVector2D_X14; // 0x4414(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y14; // 0x4418(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue8; // 0x441C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData26[0x3]; // 0x441D(0x0003) MISSED OFFSET float CallFunc_BreakVector2D_X15; // 0x4420(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y15; // 0x4424(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X16; // 0x4428(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y16; // 0x442C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X17; // 0x4430(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y17; // 0x4434(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X18; // 0x4438(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y18; // 0x443C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue2; // 0x4440(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue; // 0x4444(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue; // 0x4448(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue5; // 0x444C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue6; // 0x444D(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue6; // 0x444E(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue7; // 0x444F(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanOR_ReturnValue4; // 0x4450(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData27[0x3]; // 0x4451(0x0003) MISSED OFFSET float K2Node_Event_DeltaTimeX; // 0x4454(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_SelectVector_ReturnValue; // 0x4458(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_Add_VectorVector_ReturnValue; // 0x4464(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) double CallFunc_GetGameTimeInSeconds_ReturnValue; // 0x4470(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_IsDedicatedServer_ReturnValue; // 0x4478(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData28[0x3]; // 0x4479(0x0003) MISSED OFFSET float CallFunc_GetWorldDeltaSeconds_ReturnValue; // 0x447C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Add_FloatFloat_ReturnValue; // 0x4480(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_GetWorldDeltaSeconds_ReturnValue2; // 0x4484(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FMin_ReturnValue; // 0x4488(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Subtract_FloatFloat_ReturnValue; // 0x448C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FMax_ReturnValue; // 0x4490(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue2; // 0x4494(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue7; // 0x4498(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue8; // 0x4499(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData29[0x6]; // 0x449A(0x0006) MISSED OFFSET class FString CallFunc_Conv_FloatToString_ReturnValue; // 0x44A0(0x0010) (ZeroConstructor, Transient, DuplicateTransient) bool CallFunc_Greater_FloatFloat_ReturnValue9; // 0x44B0(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData30[0x3]; // 0x44B1(0x0003) MISSED OFFSET float CallFunc_Abs_ReturnValue2; // 0x44B4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue; // 0x44B8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue10; // 0x44BC(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData31[0x3]; // 0x44BD(0x0003) MISSED OFFSET class FString CallFunc_BuildString_Float_ReturnValue; // 0x44C0(0x0010) (ZeroConstructor, Transient, DuplicateTransient) float CallFunc_Subtract_FloatFloat_ReturnValue2; // 0x44D0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_GreaterEqual_FloatFloat_ReturnValue; // 0x44D4(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData32[0x3]; // 0x44D5(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue3; // 0x44D8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue3; // 0x44DC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_X19; // 0x44E0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector2D_Y19; // 0x44E4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Lerp_ReturnValue2; // 0x44E8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Subtract_FloatFloat_ReturnValue3; // 0x44EC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) class FString CallFunc_Conv_FloatToString_ReturnValue2; // 0x44F0(0x0010) (ZeroConstructor, Transient, DuplicateTransient) float CallFunc_GetWorldDeltaSeconds_ReturnValue3; // 0x4500(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue2; // 0x4504(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue4; // 0x4508(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue3; // 0x450C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue4; // 0x4510(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue11; // 0x4514(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData33[0x3]; // 0x4515(0x0003) MISSED OFFSET float CallFunc_SelectFloat_ReturnValue3; // 0x4518(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue4; // 0x451C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue5; // 0x4520(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FInterpTo_ReturnValue; // 0x4524(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue6; // 0x4528(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue8; // 0x452C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData34[0x3]; // 0x452D(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue5; // 0x4530(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue2; // 0x4534(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue5; // 0x4538(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_EqualEqual_ByteByte_ReturnValue4; // 0x453C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue9; // 0x453D(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue9; // 0x453E(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue10; // 0x453F(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) class APawn* CallFunc_TryGetPawnOwner_ReturnValue; // 0x4540(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) class APrimalDinoCharacter* K2Node_DynamicCast_AsPrimalDinoCharacter; // 0x4548(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool K2Node_DynamicCast_CastSuccess; // 0x4550(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData35[0x3]; // 0x4551(0x0003) MISSED OFFSET float CallFunc_SelectFloat_ReturnValue7; // 0x4554(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_GetForwardVector_ReturnValue; // 0x4558(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_GetRightVector_ReturnValue; // 0x4564(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_NegateVector_ReturnValue; // 0x4570(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_GetUpVector_ReturnValue; // 0x457C(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_GetRunningSpeedModifier_ReturnValue; // 0x4588(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData36[0x4]; // 0x458C(0x0004) MISSED OFFSET class ABogSpider_Character_BP_C* K2Node_DynamicCast_AsBogSpider_Character_BP_C; // 0x4590(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool K2Node_DynamicCast2_CastSuccess; // 0x4598(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData37[0x3]; // 0x4599(0x0003) MISSED OFFSET float CallFunc_BreakVector_X; // 0x459C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector_Y; // 0x45A0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector_Z; // 0x45A4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_LessEqual_FloatFloat_ReturnValue; // 0x45A8(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_WantsToSwing_bResult; // 0x45A9(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_IsSpiderBloodHangry_bResult; // 0x45AA(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData38[0x5]; // 0x45AB(0x0005) MISSED OFFSET class UWorld* CallFunc_K2_GetWorld_ReturnValue; // 0x45B0(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Subtract_FloatFloat_ReturnValue4; // 0x45B8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue4; // 0x45BC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_TimeSince_ReturnValue; // 0x45C0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue6; // 0x45C4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_DoubleDouble_ReturnValue; // 0x45C8(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData39[0x3]; // 0x45C9(0x0003) MISSED OFFSET float CallFunc_FClamp_ReturnValue6; // 0x45CC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue8; // 0x45D0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_IsOwnerAgainstValidSurface_ReturnValue; // 0x45D4(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue10; // 0x45D5(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData40[0x2]; // 0x45D6(0x0002) MISSED OFFSET float CallFunc_Multiply_FloatFloat_ReturnValue3; // 0x45D8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Subtract_FloatFloat_ReturnValue5; // 0x45DC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Subtract_FloatFloat_ReturnValue6; // 0x45E0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_GetTargetingLocation_ReturnValue; // 0x45E4(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_GetVelocity_ReturnValue; // 0x45F0(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_IsValid_ReturnValue; // 0x45FC(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData41[0x3]; // 0x45FD(0x0003) MISSED OFFSET float CallFunc_VSize2D_ReturnValue; // 0x4600(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_NotEqual_ObjectObject_ReturnValue; // 0x4604(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData42[0x3]; // 0x4605(0x0003) MISSED OFFSET struct FVector CallFunc_GetSpiderVelocityVars_Velocity; // 0x4608(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_GetSpiderVelocityVars_VelocitySize; // 0x4614(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_GetSpiderVelocityVars_VelocityDir; // 0x4618(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector2D CallFunc_GetSpiderVelocityVars_Velocity2D; // 0x4624(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_GetSpiderVelocityVars_VelocitySize2D; // 0x462C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_IsAirBraking_bResult; // 0x4630(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_GreaterEqual_FloatFloat_ReturnValue2; // 0x4631(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData43[0x2]; // 0x4632(0x0002) MISSED OFFSET float CallFunc_SelectFloat_ReturnValue9; // 0x4634(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_VSize2D_ReturnValue2; // 0x4638(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue12; // 0x463C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData44[0x3]; // 0x463D(0x0003) MISSED OFFSET struct FVector CallFunc_Conv_Vector2DToVector_ReturnValue; // 0x4640(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Dot_VectorVector_ReturnValue; // 0x464C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue7; // 0x4650(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue5; // 0x4654(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue7; // 0x4658(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_GreaterEqual_FloatFloat_ReturnValue3; // 0x465C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData45[0x3]; // 0x465D(0x0003) MISSED OFFSET float CallFunc_Lerp_ReturnValue3; // 0x4660(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Less_FloatFloat_ReturnValue; // 0x4664(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue13; // 0x4665(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData46[0x2]; // 0x4666(0x0002) MISSED OFFSET float CallFunc_FMax_ReturnValue2; // 0x4668(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Dot_VectorVector_ReturnValue2; // 0x466C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector_X2; // 0x4670(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector_Y2; // 0x4674(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakVector_Z2; // 0x4678(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Dot_VectorVector_ReturnValue3; // 0x467C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue10; // 0x4680(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue6; // 0x4684(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue7; // 0x4688(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue14; // 0x468C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData47[0x3]; // 0x468D(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue8; // 0x4690(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_LessEqual_FloatFloat_ReturnValue2; // 0x4694(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData48[0x3]; // 0x4695(0x0003) MISSED OFFSET float CallFunc_Subtract_FloatFloat_ReturnValue7; // 0x4698(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue9; // 0x469C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue10; // 0x46A0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Add_FloatFloat_ReturnValue2; // 0x46A4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue4; // 0x46A8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue5; // 0x46AC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue8; // 0x46B0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue9; // 0x46B4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue11; // 0x46B8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue11; // 0x46BC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue10; // 0x46C0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FMax_ReturnValue3; // 0x46C4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue6; // 0x46C8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue12; // 0x46CC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue7; // 0x46D0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue8; // 0x46D4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) class FString CallFunc_BuildString_Float_ReturnValue2; // 0x46D8(0x0010) (ZeroConstructor, Transient, DuplicateTransient) bool CallFunc_GreaterEqual_FloatFloat_ReturnValue4; // 0x46E8(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData49[0x3]; // 0x46E9(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue12; // 0x46EC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Dot_VectorVector_ReturnValue4; // 0x46F0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue9; // 0x46F4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SignOfFloat_ReturnValue; // 0x46F8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Subtract_FloatFloat_ReturnValue8; // 0x46FC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_GreaterEqual_FloatFloat_ReturnValue5; // 0x4700(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData50[0x3]; // 0x4701(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue13; // 0x4704(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue11; // 0x4708(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData51[0x3]; // 0x4709(0x0003) MISSED OFFSET float CallFunc_FClamp_ReturnValue11; // 0x470C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FInterpTo_ReturnValue2; // 0x4710(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue10; // 0x4714(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Subtract_FloatFloat_ReturnValue9; // 0x4718(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue11; // 0x471C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FMax_ReturnValue4; // 0x4720(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_LessEqual_FloatFloat_ReturnValue3; // 0x4724(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData52[0x3]; // 0x4725(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue14; // 0x4728(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue12; // 0x472C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData53[0x3]; // 0x472D(0x0003) MISSED OFFSET float CallFunc_Multiply_FloatFloat_ReturnValue8; // 0x4730(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue12; // 0x4734(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Dot_VectorVector_ReturnValue5; // 0x4738(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue9; // 0x473C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SignOfFloat_ReturnValue2; // 0x4740(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Abs_ReturnValue12; // 0x4744(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Subtract_FloatFloat_ReturnValue10; // 0x4748(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FMax_ReturnValue5; // 0x474C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_IsStuckToWall_bResult; // 0x4750(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData54[0x3]; // 0x4751(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue15; // 0x4754(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue10; // 0x4758(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue13; // 0x475C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_NotEqual_ObjectObject_ReturnValue2; // 0x4760(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData55[0x3]; // 0x4761(0x0003) MISSED OFFSET float CallFunc_Multiply_FloatFloat_ReturnValue11; // 0x4764(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector2D CallFunc_MakeVector2D_ReturnValue; // 0x4768(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_K2_GetActorLocation_ReturnValue; // 0x4770(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_Subtract_VectorVector_ReturnValue; // 0x477C(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_Normal_ReturnValue; // 0x4788(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Dot_VectorVector_ReturnValue6; // 0x4794(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue16; // 0x4798(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue14; // 0x479C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue12; // 0x47A0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Has_Webs_Attached_result; // 0x47A4(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData56[0x3]; // 0x47A5(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue17; // 0x47A8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue15; // 0x47AC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue18; // 0x47B0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue13; // 0x47B4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue16; // 0x47B8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue14; // 0x47BC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector2D CallFunc_MakeVector2D_ReturnValue2; // 0x47C0(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector2D K2Node_Select_ReturnValue2; // 0x47C8(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool K2Node_Select2_CmpSuccess; // 0x47D0(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Has_Webs_Attached_result2; // 0x47D1(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_IsRunning_ReturnValue; // 0x47D2(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData57[0x1]; // 0x47D3(0x0001) MISSED OFFSET float CallFunc_Lerp_ReturnValue4; // 0x47D4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue15; // 0x47D8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue16; // 0x47DC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue15; // 0x47E0(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue16; // 0x47E1(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_IsMeshGameplayRelevant_ReturnValue; // 0x47E2(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue11; // 0x47E3(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue13; // 0x47E4(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData58[0x3]; // 0x47E5(0x0003) MISSED OFFSET double CallFunc_Subtract_DoubleDouble_ReturnValue; // 0x47E8(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue12; // 0x47F0(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData59[0x3]; // 0x47F1(0x0003) MISSED OFFSET float CallFunc_Conv_DoubleToFloat_ReturnValue; // 0x47F4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Less_FloatFloat_ReturnValue2; // 0x47F8(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData60[0x7]; // 0x47F9(0x0007) MISSED OFFSET class UPawnMovementComponent* CallFunc_GetMovementComponent_ReturnValue; // 0x4800(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) class UCharacterMovementComponent* K2Node_DynamicCast_AsCharacterMovementComponent; // 0x4808(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool K2Node_DynamicCast3_CastSuccess; // 0x4810(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData61[0x3]; // 0x4811(0x0003) MISSED OFFSET float CallFunc_GetDefaultMovementSpeed_ReturnValue; // 0x4814(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue17; // 0x4818(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_EqualEqual_ByteByte_ReturnValue5; // 0x481C(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData62[0x3]; // 0x481D(0x0003) MISSED OFFSET float CallFunc_SelectFloat_ReturnValue13; // 0x4820(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanOR_ReturnValue5; // 0x4824(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData63[0x3]; // 0x4825(0x0003) MISSED OFFSET float CallFunc_Multiply_FloatFloat_ReturnValue18; // 0x4828(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue14; // 0x482C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_EqualEqual_ByteByte_ReturnValue6; // 0x4830(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData64[0x3]; // 0x4831(0x0003) MISSED OFFSET float CallFunc_Multiply_FloatFloat_ReturnValue19; // 0x4834(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_EqualEqual_ByteByte_ReturnValue7; // 0x4838(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData65[0x3]; // 0x4839(0x0003) MISSED OFFSET float CallFunc_Divide_FloatFloat_ReturnValue19; // 0x483C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue13; // 0x4840(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData66[0x3]; // 0x4841(0x0003) MISSED OFFSET float CallFunc_FClamp_ReturnValue17; // 0x4844(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_BooleanAND_ReturnValue14; // 0x4848(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData67[0x3]; // 0x4849(0x0003) MISSED OFFSET float CallFunc_Multiply_FloatFloat_ReturnValue20; // 0x484C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue18; // 0x4850(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue20; // 0x4854(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue21; // 0x4858(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue21; // 0x485C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue19; // 0x4860(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue20; // 0x4864(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue22; // 0x4868(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue23; // 0x486C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector2D CallFunc_MakeVector2D_ReturnValue3; // 0x4870(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector2D CallFunc_MakeVector2D_ReturnValue4; // 0x4878(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector2D CallFunc_MakeVector2D_ReturnValue5; // 0x4880(0x0008) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue22; // 0x4888(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_MultiplyMultiply_FloatFloat_ReturnValue; // 0x488C(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Greater_FloatFloat_ReturnValue17; // 0x4890(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData68[0x3]; // 0x4891(0x0003) MISSED OFFSET float CallFunc_FClamp_ReturnValue21; // 0x4894(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_EqualEqual_ByteByte_ReturnValue8; // 0x4898(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData69[0x3]; // 0x4899(0x0003) MISSED OFFSET struct FRotator CallFunc_GetAimOffsets_RootRotOffset; // 0x489C(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_GetAimOffsets_TheRootYawSpeed; // 0x48A8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FVector CallFunc_GetAimOffsets_RootLocOffset; // 0x48AC(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) struct FRotator CallFunc_GetAimOffsets_ReturnValue; // 0x48B8(0x000C) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) bool CallFunc_Not_PreBool_ReturnValue14; // 0x48C4(0x0001) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) unsigned char UnknownData70[0x3]; // 0x48C5(0x0003) MISSED OFFSET float CallFunc_BreakRot_Pitch; // 0x48C8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakRot_Yaw; // 0x48CC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_BreakRot_Roll; // 0x48D0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue23; // 0x48D4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Divide_FloatFloat_ReturnValue24; // 0x48D8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue24; // 0x48DC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Multiply_FloatFloat_ReturnValue25; // 0x48E0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Add_FloatFloat_ReturnValue3; // 0x48E4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_Add_FloatFloat_ReturnValue4; // 0x48E8(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue22; // 0x48EC(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_FClamp_ReturnValue23; // 0x48F0(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) float CallFunc_SelectFloat_ReturnValue15; // 0x48F4(0x0004) (ZeroConstructor, Transient, DuplicateTransient, IsPlainOldData) static UClass* StaticClass() { static auto ptr = UObject::FindClass("AnimBlueprintGeneratedClass BogSpider_AnimBlueprint.BogSpider_AnimBlueprint_C"); return ptr; } void BlueprintPlayAnimationEvent(class UAnimMontage** AnimationMontage, float* PlayRate, float* playedAnimLength); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5741(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5740(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5739(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_ModifyBone_929(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5738(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5737(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_GroundBones_326(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_GroundBones_325(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5742(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5736(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5735(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_RotationOffsetBlendSpace_350(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_RotationOffsetBlendSpace_349(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5734(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5733(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5732(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5731(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5730(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_442(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5729(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5728(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_441(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_440(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5727(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_439(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5726(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5725(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_438(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5724(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5723(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5722(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_437(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_436(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_435(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5721(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_SequencePlayer_7008(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_ApplyAdditive_560(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_SequencePlayer_7007(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5720(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_434(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5719(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5718(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5717(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5716(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5715(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_SequencePlayer_7004(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5714(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_SequencePlayer_7003(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_433(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_TwoWayBlend_108(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5713(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5712(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5711(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_TwoWayBlend_107(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_TwoWayBlend_106(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5710(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5709(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5708(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5707(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5706(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_SequencePlayer_6993(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_SequencePlayer_6992(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_TwoWayBlend_105(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5705(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5704(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5703(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_SequencePlayer_6990(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_SequencePlayer_6989(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5702(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5701(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5700(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5699(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5743(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5697(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5696(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5695(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5694(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5693(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_TwoWayBlend_104(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_ModifyBone_930(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5744(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_431(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5691(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_430(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_429(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendListByBool_5690(); void EvaluateGraphExposedInputs_ExecuteUbergraph_BogSpider_AnimBlueprint_AnimGraphNode_BlendSpacePlayer_428(); void BlueprintUpdateAnimation(float* DeltaTimeX); void ExecuteUbergraph_BogSpider_AnimBlueprint(int EntryPoint); }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "sergey.2bite@gmail.com" ]
sergey.2bite@gmail.com
33b0ff436a34620099a290393664240e47abecee
c9365783e6a3e0c21fea1a74b5a96fbf5d4cd134
/Project8/src/utilities/shapes.cpp
3aa518bde142afd68534418e9f530e5639bf4deb
[]
no_license
atran06/CS53-Final-Game
4f4893bcd2f8e26319618227f346d1cdee4e83a4
72a5c033d676ffa3442bf8e794b55887d8a03310
refs/heads/master
2020-04-09T10:15:34.171739
2018-12-04T05:59:18
2018-12-04T05:59:18
160,264,190
0
0
null
null
null
null
UTF-8
C++
false
false
230
cpp
#include "shapes.h" void Shapes::drawRectangle(int x, int y, int width, int height) { glBegin(GL_QUADS); glVertex2i(x, y); glVertex2i(x + width, y); glVertex2i(x + width, y + height); glVertex2i(x, y + height); glEnd(); }
[ "tran.art13@gmail.com" ]
tran.art13@gmail.com
43bd94316d0080fd3b643c6f0ab0075fe562e4c4
149f2b47b7a5952feab584f8038501d697aa55c8
/semana11/p1.cpp
9515718d10d5d2c5a1be765f562c1bd1c4159424
[]
no_license
GonzaloCirilo/Taller-Programacion
50662410580022defe0b9d4af8d8ae614f6aaad3
9b8da5e7c6d6413680b8f28bb32a0c0d2c7a4624
refs/heads/master
2020-07-09T17:37:19.702894
2019-11-25T18:03:59
2019-11-25T18:03:59
204,035,952
0
0
null
null
null
null
UTF-8
C++
false
false
1,037
cpp
#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; void generarYMostrarDatos(int *arr) { for (int i = 0; i < 30; i++) { arr[i] = rand() % 4 + 1; if (i != 0) cout << "-"; cout << arr[i]; } cout << endl; } void listaPuntajes(int *arr, int *cantXPunt) { for (int i = 0; i < 30; i++) { cantXPunt[arr[i] - 1]++; } for (int i = 0; i < 4; i++) { cout << "La cantidad de personas que votaron por " << i + 1 << " es:" << cantXPunt[i] << endl; } cout << endl; } void mayorVotacion(int *cantXPunt) { int aux = -1, tipoPuntaje = 0; for (int i = 0; i < 4; i++) { if (cantXPunt[i] > aux) { aux = cantXPunt[i]; tipoPuntaje = i + 1; } } cout << "El puntaje con mayor votos es: " << tipoPuntaje; } int main() { srand(time(NULL)); int *arr = new int[30]; int *cantidadPorPuntaje = new int[4]; for (int i = 0; i < 4; i++) { cantidadPorPuntaje[i] = 0; } generarYMostrarDatos(arr); listaPuntajes(arr, cantidadPorPuntaje); mayorVotacion(cantidadPorPuntaje); return 0; }
[ "gonzalo_cirilo@hotmail.com" ]
gonzalo_cirilo@hotmail.com
11eb446db106f2d27ee57df3e64369a62dcca276
351bbc1c779b064c3baba1899fd9418043dab284
/Classes/Enemy.cpp
5b0da8042dd93be67695f0de1df7af83bf9f9370
[ "MIT" ]
permissive
melatron/CellTurnBasedGame
9c808f31f44f9c5239a05ab8b14e340c16fb94f8
89fbd27313e8164c1904a7c0cd4b1c6953eec6dc
refs/heads/master
2020-06-26T20:27:01.139595
2016-09-09T14:54:21
2016-09-09T14:54:21
67,501,626
0
0
null
null
null
null
UTF-8
C++
false
false
3,786
cpp
#include "Enemy.h" #include "Zombie.h" bool Enemy::init() { if (!Node::init()) { return false; } this->isMoving = false; //this should be rewritten if there are more than 1 team this->teamID = 2; this->health = Constants::startingHealth; this->energy = Constants::startingEnergy; this->energyCap = Constants::energyCap; this->healthCap = Constants::healthCap; this->energyCostToMove = Constants::energyCostToMoveEnemy; this->energyCooldown = Constants::enemyRegenCooldown; this->healthCooldown = Constants::enemyRegenCooldown; this->healthCooldownTracker = 0; this->behaviour = nullptr; return true; } void Enemy::addPath(Cell* newCell) { this->walkPath.pushBack(newCell); } void Enemy::clearPaths() { this->walkPath.clear(); } void Enemy::clearTarget() { this->walkPath.clear(); this->targetCell = nullptr; this->targetScore = 0; } void Enemy::interact() { cocos2d::Vector<Cell*> neightbours = this->current->getNeighbours(); for (auto iter = neightbours.begin(); iter != neightbours.end(); iter++) { (*iter)->interact(this); } //this->showStats(); } GameActor* Enemy::click(bool split) { return nullptr; } void Enemy::setBehaviour(Behaviour* behaviour) { this->behaviour = behaviour; } void Enemy::setTargetAndPath(Cell* targetCell, int score, cocos2d::Vector< Cell*> path) { this->targetCell = targetCell; this->targetScore = score; this->walkPath.clear(); this->walkPath = path; } Cell* Enemy::getTargetCell() const { return this->targetCell; } int Enemy::getTargetScore() const { return this->targetScore; } int Enemy::getPathSize() { return this->walkPath.size(); } Cell* Enemy::getNextCell() { bool isThereANewPath = this->behaviour->lookForAMove(this); //If there is no walkPath if (this->walkPath.empty()){ //but there is a target cell (The target cell is neighbour) if (this->targetCell) return nullptr; else return this->generateRandomPath() ? this->walkPath.front() : nullptr; } return this->walkPath.front(); } //Generates random permutation from 0 to maxNum std::vector<int> Enemy::generateRandomPermutation(int maxNum) { std::vector<int> order; for (int i = 0; i < maxNum; i++) { order.push_back(i); } std::random_shuffle(order.begin(), order.end()); return order; } bool Enemy::generateRandomPath() { int pathSize = 5; CCLOG("Generating random path"); //Creates a permutation of the indexes of the neighbours so it can check them randomly 1 by 1 cocos2d::Vector<Cell*> neighbours = this->current->getNeighbours(); std::vector<int> order = this->generateRandomPermutation(neighbours.size()); Cell* nextCell = nullptr; //Attempts to create a path that is pathSize long for (int i = 0; i < pathSize; i++) { bool foundNewPath = false; //Goes through the random ordered neighbours of the cell that we are at the moment (this->current in the beggining) for (auto it = order.begin(); it != order.end(); it++) { //Takes a neighbour and checks if it can be passed and it is not already in the walk path Cell* currentCell = neighbours.at(*it); if (currentCell->isPassable() && currentCell != this->current && this->walkPath.find(currentCell) == this->walkPath.end()) { //If it is, breaks the loop, takes new neighbours and tries to find another cell foundNewPath = true; nextCell = currentCell; this->addPath(nextCell); neighbours = nextCell->getNeighbours(); //Makes new permutation for the new neighbours order = this->generateRandomPermutation(neighbours.size()); break; } } //If it didn't find new cell that means it should stop looking for paths if (!foundNewPath) { i = pathSize; } } //If it added at least 1 new cell to the path it returns true otherwise false return !this->walkPath.empty(); }
[ "antony.dikov@live.com" ]
antony.dikov@live.com
694e6614aa99375f06c1012286e40bd67d21a9a9
9ceacf33fd96913cac7ef15492c126d96cae6911
/gnu/lib/libstdc++/libstdc++/config/locale/generic/time_members.h
6f2a8417f2ada7dcb7d46529f6db9a7c62213ffe
[]
no_license
openbsd/src
ab97ef834fd2d5a7f6729814665e9782b586c130
9e79f3a0ebd11a25b4bff61e900cb6de9e7795e9
refs/heads/master
2023-09-02T18:54:56.624627
2023-09-02T15:16:12
2023-09-02T15:16:12
66,966,208
3,394
1,235
null
2023-08-08T02:42:25
2016-08-30T18:18:25
C
UTF-8
C++
false
false
2,357
h
// std::time_get, std::time_put implementation, generic version -*- C++ -*- // Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 2, or (at your option) // any later version. // This library 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 this library; see the file COPYING. If not, write to the Free // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, // USA. // As a special exception, you may use this file as part of a free software // library without restriction. Specifically, if other files instantiate // templates or use macros or inline functions from this file, or you compile // this file and link it with other files to produce an executable, this // file does not by itself cause the resulting executable to be covered by // the GNU General Public License. This exception does not however // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. // // ISO C++ 14882: 22.2.5.1.2 - time_get functions // ISO C++ 14882: 22.2.5.3.2 - time_put functions // // Written by Benjamin Kosnik <bkoz@redhat.com> template<typename _CharT> __timepunct<_CharT>::__timepunct(size_t __refs) : locale::facet(__refs) { _M_name_timepunct = _S_c_name; _M_initialize_timepunct(); } template<typename _CharT> __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, size_t __refs) : locale::facet(__refs) { size_t __len = strlen(__s) + 1; _M_name_timepunct = new char[__len]; strlcpy(_M_name_timepunct, __s, __len); _M_initialize_timepunct(__cloc); } template<typename _CharT> __timepunct<_CharT>::~__timepunct() { if (_S_c_name != _M_name_timepunct) delete [] _M_name_timepunct; _S_destroy_c_locale(_M_c_locale_timepunct); }
[ "espie@openbsd.org" ]
espie@openbsd.org
81cfa76a454f3538ff73bd910e582fc980aed4fa
4dbaea97b6b6ba4f94f8996b60734888b163f69a
/TOJ/Conversions.cpp
eae23188112c65371a8f8fd2f01fedcc35628078
[]
no_license
Ph0en1xGSeek/ACM
099954dedfccd6e87767acb5d39780d04932fc63
b6730843ab0455ac72b857c0dff1094df0ae40f5
refs/heads/master
2022-10-25T09:15:41.614817
2022-10-04T12:17:11
2022-10-04T12:17:11
63,936,497
2
0
null
null
null
null
UTF-8
C++
false
false
714
cpp
#include <iostream> #include <stdio.h> #include <iomanip> using namespace std; int main() { int num; cin >> num; string str; double n; for(int i = 1; i <= num; i++) { cin >> n >> str; if(str == "kg") cout << i << ' ' << setprecision(4) << fixed << 2.2046 * n << " lb" << endl; else if(str == "lb") cout << i << ' ' << setprecision(4) << fixed << 0.4536 * n << " kg" << endl; else if(str == "l") cout << i << ' ' << setprecision(4) << fixed << 0.2642 * n << " g" << endl; else cout << i << ' ' << setprecision(4) << fixed << 3.7854 * n << " l" << endl; } return 0; }
[ "54panguosheng@gmail.com" ]
54panguosheng@gmail.com
7201eaeeb0f1049325ac497b98062786828a7a89
4c2d0d20b38a62f8c938e2d30f5e85b0d4b7d5b4
/src/failure.hpp
4dcb25fd725b0ef8b963f7bf97d1f629c8346d7d
[]
no_license
kmehrunes/automaniac
aa8bf8817fbf55ca15922d60c6f2798b43c26d36
f62de73f4dacf33c731a02ead52dcef12005e0b3
refs/heads/master
2020-03-28T20:50:30.667893
2018-11-30T10:30:14
2018-11-30T10:30:14
149,107,430
0
0
null
null
null
null
UTF-8
C++
false
false
1,953
hpp
#ifndef FAILURE_HPP #define FAILURE_HPP #include <ostream> #include <functional> struct Error { int code; std::string message; public: Error(int _code, std::string & _msg): code(_code), message(_msg) {} Error(const std::string & _msg): code(-1), message(_msg) {} Error(const char * _msg): code(-1), message(_msg) {} Error(int _code): code(_code), message("") {} }; template <typename ST> class ResultOrError { private: const bool m_success; union { ST m_successValue; Error m_failValue; }; public: ResultOrError(); ResultOrError(const ResultOrError & res): m_success(res.m_success) { if (res.m_success) { m_successValue = res.m_successValue; } else { m_failValue = res.m_failValue; } } ResultOrError(const ST & val): m_success(true), m_successValue(val) {} ResultOrError(const Error & err): m_success(false), m_failValue(err) {} ~ResultOrError() {} template <typename T> static ResultOrError<ST> succeed(const T & arg) { return ResultOrError<T>(arg); } template <typename T> static ResultOrError<ST> fail(const Error & err) { return ResultOrError<T>(err); } bool succeeded() { return m_success; } bool failed() { return !m_success; } ResultOrError<ST> & onSuccess(std::function<void(const ST &)> func) { if (succeeded()) func(m_successValue); return *this; } ResultOrError<ST> & onFailure(std::function<void(const Error &)> func) { if (failed()) func(m_failValue); return *this; } template <typename MT> ResultOrError<MT> mapSuccess(std::function<ResultOrError<MT>(const ST &)> mapper) { if (succeeded()) return mapper(m_successValue); return m_failValue; } const ST & getResult() { return m_successValue; } const Error & getError() { return m_failValue; } }; template <typename ST> ResultOrError<ST> succeed(const ST & arg) { return ResultOrError<ST>(arg); } inline Error fail(const Error & err) { return err; } #endif
[ "kmehrunes@gmail.com" ]
kmehrunes@gmail.com
58880ed747fd1455ac1b3cb15fda50dfa02bfcb0
cdf6a6efdc6469199790eb3835b6e9f3914ceeb5
/Snake++/Snake.cpp
4d351ff64b068370b8ba1d8650fb5ea689d227db
[]
no_license
NyxWallace/Snake
8921889d075e9d56c50547304168e5044f0013b9
0d80269c428988c23eb736df2288ab23ce73fa61
refs/heads/master
2023-02-15T14:55:35.654799
2021-01-14T22:57:22
2021-01-14T22:57:22
328,800,134
0
0
null
null
null
null
UTF-8
C++
false
false
1,896
cpp
#include "Snake.h" Snake::Snake() { Head = new Body(0, 0); Tail = new Body(-1, 0); Head->Next = Tail; Tail->Prev = Head; } /// <summary> /// Move to the next cell without increasing the size /// </summary> /// <param name="pos_x">Number of units moved on the X ax</param> /// <param name="pos_y">Number of units moved on the Y axe</param> /// <returns></returns> int Snake::MoveTo(int pos_x, int pos_y) { int next_x = 0, next_y = 0; next_x = Head->PosX + pos_x; next_y = Head->PosY + pos_y; Body* new_head = new Body(next_x, next_y); new_head->Next = Head; Head->Prev = new_head; Head = new_head; new_head = Tail; Tail = Tail->Prev; Tail->Next = NULL; delete new_head; return 0; } /// <summary> /// Move to the next cell and increase the size by one /// </summary> /// <param name="pos_x">Number of units moved on the X axe</param> /// <param name="pos_y">Number of units moved on the Y axe</param> /// <returns></returns> int Snake::EatTo(int pos_x, int pos_y) { int next_x = 0, next_y = 0; next_x = Head->PosX + pos_x; next_y = Head->PosY + pos_y; Body* new_head = new Body(next_x, next_y); new_head->Next = Head; Head->Prev = new_head; Head = new_head; return 0; } /// <summary> /// Return a matrix of the whole board with 0 if the cell is empty, 1 if a snake body is in the cell or more if snake body parts are overlapping /// </summary> /// <param name="width">Half of the board width</param> /// <param name="height">Half of the board height</param> /// <returns></returns> std::vector<std::vector<int>> Snake::GetMatrix(int width, int height) { std::vector<std::vector<int>> matrix(width * 2, std::vector<int>(height * 2, 0)); Body* current = Head; matrix[current->PosX + width][current->PosY + height]++; while (current->Next != NULL) { current = current->Next; matrix[current->PosX + width][current->PosY + height]++; } return matrix; }
[ "antoine.farine@hotmail.com" ]
antoine.farine@hotmail.com
551d33bd11f016e78e6a0d767af24bfffb0e215f
5c8a1e57d619332dbaca41bbf364523506fb7049
/Includes/IObserver.hpp
dba287eb494ce1b798b8f34afe89647cfab6be61
[]
no_license
thomas-le-moullec/Interactive-Distributed-Scraper
330f1f6bb89a58a21e1818b72d4c7483eb29cd69
fa59d3ea9593a1ca4e66032b1bf480322fcd6453
refs/heads/master
2020-03-28T18:50:52.516612
2018-09-15T16:20:50
2018-09-15T16:20:50
148,918,416
0
0
null
null
null
null
UTF-8
C++
false
false
233
hpp
#ifndef IOBSERVER_HPP_ # define IOBSERVER_HPP_ #include <iostream> #include <vector> namespace Plazza { class IObserver { public: virtual ~IObserver() {}; virtual void Update(std::vector<std::string> data) = 0; }; } #endif
[ "thomas.le-moullec@epitech.eu" ]
thomas.le-moullec@epitech.eu
4ac8518e520e91f999c5ea74ff622b4f42436578
acd268e1d744f2a21052ca62301ff6159cbf8c37
/Components/Bites/src/OgreAdvancedRenderControls.cpp
88d4285ed57fa7ae850c740115c7bae30d3de204
[ "MIT" ]
permissive
digimatic/ogre
07dbcd67936082f31573df55b000f5ceebc387fa
f071f20c82c4df4e96b705d50a178712a7ff90da
refs/heads/master
2020-04-12T08:16:28.479960
2017-01-10T21:32:36
2017-01-10T21:32:36
64,395,447
0
0
null
null
null
null
UTF-8
C++
false
false
9,532
cpp
/* * AdvancedRenderControls.cpp * * Created on: 24.12.2016 * Author: pavel */ #include "OgreAdvancedRenderControls.h" #include <OgreTextureManager.h> #include <OgreMaterialManager.h> #include "OgreTrays.h" namespace OgreBites { AdvancedRenderControls::AdvancedRenderControls(TrayManager* trayMgr, Ogre::Camera* cam) : mCamera(cam), mTrayMgr(trayMgr) { mRoot = Ogre::Root::getSingletonPtr(); // create a params panel for displaying sample details Ogre::StringVector items; items.push_back("cam.pX"); items.push_back("cam.pY"); items.push_back("cam.pZ"); items.push_back(""); items.push_back("cam.oW"); items.push_back("cam.oX"); items.push_back("cam.oY"); items.push_back("cam.oZ"); items.push_back(""); items.push_back("Filtering"); items.push_back("Poly Mode"); #ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM mShaderGenerator = Ogre::RTShader::ShaderGenerator::getSingletonPtr(); items.push_back("RT Shaders"); items.push_back("Lighting Model"); items.push_back("Compact Policy"); items.push_back("Generated VS"); items.push_back("Generated FS"); #endif mDetailsPanel = mTrayMgr->createParamsPanel(TL_NONE, "DetailsPanel", 200, items); mDetailsPanel->hide(); mDetailsPanel->setParamValue(9, "Bilinear"); mDetailsPanel->setParamValue(10, "Solid"); #ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM mDetailsPanel->setParamValue(11, "Off"); if (!mRoot->getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_FIXED_FUNCTION)) { mDetailsPanel->setParamValue(11, "On"); } mDetailsPanel->setParamValue(12, "Vertex"); mDetailsPanel->setParamValue(13, "Low"); mDetailsPanel->setParamValue(14, "0"); mDetailsPanel->setParamValue(15, "0"); #endif } bool AdvancedRenderControls::keyPressed(const KeyboardEvent& evt) { if (mTrayMgr->isDialogVisible()) return true; // don't process any more keys if dialog is up int key = evt.keysym.sym; if (key == 'f') // toggle visibility of advanced frame stats { mTrayMgr->toggleAdvancedFrameStats(); } else if (key == 'g') // toggle visibility of even rarer debugging details { if (mDetailsPanel->getTrayLocation() == TL_NONE) { mTrayMgr->moveWidgetToTray(mDetailsPanel, TL_TOPRIGHT, 0); mDetailsPanel->show(); } else { mTrayMgr->removeWidgetFromTray(mDetailsPanel); mDetailsPanel->hide(); } } else if (key == 't') // cycle texture filtering mode { Ogre::String newVal; Ogre::TextureFilterOptions tfo; unsigned int aniso; switch (Ogre::MaterialManager::getSingleton().getDefaultTextureFiltering(Ogre::FT_MAG)) { case Ogre::TFO_BILINEAR: newVal = "Trilinear"; tfo = Ogre::TFO_TRILINEAR; aniso = 1; break; case Ogre::TFO_TRILINEAR: newVal = "Anisotropic"; tfo = Ogre::TFO_ANISOTROPIC; aniso = 8; break; case Ogre::TFO_ANISOTROPIC: newVal = "None"; tfo = Ogre::TFO_NONE; aniso = 1; break; default: newVal = "Bilinear"; tfo = Ogre::TFO_BILINEAR; aniso = 1; break; } Ogre::MaterialManager::getSingleton().setDefaultTextureFiltering(tfo); Ogre::MaterialManager::getSingleton().setDefaultAnisotropy(aniso); mDetailsPanel->setParamValue(9, newVal); } else if (key == 'r') // cycle polygon rendering mode { Ogre::String newVal; Ogre::PolygonMode pm; switch (mCamera->getPolygonMode()) { case Ogre::PM_SOLID: newVal = "Wireframe"; pm = Ogre::PM_WIREFRAME; break; case Ogre::PM_WIREFRAME: newVal = "Points"; pm = Ogre::PM_POINTS; break; default: newVal = "Solid"; pm = Ogre::PM_SOLID; break; } mCamera->setPolygonMode(pm); mDetailsPanel->setParamValue(10, newVal); } else if (key == SDLK_F5) // refresh all textures { Ogre::TextureManager::getSingleton().reloadAll(); } #ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM // Toggle schemes. else if (key == SDLK_F2) { if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_FIXED_FUNCTION)) { Ogre::Viewport* mainVP = mCamera->getViewport(); const Ogre::String& curMaterialScheme = mainVP->getMaterialScheme(); if (curMaterialScheme == Ogre::MaterialManager::DEFAULT_SCHEME_NAME) { mainVP->setMaterialScheme(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME); mDetailsPanel->setParamValue(11, "On"); } else if (curMaterialScheme == Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME) { mainVP->setMaterialScheme(Ogre::MaterialManager::DEFAULT_SCHEME_NAME); mDetailsPanel->setParamValue(11, "Off"); } } } // Toggles per pixel per light model. else if (key == SDLK_F3) { static bool usePerPixelLighting = true; // Grab the scheme render state. Ogre::RTShader::RenderState* schemRenderState = mShaderGenerator->getRenderState(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME); // Add per pixel lighting sub render state to the global scheme render state. // It will override the default FFP lighting sub render state. if (usePerPixelLighting) { Ogre::RTShader::SubRenderState* perPixelLightModel = mShaderGenerator->createSubRenderState(Ogre::RTShader::PerPixelLighting::Type); schemRenderState->addTemplateSubRenderState(perPixelLightModel); } // Search the per pixel sub render state and remove it. else { const Ogre::RTShader::SubRenderStateList& subRenderStateList = schemRenderState->getTemplateSubRenderStateList(); Ogre::RTShader::SubRenderStateListConstIterator it = subRenderStateList.begin(); Ogre::RTShader::SubRenderStateListConstIterator itEnd = subRenderStateList.end(); for (; it != itEnd; ++it) { Ogre::RTShader::SubRenderState* curSubRenderState = *it; // This is the per pixel sub render state -> remove it. if (curSubRenderState->getType() == Ogre::RTShader::PerPixelLighting::Type) { schemRenderState->removeTemplateSubRenderState(*it); break; } } } // Invalidate the scheme in order to re-generate all shaders based technique related to this // scheme. mShaderGenerator->invalidateScheme(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME); // Update UI. if (usePerPixelLighting) mDetailsPanel->setParamValue(12, "Pixel"); else mDetailsPanel->setParamValue(12, "Vertex"); usePerPixelLighting = !usePerPixelLighting; } // Switch vertex shader outputs compaction policy. else if (key == SDLK_F4) { switch (mShaderGenerator->getVertexShaderOutputsCompactPolicy()) { case Ogre::RTShader::VSOCP_LOW: mShaderGenerator->setVertexShaderOutputsCompactPolicy(Ogre::RTShader::VSOCP_MEDIUM); mDetailsPanel->setParamValue(13, "Medium"); break; case Ogre::RTShader::VSOCP_MEDIUM: mShaderGenerator->setVertexShaderOutputsCompactPolicy(Ogre::RTShader::VSOCP_HIGH); mDetailsPanel->setParamValue(13, "High"); break; case Ogre::RTShader::VSOCP_HIGH: mShaderGenerator->setVertexShaderOutputsCompactPolicy(Ogre::RTShader::VSOCP_LOW); mDetailsPanel->setParamValue(13, "Low"); break; } // Invalidate the scheme in order to re-generate all shaders based technique related to this // scheme. mShaderGenerator->invalidateScheme(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME); } #endif // INCLUDE_RTSHADER_SYSTEM return true; } void AdvancedRenderControls::frameRendered(const Ogre::FrameEvent& evt) { if (!mTrayMgr->isDialogVisible() && mDetailsPanel->isVisible()) { // if details panel is visible, then update its contents mDetailsPanel->setParamValue(0, Ogre::StringConverter::toString(mCamera->getDerivedPosition().x)); mDetailsPanel->setParamValue(1, Ogre::StringConverter::toString(mCamera->getDerivedPosition().y)); mDetailsPanel->setParamValue(2, Ogre::StringConverter::toString(mCamera->getDerivedPosition().z)); mDetailsPanel->setParamValue(4, Ogre::StringConverter::toString(mCamera->getDerivedOrientation().w)); mDetailsPanel->setParamValue(5, Ogre::StringConverter::toString(mCamera->getDerivedOrientation().x)); mDetailsPanel->setParamValue(6, Ogre::StringConverter::toString(mCamera->getDerivedOrientation().y)); mDetailsPanel->setParamValue(7, Ogre::StringConverter::toString(mCamera->getDerivedOrientation().z)); #ifdef INCLUDE_RTSHADER_SYSTEM mDetailsPanel->setParamValue(14, Ogre::StringConverter::toString(mShaderGenerator->getVertexShaderCount())); mDetailsPanel->setParamValue(15, Ogre::StringConverter::toString(mShaderGenerator->getFragmentShaderCount())); #endif } } } /* namespace OgreBites */
[ "rojtberg@gmail.com" ]
rojtberg@gmail.com
5b13e530f205a18ace5ac5173f67644a383e58cf
948f4e13af6b3014582909cc6d762606f2a43365
/testcases/juliet_test_suite/testcases/CWE23_Relative_Path_Traversal/s01/CWE23_Relative_Path_Traversal__char_connect_socket_ifstream_81_bad.cpp
8dfdf246de905013de3387a2f5bbb35d1f951a10
[]
no_license
junxzm1990/ASAN--
0056a341b8537142e10373c8417f27d7825ad89b
ca96e46422407a55bed4aa551a6ad28ec1eeef4e
refs/heads/master
2022-08-02T15:38:56.286555
2022-06-16T22:19:54
2022-06-16T22:19:54
408,238,453
74
13
null
2022-06-16T22:19:55
2021-09-19T21:14:59
null
UTF-8
C++
false
false
1,192
cpp
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE23_Relative_Path_Traversal__char_connect_socket_ifstream_81_bad.cpp Label Definition File: CWE23_Relative_Path_Traversal.label.xml Template File: sources-sink-81_bad.tmpl.cpp */ /* * @description * CWE: 23 Relative Path Traversal * BadSource: connect_socket Read data using a connect socket (client side) * GoodSource: Use a fixed file name * Sinks: ifstream * BadSink : Open the file named in data using ifstream::open() * Flow Variant: 81 Data flow: data passed in a parameter to a virtual method called via a reference * * */ #ifndef OMITBAD #include "std_testcase.h" #include "CWE23_Relative_Path_Traversal__char_connect_socket_ifstream_81.h" #include <fstream> using namespace std; namespace CWE23_Relative_Path_Traversal__char_connect_socket_ifstream_81 { void CWE23_Relative_Path_Traversal__char_connect_socket_ifstream_81_bad::action(char * data) const { { ifstream inputFile; /* POTENTIAL FLAW: Possibly opening a file without validating the file name or path */ inputFile.open((char *)data); inputFile.close(); } } } #endif /* OMITBAD */
[ "yzhang0701@gmail.com" ]
yzhang0701@gmail.com
481007d2d396d60ac0eaee6029f9b58266f59a01
69b4f7c49f18fc193f49275a2d32ffbcbe70471d
/Random contest/ICPC North America Qualifier 2016 Open/J.cpp
629794674363ec286c096c968be47eb0a69eb4fc
[]
no_license
TD2106/Competitive-Programming
05f322a14f1e7a1d62633b713f1416ab0c547b3b
2905c9d5f36909330fc3637f5461aaba8928a154
refs/heads/master
2020-04-03T12:59:49.790124
2019-09-21T14:51:08
2019-09-21T14:51:08
155,270,877
0
0
null
null
null
null
UTF-8
C++
false
false
137
cpp
#include <iostream> using namespace std; int main (){ int tc; string s; cin>>tc; while(tc--){ cin>>s; cout<<s.size()<<endl; } }
[ "duy.le@ubitec.ch" ]
duy.le@ubitec.ch
21c5082f55c562314018b8691875a230274b3e59
18488c64ea8073545133e78a884cac4d6669ccf0
/28_NhamChuSo.cpp
38cc7114fb9dd0d107d8c751a8f23087c51bd246
[]
no_license
manhtung001/Datastructure-Algorithm-PTIT
f6b1c3bbc2476af3989b8796696dbbb7750e91fe
c41a344d4fbfd92bf587eac14861568d2029321b
refs/heads/master
2023-06-24T07:19:33.970580
2021-07-21T13:44:54
2021-07-21T13:44:54
344,992,505
1
1
null
null
null
null
UTF-8
C++
false
false
622
cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll SO(string s) { ll so = 0; for (int i = 0; i < s.size(); i++) { so = so * 10 + s[i] - '0'; } return so; } main() { string a, b; cin >> a >> b; for (int i = 0; i < a.size(); i++) { if (a[i] == '6') a[i] = '5'; } for (int i = 0; i < b.size(); i++) { if (b[i] == '6') b[i] = '5'; } cout << SO(a) + SO(b) << " "; for (int i = 0; i < a.size(); i++) { if (a[i] == '5') a[i] = '6'; } for (int i = 0; i < b.size(); i++) { if (b[i] == '5') b[i] = '6'; } cout << SO(a) + SO(b); }
[ "khongtung001@gmail.com" ]
khongtung001@gmail.com
62919695b27365d1a53656f6da2623a82f06a8ed
fbc8bbdf2fcafbbcf06ea87aac99aad103dfc773
/VTK/Accelerators/Vtkm/vtkmlib/UnstructuredGridConverter.cxx
a134f38a3f7286aba7921c18c3c583670967192d
[ "BSD-3-Clause" ]
permissive
vildenst/In_Silico_Heart_Models
a6d3449479f2ae1226796ca8ae9c8315966c231e
dab84821e678f98cdd702620a3f0952699eace7c
refs/heads/master
2020-12-02T20:50:19.721226
2017-07-24T17:27:45
2017-07-24T17:27:45
96,219,496
4
0
null
null
null
null
UTF-8
C++
false
false
4,098
cxx
//============================================================================= // // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. // // Copyright 2012 Sandia Corporation. // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. // //============================================================================= #include "UnstructuredGridConverter.h" #include "ArrayConverters.h" #include "CellSetConverters.h" #include "DataSetConverters.h" // datasets we support #include "vtkCellArray.h" #include "vtkCellTypes.h" #include "vtkDataObject.h" #include "vtkDataObjectTypes.h" #include "vtkDataSetAttributes.h" #include "vtkImageData.h" #include "vtkNew.h" #include "vtkPointData.h" #include "vtkPolyData.h" #include "vtkStructuredGrid.h" #include "vtkUniformGrid.h" #include "vtkUnstructuredGrid.h" #include <vtkm/cont/ArrayHandle.h> #include <vtkm/cont/DataSetBuilderUniform.h> #include <vtkm/cont/Field.h> namespace tovtkm { //------------------------------------------------------------------------------ // convert an unstructured grid type vtkm::cont::DataSet Convert(vtkUnstructuredGrid* input) { // This will need to use the custom storage and portals so that // we can efficiently map between VTK and VTKm vtkm::cont::DataSet dataset; // first step convert the points over to an array handle vtkm::cont::CoordinateSystem coords = Convert(input->GetPoints()); dataset.AddCoordinateSystem(coords); // last // Use our custom explicit cell set to do the conversion const vtkIdType numPoints = input->GetNumberOfPoints(); if (input->IsHomogeneous()) { int cellType = input->GetCellType(0); // get the celltype vtkm::cont::DynamicCellSet cells = ConvertSingleType(input->GetCells(), cellType, numPoints); dataset.AddCellSet(cells); } else { vtkm::cont::DynamicCellSet cells = Convert(input->GetCellTypesArray(), input->GetCells(), input->GetCellLocationsArray(), numPoints); dataset.AddCellSet(cells); } return dataset; } } // namespace tovtkm namespace fromvtkm { //------------------------------------------------------------------------------ bool Convert(const vtkm::cont::DataSet& voutput, vtkUnstructuredGrid* output, vtkDataSet* input) { vtkPoints* points = fromvtkm::Convert(voutput.GetCoordinateSystem()); // If this fails, it's likely a missing entry in tovtkm::PointListOutVTK: if (!points) { return false; } output->SetPoints(points); points->FastDelete(); // With unstructured grids we need to actually convert 3 arrays from // vtkm to vtk vtkNew<vtkCellArray> cells; vtkNew<vtkUnsignedCharArray> types; vtkNew<vtkIdTypeArray> locations; vtkm::cont::DynamicCellSet outCells = voutput.GetCellSet(); const bool cellsConverted = fromvtkm::Convert( outCells, cells.GetPointer(), types.GetPointer(), locations.GetPointer()); if (!cellsConverted) { return false; } output->SetCells(types.GetPointer(), locations.GetPointer(), cells.GetPointer()); // now have to set this info back to the unstructured grid // Next we need to convert any extra fields from vtkm over to vtk const bool arraysConverted = fromvtkm::ConvertArrays(voutput, output); // Pass information about attributes. for (int attributeType = 0; attributeType < vtkDataSetAttributes::NUM_ATTRIBUTES; attributeType++) { vtkDataArray* attribute = input->GetPointData()->GetAttribute(attributeType); if (attribute == NULL) { continue; } output->GetPointData()->SetActiveAttribute(attribute->GetName(), attributeType); } return arraysConverted; } } // namespace fromvtkm
[ "vilde@Vildes-MBP" ]
vilde@Vildes-MBP
a673a60ed1224ccb28a8c3693fbfe01cca2bf5dd
83f193d9bdeff2449d02d8ce3b4b7fb391c41ab8
/cpp/mahjong.pb.cc
8c18f97541deb6ef4ad0f568d85e95e8eeb4cede
[]
no_license
ruaruagerry/mahjong_proto
384725e8e81b1866e52d9b447b4b370a10099183
d488cb44585eab36a5f94567409442662951585e
refs/heads/master
2022-07-14T15:30:59.188397
2020-05-11T15:25:28
2020-05-11T15:25:28
263,081,126
0
0
null
null
null
null
UTF-8
C++
false
true
785,498
cc
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: mahjong.proto #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include "mahjong.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* LoginReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* LoginReq_reflection_ = NULL; const ::google::protobuf::Descriptor* WeChatLoginReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* WeChatLoginReq_reflection_ = NULL; const ::google::protobuf::Descriptor* LoginRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* LoginRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* ExtraDeskTypeInfo_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* ExtraDeskTypeInfo_reflection_ = NULL; const ::google::protobuf::Descriptor* GameEnterDeskReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameEnterDeskReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameEnterDeskRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameEnterDeskRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* UserRoomCardChange_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* UserRoomCardChange_reflection_ = NULL; const ::google::protobuf::Descriptor* GameUserInfo_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameUserInfo_reflection_ = NULL; const ::google::protobuf::Descriptor* UserCommonCards_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* UserCommonCards_reflection_ = NULL; const ::google::protobuf::Descriptor* MyOption_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* MyOption_reflection_ = NULL; const ::google::protobuf::Descriptor* EvtDeskUserEnter_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* EvtDeskUserEnter_reflection_ = NULL; const ::google::protobuf::Descriptor* GameExitDeskReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameExitDeskReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameExitDeskRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameExitDeskRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* DeskPlayInfo_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* DeskPlayInfo_reflection_ = NULL; const ::google::protobuf::Descriptor* EvtUserExit_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* EvtUserExit_reflection_ = NULL; const ::google::protobuf::Descriptor* ClientNotifyStartGameReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* ClientNotifyStartGameReq_reflection_ = NULL; const ::google::protobuf::Descriptor* ClientNotifyStartGameRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* ClientNotifyStartGameRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* GameSendCardReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameSendCardReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameSendCardRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameSendCardRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionChiReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionChiReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionChiRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionChiRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionPengReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionPengReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionPengRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionPengRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionGangReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionGangReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionGangRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionGangRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionHuReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionHuReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionHuRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionHuRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionPassReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionPassReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionPassRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionPassRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* GamePlayerReadyReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GamePlayerReadyReq_reflection_ = NULL; const ::google::protobuf::Descriptor* UserStatus_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* UserStatus_reflection_ = NULL; const ::google::protobuf::Descriptor* GamePlayerReadyEvt_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GamePlayerReadyEvt_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionGangNotFirstReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionGangNotFirstReq_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOptionGangNotFirstRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOptionGangNotFirstRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* ApplyDeleteReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* ApplyDeleteReq_reflection_ = NULL; const ::google::protobuf::Descriptor* ApplyDeleteEvt_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* ApplyDeleteEvt_reflection_ = NULL; const ::google::protobuf::Descriptor* UserOption_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* UserOption_reflection_ = NULL; const ::google::protobuf::Descriptor* GameInfoEvt_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameInfoEvt_reflection_ = NULL; const ::google::protobuf::Descriptor* GameOverResultInfo_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* GameOverResultInfo_reflection_ = NULL; const ::google::protobuf::Descriptor* EvtGameOver_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* EvtGameOver_reflection_ = NULL; const ::google::protobuf::Descriptor* RecordInfo_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* RecordInfo_reflection_ = NULL; const ::google::protobuf::Descriptor* PerPlayRecord_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* PerPlayRecord_reflection_ = NULL; const ::google::protobuf::Descriptor* MyPlayRecordListReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* MyPlayRecordListReq_reflection_ = NULL; const ::google::protobuf::Descriptor* MyPlayRecordListRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* MyPlayRecordListRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* RoundPlayRecordsReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* RoundPlayRecordsReq_reflection_ = NULL; const ::google::protobuf::Descriptor* RoundPlayRecordsRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* RoundPlayRecordsRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* DeskChatReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* DeskChatReq_reflection_ = NULL; const ::google::protobuf::Descriptor* DeskChatEvt_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* DeskChatEvt_reflection_ = NULL; const ::google::protobuf::Descriptor* LogOutReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* LogOutReq_reflection_ = NULL; const ::google::protobuf::Descriptor* LogOutRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* LogOutRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* EvtBroadCast_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* EvtBroadCast_reflection_ = NULL; const ::google::protobuf::Descriptor* UserCreatePreBill_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* UserCreatePreBill_reflection_ = NULL; const ::google::protobuf::Descriptor* CreateFormalBill_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* CreateFormalBill_reflection_ = NULL; const ::google::protobuf::Descriptor* SetInviteUserReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* SetInviteUserReq_reflection_ = NULL; const ::google::protobuf::Descriptor* SetInviteUserRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* SetInviteUserRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* HeartBeatReq_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* HeartBeatReq_reflection_ = NULL; const ::google::protobuf::Descriptor* HeartBeatRsp_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* HeartBeatRsp_reflection_ = NULL; const ::google::protobuf::Descriptor* ws_msg_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* ws_msg_reflection_ = NULL; const ::google::protobuf::Descriptor* WsProtoTest_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* WsProtoTest_reflection_ = NULL; } // namespace void protobuf_AssignDesc_mahjong_2eproto() { protobuf_AddDesc_mahjong_2eproto(); const ::google::protobuf::FileDescriptor* file = ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( "mahjong.proto"); GOOGLE_CHECK(file != NULL); LoginReq_descriptor_ = file->message_type(0); static const int LoginReq_offsets_[9] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, nick_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, uuid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, sign_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, channel_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, os_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, is_register_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, extra_username_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, extra_password_), }; LoginReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( LoginReq_descriptor_, LoginReq::default_instance_, LoginReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(LoginReq)); WeChatLoginReq_descriptor_ = file->message_type(1); static const int WeChatLoginReq_offsets_[7] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, sign_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, openid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, token_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, expire_date_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, channel_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, version_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, os_), }; WeChatLoginReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( WeChatLoginReq_descriptor_, WeChatLoginReq::default_instance_, WeChatLoginReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WeChatLoginReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(WeChatLoginReq)); LoginRsp_descriptor_ = file->message_type(2); static const int LoginRsp_offsets_[13] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, password_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, nick_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, sex_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, old_deskid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, portrait_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, wx_public_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, wx_agent_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, ip_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, room_card_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, ret_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, wy_yunxin_token_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, hall_billband_), }; LoginRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( LoginRsp_descriptor_, LoginRsp::default_instance_, LoginRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LoginRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(LoginRsp)); ExtraDeskTypeInfo_descriptor_ = file->message_type(3); static const int ExtraDeskTypeInfo_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtraDeskTypeInfo, hongzhong_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtraDeskTypeInfo, qidui_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtraDeskTypeInfo, zhuaniao_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtraDeskTypeInfo, piaofen_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtraDeskTypeInfo, shanghuo_), }; ExtraDeskTypeInfo_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( ExtraDeskTypeInfo_descriptor_, ExtraDeskTypeInfo::default_instance_, ExtraDeskTypeInfo_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtraDeskTypeInfo, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtraDeskTypeInfo, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(ExtraDeskTypeInfo)); GameEnterDeskReq_descriptor_ = file->message_type(4); static const int GameEnterDeskReq_offsets_[8] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, dst_desk_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, new_desk_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, reconnect_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, card_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, desk_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, seat_limit_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, win_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, extra_type_), }; GameEnterDeskReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameEnterDeskReq_descriptor_, GameEnterDeskReq::default_instance_, GameEnterDeskReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameEnterDeskReq)); GameEnterDeskRsp_descriptor_ = file->message_type(5); static const int GameEnterDeskRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskRsp, ret_), }; GameEnterDeskRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameEnterDeskRsp_descriptor_, GameEnterDeskRsp::default_instance_, GameEnterDeskRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameEnterDeskRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameEnterDeskRsp)); UserRoomCardChange_descriptor_ = file->message_type(6); static const int UserRoomCardChange_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserRoomCardChange, room_card_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserRoomCardChange, change_reason_), }; UserRoomCardChange_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( UserRoomCardChange_descriptor_, UserRoomCardChange::default_instance_, UserRoomCardChange_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserRoomCardChange, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserRoomCardChange, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(UserRoomCardChange)); GameUserInfo_descriptor_ = file->message_type(7); static const int GameUserInfo_offsets_[10] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, nick_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, seatid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, sex_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, portrait_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, is_master_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, piaofen_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, shanghuo_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, ip_), }; GameUserInfo_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameUserInfo_descriptor_, GameUserInfo::default_instance_, GameUserInfo_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameUserInfo, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameUserInfo)); UserCommonCards_descriptor_ = file->message_type(8); static const int UserCommonCards_offsets_[8] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, card_len_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, out_cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, discard_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, seatid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, op_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, chips_), }; UserCommonCards_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( UserCommonCards_descriptor_, UserCommonCards::default_instance_, UserCommonCards_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCommonCards, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(UserCommonCards)); MyOption_descriptor_ = file->message_type(9); static const int MyOption_offsets_[6] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyOption, op_chi_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyOption, op_peng_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyOption, op_gang_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyOption, op_hu_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyOption, need_wait_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyOption, chi_cards_), }; MyOption_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( MyOption_descriptor_, MyOption::default_instance_, MyOption_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyOption, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyOption, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(MyOption)); EvtDeskUserEnter_descriptor_ = file->message_type(10); static const int EvtDeskUserEnter_offsets_[21] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, deskid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, op_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, max_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, users_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, next_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, dealer_seatid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, in_users_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, share_cards_len_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, game_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, my_option_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, recv_card_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, desk_remain_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, seat_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, remain_time_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, apply_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, win_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, extra_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, pre_remain_time_), }; EvtDeskUserEnter_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( EvtDeskUserEnter_descriptor_, EvtDeskUserEnter::default_instance_, EvtDeskUserEnter_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtDeskUserEnter, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(EvtDeskUserEnter)); GameExitDeskReq_descriptor_ = file->message_type(11); static const int GameExitDeskReq_offsets_[1] = { }; GameExitDeskReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameExitDeskReq_descriptor_, GameExitDeskReq::default_instance_, GameExitDeskReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameExitDeskReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameExitDeskReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameExitDeskReq)); GameExitDeskRsp_descriptor_ = file->message_type(12); static const int GameExitDeskRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameExitDeskRsp, ret_), }; GameExitDeskRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameExitDeskRsp_descriptor_, GameExitDeskRsp::default_instance_, GameExitDeskRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameExitDeskRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameExitDeskRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameExitDeskRsp)); DeskPlayInfo_descriptor_ = file->message_type(13); static const int DeskPlayInfo_offsets_[19] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, card_len_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, out_cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, out_card_len_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, discards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, chips_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, round_win_chips_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, total_chi_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, total_peng_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, total_gang_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, total_ganged_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, total_hu_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, total_hued_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, round_chi_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, round_peng_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, round_gang_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, round_ganged_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, role_), }; DeskPlayInfo_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( DeskPlayInfo_descriptor_, DeskPlayInfo::default_instance_, DeskPlayInfo_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskPlayInfo, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(DeskPlayInfo)); EvtUserExit_descriptor_ = file->message_type(14); static const int EvtUserExit_offsets_[9] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, deskid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, dealer_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, op_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, op_status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, next_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, play_info_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, player_op_past_time_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, dealer_seatid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, reason_), }; EvtUserExit_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( EvtUserExit_descriptor_, EvtUserExit::default_instance_, EvtUserExit_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtUserExit, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(EvtUserExit)); ClientNotifyStartGameReq_descriptor_ = file->message_type(15); static const int ClientNotifyStartGameReq_offsets_[1] = { }; ClientNotifyStartGameReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( ClientNotifyStartGameReq_descriptor_, ClientNotifyStartGameReq::default_instance_, ClientNotifyStartGameReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientNotifyStartGameReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientNotifyStartGameReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(ClientNotifyStartGameReq)); ClientNotifyStartGameRsp_descriptor_ = file->message_type(16); static const int ClientNotifyStartGameRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientNotifyStartGameRsp, ret_), }; ClientNotifyStartGameRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( ClientNotifyStartGameRsp_descriptor_, ClientNotifyStartGameRsp::default_instance_, ClientNotifyStartGameRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientNotifyStartGameRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ClientNotifyStartGameRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(ClientNotifyStartGameRsp)); GameSendCardReq_descriptor_ = file->message_type(17); static const int GameSendCardReq_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameSendCardReq, card_), }; GameSendCardReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameSendCardReq_descriptor_, GameSendCardReq::default_instance_, GameSendCardReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameSendCardReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameSendCardReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameSendCardReq)); GameSendCardRsp_descriptor_ = file->message_type(18); static const int GameSendCardRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameSendCardRsp, ret_), }; GameSendCardRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameSendCardRsp_descriptor_, GameSendCardRsp::default_instance_, GameSendCardRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameSendCardRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameSendCardRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameSendCardRsp)); GameOptionChiReq_descriptor_ = file->message_type(19); static const int GameOptionChiReq_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionChiReq, index_), }; GameOptionChiReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionChiReq_descriptor_, GameOptionChiReq::default_instance_, GameOptionChiReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionChiReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionChiReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionChiReq)); GameOptionChiRsp_descriptor_ = file->message_type(20); static const int GameOptionChiRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionChiRsp, ret_), }; GameOptionChiRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionChiRsp_descriptor_, GameOptionChiRsp::default_instance_, GameOptionChiRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionChiRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionChiRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionChiRsp)); GameOptionPengReq_descriptor_ = file->message_type(21); static const int GameOptionPengReq_offsets_[1] = { }; GameOptionPengReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionPengReq_descriptor_, GameOptionPengReq::default_instance_, GameOptionPengReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPengReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPengReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionPengReq)); GameOptionPengRsp_descriptor_ = file->message_type(22); static const int GameOptionPengRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPengRsp, ret_), }; GameOptionPengRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionPengRsp_descriptor_, GameOptionPengRsp::default_instance_, GameOptionPengRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPengRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPengRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionPengRsp)); GameOptionGangReq_descriptor_ = file->message_type(23); static const int GameOptionGangReq_offsets_[1] = { }; GameOptionGangReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionGangReq_descriptor_, GameOptionGangReq::default_instance_, GameOptionGangReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionGangReq)); GameOptionGangRsp_descriptor_ = file->message_type(24); static const int GameOptionGangRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangRsp, ret_), }; GameOptionGangRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionGangRsp_descriptor_, GameOptionGangRsp::default_instance_, GameOptionGangRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionGangRsp)); GameOptionHuReq_descriptor_ = file->message_type(25); static const int GameOptionHuReq_offsets_[1] = { }; GameOptionHuReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionHuReq_descriptor_, GameOptionHuReq::default_instance_, GameOptionHuReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionHuReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionHuReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionHuReq)); GameOptionHuRsp_descriptor_ = file->message_type(26); static const int GameOptionHuRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionHuRsp, ret_), }; GameOptionHuRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionHuRsp_descriptor_, GameOptionHuRsp::default_instance_, GameOptionHuRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionHuRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionHuRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionHuRsp)); GameOptionPassReq_descriptor_ = file->message_type(27); static const int GameOptionPassReq_offsets_[1] = { }; GameOptionPassReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionPassReq_descriptor_, GameOptionPassReq::default_instance_, GameOptionPassReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPassReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPassReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionPassReq)); GameOptionPassRsp_descriptor_ = file->message_type(28); static const int GameOptionPassRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPassRsp, ret_), }; GameOptionPassRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionPassRsp_descriptor_, GameOptionPassRsp::default_instance_, GameOptionPassRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPassRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionPassRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionPassRsp)); GamePlayerReadyReq_descriptor_ = file->message_type(29); static const int GamePlayerReadyReq_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyReq, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyReq, piaofen_), }; GamePlayerReadyReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GamePlayerReadyReq_descriptor_, GamePlayerReadyReq::default_instance_, GamePlayerReadyReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GamePlayerReadyReq)); UserStatus_descriptor_ = file->message_type(30); static const int UserStatus_offsets_[4] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserStatus, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserStatus, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserStatus, piaofen_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserStatus, shanghuo_), }; UserStatus_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( UserStatus_descriptor_, UserStatus::default_instance_, UserStatus_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserStatus, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserStatus, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(UserStatus)); GamePlayerReadyEvt_descriptor_ = file->message_type(31); static const int GamePlayerReadyEvt_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyEvt, users_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyEvt, pre_remain_time_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyEvt, deskid_), }; GamePlayerReadyEvt_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GamePlayerReadyEvt_descriptor_, GamePlayerReadyEvt::default_instance_, GamePlayerReadyEvt_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyEvt, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GamePlayerReadyEvt, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GamePlayerReadyEvt)); GameOptionGangNotFirstReq_descriptor_ = file->message_type(32); static const int GameOptionGangNotFirstReq_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangNotFirstReq, gang_card_), }; GameOptionGangNotFirstReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionGangNotFirstReq_descriptor_, GameOptionGangNotFirstReq::default_instance_, GameOptionGangNotFirstReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangNotFirstReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangNotFirstReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionGangNotFirstReq)); GameOptionGangNotFirstRsp_descriptor_ = file->message_type(33); static const int GameOptionGangNotFirstRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangNotFirstRsp, ret_), }; GameOptionGangNotFirstRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOptionGangNotFirstRsp_descriptor_, GameOptionGangNotFirstRsp::default_instance_, GameOptionGangNotFirstRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangNotFirstRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOptionGangNotFirstRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOptionGangNotFirstRsp)); ApplyDeleteReq_descriptor_ = file->message_type(34); static const int ApplyDeleteReq_offsets_[1] = { }; ApplyDeleteReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( ApplyDeleteReq_descriptor_, ApplyDeleteReq::default_instance_, ApplyDeleteReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(ApplyDeleteReq)); ApplyDeleteEvt_descriptor_ = file->message_type(35); static const int ApplyDeleteEvt_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteEvt, apply_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteEvt, game_status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteEvt, remain_time_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteEvt, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteEvt, deskid_), }; ApplyDeleteEvt_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( ApplyDeleteEvt_descriptor_, ApplyDeleteEvt::default_instance_, ApplyDeleteEvt_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteEvt, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ApplyDeleteEvt, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(ApplyDeleteEvt)); UserOption_descriptor_ = file->message_type(36); static const int UserOption_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserOption, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserOption, type_), }; UserOption_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( UserOption_descriptor_, UserOption::default_instance_, UserOption_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserOption, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserOption, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(UserOption)); GameInfoEvt_descriptor_ = file->message_type(37); static const int GameInfoEvt_offsets_[14] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, deskid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, next_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, max_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, dealer_seatid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, users_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, op_user_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, share_cards_len_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, game_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, my_option_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, recv_card_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, desk_remain_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, seat_num_), }; GameInfoEvt_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameInfoEvt_descriptor_, GameInfoEvt::default_instance_, GameInfoEvt_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameInfoEvt, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameInfoEvt)); GameOverResultInfo_descriptor_ = file->message_type(38); static const int GameOverResultInfo_offsets_[22] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, chips_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, round_chi_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, round_peng_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, round_gang_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, round_hu_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, round_win_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, total_chi_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, total_peng_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, total_gang_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, total_hu_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, total_win_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, piaofen_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, shanghuo_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, bird_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, out_cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, op_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, round_win_chips_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, over_chips_details_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, round_win_chips_before_), }; GameOverResultInfo_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( GameOverResultInfo_descriptor_, GameOverResultInfo::default_instance_, GameOverResultInfo_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GameOverResultInfo, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(GameOverResultInfo)); EvtGameOver_descriptor_ = file->message_type(39); static const int EvtGameOver_offsets_[13] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, winners_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, result_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, deskid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, status_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, remain_round_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, bird_card_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, seat_limit_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, win_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, extra_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, last_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, over_time_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, over_reason_), }; EvtGameOver_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( EvtGameOver_descriptor_, EvtGameOver::default_instance_, EvtGameOver_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtGameOver, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(EvtGameOver)); RecordInfo_descriptor_ = file->message_type(40); static const int RecordInfo_offsets_[26] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, role_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, chips_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, round_win_chips_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, round_chi_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, round_peng_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, round_gang_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, round_hu_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, round_win_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, total_chi_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, total_peng_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, total_gang_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, total_hu_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, total_win_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, piaofen_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, shanghuo_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, bird_num_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, out_cards_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, op_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, over_chips_details_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, round_win_chips_before_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, nick_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, seatid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, sex_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, portrait_), }; RecordInfo_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( RecordInfo_descriptor_, RecordInfo::default_instance_, RecordInfo_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RecordInfo, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(RecordInfo)); PerPlayRecord_descriptor_ = file->message_type(41); static const int PerPlayRecord_offsets_[13] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, roundid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, result_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, deskid_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, game_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, desk_round_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, bird_card_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, seat_limit_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, win_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, extra_type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, over_time_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, master_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, winners_), }; PerPlayRecord_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( PerPlayRecord_descriptor_, PerPlayRecord::default_instance_, PerPlayRecord_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PerPlayRecord, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(PerPlayRecord)); MyPlayRecordListReq_descriptor_ = file->message_type(42); static const int MyPlayRecordListReq_offsets_[1] = { }; MyPlayRecordListReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( MyPlayRecordListReq_descriptor_, MyPlayRecordListReq::default_instance_, MyPlayRecordListReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyPlayRecordListReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyPlayRecordListReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(MyPlayRecordListReq)); MyPlayRecordListRsp_descriptor_ = file->message_type(43); static const int MyPlayRecordListRsp_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyPlayRecordListRsp, record_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyPlayRecordListRsp, ret_), }; MyPlayRecordListRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( MyPlayRecordListRsp_descriptor_, MyPlayRecordListRsp::default_instance_, MyPlayRecordListRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyPlayRecordListRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MyPlayRecordListRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(MyPlayRecordListRsp)); RoundPlayRecordsReq_descriptor_ = file->message_type(44); static const int RoundPlayRecordsReq_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RoundPlayRecordsReq, round_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RoundPlayRecordsReq, game_round_index_), }; RoundPlayRecordsReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( RoundPlayRecordsReq_descriptor_, RoundPlayRecordsReq::default_instance_, RoundPlayRecordsReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RoundPlayRecordsReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RoundPlayRecordsReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(RoundPlayRecordsReq)); RoundPlayRecordsRsp_descriptor_ = file->message_type(45); static const int RoundPlayRecordsRsp_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RoundPlayRecordsRsp, record_list_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RoundPlayRecordsRsp, ret_), }; RoundPlayRecordsRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( RoundPlayRecordsRsp_descriptor_, RoundPlayRecordsRsp::default_instance_, RoundPlayRecordsRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RoundPlayRecordsRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RoundPlayRecordsRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(RoundPlayRecordsRsp)); DeskChatReq_descriptor_ = file->message_type(46); static const int DeskChatReq_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatReq, content_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatReq, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatReq, index_), }; DeskChatReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( DeskChatReq_descriptor_, DeskChatReq::default_instance_, DeskChatReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(DeskChatReq)); DeskChatEvt_descriptor_ = file->message_type(47); static const int DeskChatEvt_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatEvt, ret_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatEvt, op_uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatEvt, sex_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatEvt, index_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatEvt, content_), }; DeskChatEvt_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( DeskChatEvt_descriptor_, DeskChatEvt::default_instance_, DeskChatEvt_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatEvt, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DeskChatEvt, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(DeskChatEvt)); LogOutReq_descriptor_ = file->message_type(48); static const int LogOutReq_offsets_[1] = { }; LogOutReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( LogOutReq_descriptor_, LogOutReq::default_instance_, LogOutReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogOutReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogOutReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(LogOutReq)); LogOutRsp_descriptor_ = file->message_type(49); static const int LogOutRsp_offsets_[1] = { }; LogOutRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( LogOutRsp_descriptor_, LogOutRsp::default_instance_, LogOutRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogOutRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LogOutRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(LogOutRsp)); EvtBroadCast_descriptor_ = file->message_type(50); static const int EvtBroadCast_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtBroadCast, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtBroadCast, content_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtBroadCast, nick_), }; EvtBroadCast_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( EvtBroadCast_descriptor_, EvtBroadCast::default_instance_, EvtBroadCast_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtBroadCast, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EvtBroadCast, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(EvtBroadCast)); UserCreatePreBill_descriptor_ = file->message_type(51); static const int UserCreatePreBill_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCreatePreBill, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCreatePreBill, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCreatePreBill, item_id_), }; UserCreatePreBill_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( UserCreatePreBill_descriptor_, UserCreatePreBill::default_instance_, UserCreatePreBill_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCreatePreBill, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UserCreatePreBill, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(UserCreatePreBill)); CreateFormalBill_descriptor_ = file->message_type(52); static const int CreateFormalBill_offsets_[2] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CreateFormalBill, uin_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CreateFormalBill, item_id_), }; CreateFormalBill_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( CreateFormalBill_descriptor_, CreateFormalBill::default_instance_, CreateFormalBill_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CreateFormalBill, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CreateFormalBill, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(CreateFormalBill)); SetInviteUserReq_descriptor_ = file->message_type(53); static const int SetInviteUserReq_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SetInviteUserReq, uin_), }; SetInviteUserReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( SetInviteUserReq_descriptor_, SetInviteUserReq::default_instance_, SetInviteUserReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SetInviteUserReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SetInviteUserReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(SetInviteUserReq)); SetInviteUserRsp_descriptor_ = file->message_type(54); static const int SetInviteUserRsp_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SetInviteUserRsp, ret_), }; SetInviteUserRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( SetInviteUserRsp_descriptor_, SetInviteUserRsp::default_instance_, SetInviteUserRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SetInviteUserRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SetInviteUserRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(SetInviteUserRsp)); HeartBeatReq_descriptor_ = file->message_type(55); static const int HeartBeatReq_offsets_[1] = { }; HeartBeatReq_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( HeartBeatReq_descriptor_, HeartBeatReq::default_instance_, HeartBeatReq_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeartBeatReq, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeartBeatReq, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(HeartBeatReq)); HeartBeatRsp_descriptor_ = file->message_type(56); static const int HeartBeatRsp_offsets_[1] = { }; HeartBeatRsp_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( HeartBeatRsp_descriptor_, HeartBeatRsp::default_instance_, HeartBeatRsp_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeartBeatRsp, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeartBeatRsp, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(HeartBeatRsp)); ws_msg_descriptor_ = file->message_type(57); static const int ws_msg_offsets_[1] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ws_msg, ms_op_int_), }; ws_msg_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( ws_msg_descriptor_, ws_msg::default_instance_, ws_msg_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ws_msg, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ws_msg, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(ws_msg)); WsProtoTest_descriptor_ = file->message_type(58); static const int WsProtoTest_offsets_[5] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WsProtoTest, op_int_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WsProtoTest, re_int_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WsProtoTest, op_str_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WsProtoTest, op_msg_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WsProtoTest, re_msg_), }; WsProtoTest_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( WsProtoTest_descriptor_, WsProtoTest::default_instance_, WsProtoTest_offsets_, GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WsProtoTest, _has_bits_[0]), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(WsProtoTest, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(WsProtoTest)); } namespace { GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); inline void protobuf_AssignDescriptorsOnce() { ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, &protobuf_AssignDesc_mahjong_2eproto); } void protobuf_RegisterTypes(const ::std::string&) { protobuf_AssignDescriptorsOnce(); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( LoginReq_descriptor_, &LoginReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( WeChatLoginReq_descriptor_, &WeChatLoginReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( LoginRsp_descriptor_, &LoginRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( ExtraDeskTypeInfo_descriptor_, &ExtraDeskTypeInfo::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameEnterDeskReq_descriptor_, &GameEnterDeskReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameEnterDeskRsp_descriptor_, &GameEnterDeskRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( UserRoomCardChange_descriptor_, &UserRoomCardChange::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameUserInfo_descriptor_, &GameUserInfo::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( UserCommonCards_descriptor_, &UserCommonCards::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( MyOption_descriptor_, &MyOption::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( EvtDeskUserEnter_descriptor_, &EvtDeskUserEnter::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameExitDeskReq_descriptor_, &GameExitDeskReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameExitDeskRsp_descriptor_, &GameExitDeskRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( DeskPlayInfo_descriptor_, &DeskPlayInfo::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( EvtUserExit_descriptor_, &EvtUserExit::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( ClientNotifyStartGameReq_descriptor_, &ClientNotifyStartGameReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( ClientNotifyStartGameRsp_descriptor_, &ClientNotifyStartGameRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameSendCardReq_descriptor_, &GameSendCardReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameSendCardRsp_descriptor_, &GameSendCardRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionChiReq_descriptor_, &GameOptionChiReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionChiRsp_descriptor_, &GameOptionChiRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionPengReq_descriptor_, &GameOptionPengReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionPengRsp_descriptor_, &GameOptionPengRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionGangReq_descriptor_, &GameOptionGangReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionGangRsp_descriptor_, &GameOptionGangRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionHuReq_descriptor_, &GameOptionHuReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionHuRsp_descriptor_, &GameOptionHuRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionPassReq_descriptor_, &GameOptionPassReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionPassRsp_descriptor_, &GameOptionPassRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GamePlayerReadyReq_descriptor_, &GamePlayerReadyReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( UserStatus_descriptor_, &UserStatus::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GamePlayerReadyEvt_descriptor_, &GamePlayerReadyEvt::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionGangNotFirstReq_descriptor_, &GameOptionGangNotFirstReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOptionGangNotFirstRsp_descriptor_, &GameOptionGangNotFirstRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( ApplyDeleteReq_descriptor_, &ApplyDeleteReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( ApplyDeleteEvt_descriptor_, &ApplyDeleteEvt::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( UserOption_descriptor_, &UserOption::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameInfoEvt_descriptor_, &GameInfoEvt::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( GameOverResultInfo_descriptor_, &GameOverResultInfo::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( EvtGameOver_descriptor_, &EvtGameOver::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( RecordInfo_descriptor_, &RecordInfo::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( PerPlayRecord_descriptor_, &PerPlayRecord::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( MyPlayRecordListReq_descriptor_, &MyPlayRecordListReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( MyPlayRecordListRsp_descriptor_, &MyPlayRecordListRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( RoundPlayRecordsReq_descriptor_, &RoundPlayRecordsReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( RoundPlayRecordsRsp_descriptor_, &RoundPlayRecordsRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( DeskChatReq_descriptor_, &DeskChatReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( DeskChatEvt_descriptor_, &DeskChatEvt::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( LogOutReq_descriptor_, &LogOutReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( LogOutRsp_descriptor_, &LogOutRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( EvtBroadCast_descriptor_, &EvtBroadCast::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( UserCreatePreBill_descriptor_, &UserCreatePreBill::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( CreateFormalBill_descriptor_, &CreateFormalBill::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( SetInviteUserReq_descriptor_, &SetInviteUserReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( SetInviteUserRsp_descriptor_, &SetInviteUserRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( HeartBeatReq_descriptor_, &HeartBeatReq::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( HeartBeatRsp_descriptor_, &HeartBeatRsp::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( ws_msg_descriptor_, &ws_msg::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( WsProtoTest_descriptor_, &WsProtoTest::default_instance()); } } // namespace void protobuf_ShutdownFile_mahjong_2eproto() { delete LoginReq::default_instance_; delete LoginReq_reflection_; delete WeChatLoginReq::default_instance_; delete WeChatLoginReq_reflection_; delete LoginRsp::default_instance_; delete LoginRsp_reflection_; delete ExtraDeskTypeInfo::default_instance_; delete ExtraDeskTypeInfo_reflection_; delete GameEnterDeskReq::default_instance_; delete GameEnterDeskReq_reflection_; delete GameEnterDeskRsp::default_instance_; delete GameEnterDeskRsp_reflection_; delete UserRoomCardChange::default_instance_; delete UserRoomCardChange_reflection_; delete GameUserInfo::default_instance_; delete GameUserInfo_reflection_; delete UserCommonCards::default_instance_; delete UserCommonCards_reflection_; delete MyOption::default_instance_; delete MyOption_reflection_; delete EvtDeskUserEnter::default_instance_; delete EvtDeskUserEnter_reflection_; delete GameExitDeskReq::default_instance_; delete GameExitDeskReq_reflection_; delete GameExitDeskRsp::default_instance_; delete GameExitDeskRsp_reflection_; delete DeskPlayInfo::default_instance_; delete DeskPlayInfo_reflection_; delete EvtUserExit::default_instance_; delete EvtUserExit_reflection_; delete ClientNotifyStartGameReq::default_instance_; delete ClientNotifyStartGameReq_reflection_; delete ClientNotifyStartGameRsp::default_instance_; delete ClientNotifyStartGameRsp_reflection_; delete GameSendCardReq::default_instance_; delete GameSendCardReq_reflection_; delete GameSendCardRsp::default_instance_; delete GameSendCardRsp_reflection_; delete GameOptionChiReq::default_instance_; delete GameOptionChiReq_reflection_; delete GameOptionChiRsp::default_instance_; delete GameOptionChiRsp_reflection_; delete GameOptionPengReq::default_instance_; delete GameOptionPengReq_reflection_; delete GameOptionPengRsp::default_instance_; delete GameOptionPengRsp_reflection_; delete GameOptionGangReq::default_instance_; delete GameOptionGangReq_reflection_; delete GameOptionGangRsp::default_instance_; delete GameOptionGangRsp_reflection_; delete GameOptionHuReq::default_instance_; delete GameOptionHuReq_reflection_; delete GameOptionHuRsp::default_instance_; delete GameOptionHuRsp_reflection_; delete GameOptionPassReq::default_instance_; delete GameOptionPassReq_reflection_; delete GameOptionPassRsp::default_instance_; delete GameOptionPassRsp_reflection_; delete GamePlayerReadyReq::default_instance_; delete GamePlayerReadyReq_reflection_; delete UserStatus::default_instance_; delete UserStatus_reflection_; delete GamePlayerReadyEvt::default_instance_; delete GamePlayerReadyEvt_reflection_; delete GameOptionGangNotFirstReq::default_instance_; delete GameOptionGangNotFirstReq_reflection_; delete GameOptionGangNotFirstRsp::default_instance_; delete GameOptionGangNotFirstRsp_reflection_; delete ApplyDeleteReq::default_instance_; delete ApplyDeleteReq_reflection_; delete ApplyDeleteEvt::default_instance_; delete ApplyDeleteEvt_reflection_; delete UserOption::default_instance_; delete UserOption_reflection_; delete GameInfoEvt::default_instance_; delete GameInfoEvt_reflection_; delete GameOverResultInfo::default_instance_; delete GameOverResultInfo_reflection_; delete EvtGameOver::default_instance_; delete EvtGameOver_reflection_; delete RecordInfo::default_instance_; delete RecordInfo_reflection_; delete PerPlayRecord::default_instance_; delete PerPlayRecord_reflection_; delete MyPlayRecordListReq::default_instance_; delete MyPlayRecordListReq_reflection_; delete MyPlayRecordListRsp::default_instance_; delete MyPlayRecordListRsp_reflection_; delete RoundPlayRecordsReq::default_instance_; delete RoundPlayRecordsReq_reflection_; delete RoundPlayRecordsRsp::default_instance_; delete RoundPlayRecordsRsp_reflection_; delete DeskChatReq::default_instance_; delete DeskChatReq_reflection_; delete DeskChatEvt::default_instance_; delete DeskChatEvt_reflection_; delete LogOutReq::default_instance_; delete LogOutReq_reflection_; delete LogOutRsp::default_instance_; delete LogOutRsp_reflection_; delete EvtBroadCast::default_instance_; delete EvtBroadCast_reflection_; delete UserCreatePreBill::default_instance_; delete UserCreatePreBill_reflection_; delete CreateFormalBill::default_instance_; delete CreateFormalBill_reflection_; delete SetInviteUserReq::default_instance_; delete SetInviteUserReq_reflection_; delete SetInviteUserRsp::default_instance_; delete SetInviteUserRsp_reflection_; delete HeartBeatReq::default_instance_; delete HeartBeatReq_reflection_; delete HeartBeatRsp::default_instance_; delete HeartBeatRsp_reflection_; delete ws_msg::default_instance_; delete ws_msg_reflection_; delete WsProtoTest::default_instance_; delete WsProtoTest_reflection_; } void protobuf_AddDesc_mahjong_2eproto() { static bool already_here = false; if (already_here) return; already_here = true; GOOGLE_PROTOBUF_VERIFY_VERSION; ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( "\n\rmahjong.proto\"\247\001\n\010LoginReq\022\014\n\004nick\030\001 \001" "(\t\022\014\n\004uuid\030\002 \001(\t\022\014\n\004sign\030\003 \001(\t\022\017\n\007channe" "l\030\004 \001(\t\022\017\n\007version\030\005 \001(\005\022\n\n\002os\030\006 \001(\t\022\023\n\013" "is_register\030\007 \001(\010\022\026\n\016extra_username\030\010 \001(" "\t\022\026\n\016extra_password\030\t \001(\t\"\200\001\n\016WeChatLogi" "nReq\022\014\n\004sign\030\001 \001(\t\022\016\n\006openid\030\002 \001(\t\022\r\n\005to" "ken\030\003 \001(\t\022\023\n\013expire_date\030\004 \001(\t\022\017\n\007channe" "l\030\005 \001(\t\022\017\n\007version\030\006 \001(\005\022\n\n\002os\030\007 \001(\t\"\361\001\n" "\010LoginRsp\022\013\n\003uin\030\001 \001(\005\022\020\n\010password\030\002 \001(\t" "\022\014\n\004nick\030\003 \001(\t\022\013\n\003sex\030\004 \001(\005\022\022\n\nold_deski" "d\030\005 \001(\005\022\020\n\010portrait\030\007 \001(\t\022\024\n\014wx_public_i" "d\030\010 \001(\t\022\023\n\013wx_agent_id\030\t \001(\t\022\n\n\002ip\030\n \001(\t" "\022\021\n\troom_card\030\013 \001(\005\022\013\n\003ret\030\014 \001(\005\022\027\n\017wy_y" "unxin_token\030\r \001(\t\022\025\n\rhall_billband\030\016 \001(\t" "\"j\n\021ExtraDeskTypeInfo\022\021\n\thongzhong\030\001 \001(\010" "\022\r\n\005qidui\030\002 \001(\010\022\020\n\010zhuaniao\030\003 \001(\005\022\017\n\007pia" "ofen\030\004 \001(\005\022\020\n\010shanghuo\030\005 \001(\010\"\277\001\n\020GameEnt" "erDeskReq\022\023\n\013dst_desk_id\030\001 \001(\005\022\020\n\010new_de" "sk\030\002 \001(\005\022\021\n\treconnect\030\003 \001(\005\022\020\n\010card_num\030" "\004 \001(\005\022\021\n\tdesk_type\030\005 \001(\005\022\022\n\nseat_limit\030\006" " \001(\005\022\020\n\010win_type\030\007 \001(\005\022&\n\nextra_type\030\010 \001" "(\0132\022.ExtraDeskTypeInfo\"\037\n\020GameEnterDeskR" "sp\022\013\n\003ret\030\001 \001(\005\">\n\022UserRoomCardChange\022\021\n" "\troom_card\030\001 \001(\005\022\025\n\rchange_reason\030\002 \001(\005\"" "\252\001\n\014GameUserInfo\022\016\n\006status\030\001 \001(\005\022\013\n\003uin\030" "\002 \001(\005\022\014\n\004nick\030\003 \001(\t\022\016\n\006seatid\030\004 \001(\005\022\013\n\003s" "ex\030\005 \001(\005\022\020\n\010portrait\030\006 \001(\t\022\021\n\tis_master\030" "\007 \001(\005\022\017\n\007piaofen\030\010 \001(\005\022\020\n\010shanghuo\030\t \001(\005" "\022\n\n\002ip\030\n \001(\t\"\224\001\n\017UserCommonCards\022\013\n\003uin\030" "\001 \001(\005\022\020\n\010card_len\030\002 \001(\005\022\021\n\tout_cards\030\003 \003" "(\005\022\017\n\007discard\030\004 \003(\005\022\016\n\006seatid\030\005 \001(\005\022\016\n\006s" "tatus\030\006 \001(\005\022\017\n\007op_list\030\007 \003(\005\022\r\n\005chips\030\010 " "\001(\005\"q\n\010MyOption\022\016\n\006op_chi\030\001 \001(\010\022\017\n\007op_pe" "ng\030\002 \001(\010\022\017\n\007op_gang\030\003 \001(\010\022\r\n\005op_hu\030\004 \001(\010" "\022\021\n\tneed_wait\030\005 \001(\010\022\021\n\tchi_cards\030\006 \003(\005\"\353" "\003\n\020EvtDeskUserEnter\022\016\n\006deskid\030\001 \001(\005\022\016\n\006o" "p_uin\030\002 \001(\005\022\016\n\006status\030\003 \001(\005\022\021\n\tmax_round" "\030\004 \001(\005\022\034\n\005users\030\005 \003(\0132\r.GameUserInfo\022\020\n\010" "next_uin\030\006 \001(\005\022\025\n\rdealer_seatid\030\007 \001(\005\022\021\n" "\005cards\030\010 \003(\005B\002\020\001\022\"\n\010in_users\030\t \003(\0132\020.Use" "rCommonCards\022\027\n\017share_cards_len\030\n \001(\005\022\022\n" "\ngame_round\030\013 \001(\005\022\034\n\tmy_option\030\014 \001(\0132\t.M" "yOption\022\025\n\rrecv_card_uin\030\r \001(\005\022\031\n\021desk_r" "emain_round\030\016 \001(\005\022\020\n\010seat_num\030\017 \001(\005\022\023\n\013r" "emain_time\030\020 \001(\005\022\021\n\tapply_uin\030\021 \001(\005\022\020\n\010w" "in_type\030\022 \001(\005\022&\n\nextra_type\030\023 \001(\0132\022.Extr" "aDeskTypeInfo\022\014\n\004type\030\024 \001(\005\022\027\n\017pre_remai" "n_time\030\025 \001(\005\"\021\n\017GameExitDeskReq\"\036\n\017GameE" "xitDeskRsp\022\013\n\003ret\030\001 \001(\005\"\254\003\n\014DeskPlayInfo" "\022\021\n\005cards\030\001 \003(\005B\002\020\001\022\020\n\010card_len\030\002 \001(\005\022\025\n" "\tout_cards\030\003 \003(\005B\002\020\001\022\024\n\014out_card_len\030\004 \001" "(\005\022\024\n\010discards\030\005 \003(\005B\002\020\001\022\016\n\006status\030\006 \001(\005" "\022\r\n\005chips\030\007 \001(\005\022\027\n\017round_win_chips\030\010 \001(\005" "\022\025\n\rtotal_chi_num\030\t \001(\005\022\026\n\016total_peng_nu" "m\030\n \001(\005\022\026\n\016total_gang_num\030\013 \001(\005\022\030\n\020total" "_ganged_num\030\014 \001(\005\022\024\n\014total_hu_num\030\r \001(\005\022" "\026\n\016total_hued_num\030\016 \001(\005\022\025\n\rround_chi_num" "\030\017 \001(\005\022\026\n\016round_peng_num\030\020 \001(\005\022\026\n\016round_" "gang_num\030\021 \001(\005\022\030\n\020round_ganged_num\030\022 \001(\005" "\022\014\n\004role\030\023 \001(\005\"\310\001\n\013EvtUserExit\022\016\n\006deskid" "\030\001 \001(\005\022\016\n\006dealer\030\002 \001(\005\022\016\n\006op_uin\030\003 \001(\005\022\021" "\n\top_status\030\004 \001(\005\022\020\n\010next_uin\030\005 \001(\005\022 \n\tp" "lay_info\030\006 \001(\0132\r.DeskPlayInfo\022\033\n\023player_" "op_past_time\030\007 \001(\003\022\025\n\rdealer_seatid\030\010 \001(" "\005\022\016\n\006reason\030\t \001(\005\"\032\n\030ClientNotifyStartGa" "meReq\"\'\n\030ClientNotifyStartGameRsp\022\013\n\003ret" "\030\001 \001(\005\"\037\n\017GameSendCardReq\022\014\n\004card\030\001 \001(\005\"" "\036\n\017GameSendCardRsp\022\013\n\003ret\030\001 \001(\005\"!\n\020GameO" "ptionChiReq\022\r\n\005index\030\001 \001(\005\"\037\n\020GameOption" "ChiRsp\022\013\n\003ret\030\001 \001(\005\"\023\n\021GameOptionPengReq" "\" \n\021GameOptionPengRsp\022\013\n\003ret\030\001 \001(\005\"\023\n\021Ga" "meOptionGangReq\" \n\021GameOptionGangRsp\022\013\n\003" "ret\030\001 \001(\005\"\021\n\017GameOptionHuReq\"\036\n\017GameOpti" "onHuRsp\022\013\n\003ret\030\001 \001(\005\"\023\n\021GameOptionPassRe" "q\" \n\021GameOptionPassRsp\022\013\n\003ret\030\001 \001(\005\"5\n\022G" "amePlayerReadyReq\022\016\n\006status\030\001 \001(\005\022\017\n\007pia" "ofen\030\002 \001(\005\"L\n\nUserStatus\022\013\n\003uin\030\001 \001(\005\022\016\n" "\006status\030\002 \001(\005\022\017\n\007piaofen\030\003 \001(\005\022\020\n\010shangh" "uo\030\004 \001(\005\"Y\n\022GamePlayerReadyEvt\022\032\n\005users\030" "\001 \003(\0132\013.UserStatus\022\027\n\017pre_remain_time\030\002 " "\001(\005\022\016\n\006deskid\030\003 \001(\005\".\n\031GameOptionGangNot" "FirstReq\022\021\n\tgang_card\030\001 \001(\005\"(\n\031GameOptio" "nGangNotFirstRsp\022\013\n\003ret\030\001 \001(\005\"\020\n\016ApplyDe" "leteReq\"m\n\016ApplyDeleteEvt\022\021\n\tapply_uin\030\001" " \001(\005\022\023\n\013game_status\030\002 \001(\005\022\023\n\013remain_time" "\030\003 \001(\005\022\016\n\006status\030\004 \001(\005\022\016\n\006deskid\030\005 \001(\005\"\'" "\n\nUserOption\022\013\n\003uin\030\001 \001(\005\022\014\n\004type\030\002 \001(\005\"" "\312\002\n\013GameInfoEvt\022\016\n\006deskid\030\001 \001(\005\022\020\n\010next_" "uin\030\002 \001(\005\022\021\n\tmax_round\030\003 \001(\005\022\021\n\005cards\030\004 " "\003(\005B\002\020\001\022\025\n\rdealer_seatid\030\005 \001(\005\022\037\n\005users\030" "\006 \003(\0132\020.UserCommonCards\022\034\n\007op_user\030\007 \001(\013" "2\013.UserOption\022\027\n\017share_cards_len\030\010 \001(\005\022\022" "\n\ngame_round\030\t \001(\005\022\034\n\tmy_option\030\n \001(\0132\t." "MyOption\022\016\n\006status\030\013 \001(\005\022\025\n\rrecv_card_ui" "n\030\014 \001(\005\022\031\n\021desk_remain_round\030\r \001(\005\022\020\n\010se" "at_num\030\016 \001(\005\"\353\003\n\022GameOverResultInfo\022\013\n\003u" "in\030\001 \001(\005\022\r\n\005chips\030\002 \001(\003\022\025\n\rround_chi_num" "\030\003 \001(\005\022\026\n\016round_peng_num\030\004 \001(\005\022\027\n\017round_" "gang_list\030\005 \003(\005\022\025\n\rround_hu_list\030\006 \003(\005\022\026" "\n\016round_win_list\030\007 \003(\005\022\025\n\rtotal_chi_num\030" "\010 \001(\005\022\026\n\016total_peng_num\030\t \001(\005\022\027\n\017total_g" "ang_list\030\n \003(\005\022\025\n\rtotal_hu_list\030\013 \003(\005\022\026\n" "\016total_win_list\030\014 \003(\005\022\016\n\006status\030\r \001(\005\022\017\n" "\007piaofen\030\016 \001(\005\022\020\n\010shanghuo\030\017 \001(\005\022\020\n\010bird" "_num\030\020 \001(\005\022\r\n\005cards\030\021 \003(\005\022\021\n\tout_cards\030\022" " \003(\005\022\017\n\007op_list\030\023 \003(\005\022\027\n\017round_win_chips" "\030\024 \001(\005\022\032\n\022over_chips_details\030\025 \003(\005\022\036\n\026ro" "und_win_chips_before\030\026 \001(\005\"\260\002\n\013EvtGameOv" "er\022\023\n\007winners\030\001 \003(\005B\002\020\001\022#\n\006result\030\002 \003(\0132" "\023.GameOverResultInfo\022\016\n\006deskid\030\003 \001(\005\022\016\n\006" "status\030\004 \001(\005\022\030\n\020remain_round_num\030\005 \001(\005\022\025" "\n\tbird_card\030\006 \003(\005B\002\020\001\022\014\n\004type\030\007 \001(\005\022\022\n\ns" "eat_limit\030\010 \001(\005\022\020\n\010win_type\030\t \001(\005\022&\n\next" "ra_type\030\n \001(\0132\022.ExtraDeskTypeInfo\022\022\n\nlas" "t_round\030\013 \001(\010\022\021\n\tover_time\030\014 \001(\005\022\023\n\013over" "_reason\030\r \001(\005\"\236\004\n\nRecordInfo\022\013\n\003uin\030\001 \001(" "\005\022\014\n\004role\030\002 \001(\005\022\r\n\005chips\030\003 \001(\003\022\027\n\017round_" "win_chips\030\004 \001(\005\022\025\n\rround_chi_num\030\005 \001(\005\022\026" "\n\016round_peng_num\030\006 \001(\005\022\027\n\017round_gang_lis" "t\030\007 \003(\005\022\025\n\rround_hu_list\030\010 \003(\005\022\026\n\016round_" "win_list\030\t \003(\005\022\025\n\rtotal_chi_num\030\n \001(\005\022\026\n" "\016total_peng_num\030\013 \001(\005\022\027\n\017total_gang_list" "\030\014 \003(\005\022\025\n\rtotal_hu_list\030\r \003(\005\022\026\n\016total_w" "in_list\030\016 \003(\005\022\017\n\007piaofen\030\017 \001(\005\022\020\n\010shangh" "uo\030\020 \001(\005\022\020\n\010bird_num\030\021 \001(\005\022\r\n\005cards\030\022 \003(" "\005\022\021\n\tout_cards\030\023 \003(\005\022\017\n\007op_list\030\024 \003(\005\022\032\n" "\022over_chips_details\030\025 \003(\005\022\036\n\026round_win_c" "hips_before\030\026 \001(\005\022\014\n\004nick\030\027 \001(\t\022\016\n\006seati" "d\030\030 \001(\005\022\013\n\003sex\030\031 \001(\005\022\020\n\010portrait\030\032 \001(\t\"\244" "\002\n\rPerPlayRecord\022\017\n\007roundid\030\001 \001(\t\022\033\n\006res" "ult\030\002 \003(\0132\013.RecordInfo\022\016\n\006deskid\030\003 \001(\005\022\022" "\n\ngame_round\030\004 \001(\005\022\022\n\ndesk_round\030\006 \001(\005\022\025" "\n\tbird_card\030\007 \003(\005B\002\020\001\022\014\n\004type\030\010 \001(\005\022\022\n\ns" "eat_limit\030\t \001(\005\022\020\n\010win_type\030\n \001(\005\022&\n\next" "ra_type\030\013 \001(\0132\022.ExtraDeskTypeInfo\022\021\n\tove" "r_time\030\014 \001(\005\022\022\n\nmaster_uin\030\r \001(\005\022\023\n\007winn" "ers\030\016 \003(\005B\002\020\001\"\025\n\023MyPlayRecordListReq\"G\n\023" "MyPlayRecordListRsp\022#\n\013record_list\030\001 \003(\013" "2\016.PerPlayRecord\022\013\n\003ret\030\002 \001(\005\"A\n\023RoundPl" "ayRecordsReq\022\020\n\010round_id\030\001 \001(\t\022\030\n\020game_r" "ound_index\030\002 \001(\005\"G\n\023RoundPlayRecordsRsp\022" "#\n\013record_list\030\001 \003(\0132\016.PerPlayRecord\022\013\n\003" "ret\030\002 \001(\005\";\n\013DeskChatReq\022\017\n\007content\030\001 \001(" "\t\022\014\n\004type\030\002 \001(\005\022\r\n\005index\030\003 \001(\005\"W\n\013DeskCh" "atEvt\022\013\n\003ret\030\001 \001(\005\022\016\n\006op_uin\030\002 \001(\005\022\013\n\003se" "x\030\003 \001(\010\022\r\n\005index\030\004 \001(\005\022\017\n\007content\030\005 \001(\t\"" "\013\n\tLogOutReq\"\013\n\tLogOutRsp\":\n\014EvtBroadCas" "t\022\013\n\003uin\030\001 \001(\005\022\017\n\007content\030\002 \001(\t\022\014\n\004nick\030" "\003 \001(\t\"\?\n\021UserCreatePreBill\022\013\n\003uin\030\001 \001(\005\022" "\014\n\004name\030\002 \001(\t\022\017\n\007item_id\030\003 \001(\t\"0\n\020Create" "FormalBill\022\013\n\003uin\030\001 \001(\005\022\017\n\007item_id\030\002 \001(\t" "\"\037\n\020SetInviteUserReq\022\013\n\003uin\030\001 \001(\005\"\037\n\020Set" "InviteUserRsp\022\013\n\003ret\030\001 \001(\005\"\016\n\014HeartBeatR" "eq\"\016\n\014HeartBeatRsp\"\033\n\006ws_msg\022\021\n\tms_op_in" "t\030\001 \001(\005\"s\n\013WsProtoTest\022\016\n\006op_int\030\001 \001(\005\022\022" "\n\006re_int\030\002 \003(\005B\002\020\001\022\016\n\006op_str\030\003 \001(\t\022\027\n\006op" "_msg\030\004 \001(\0132\007.ws_msg\022\027\n\006re_msg\030\005 \003(\0132\007.ws" "_msg", 6284); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "mahjong.proto", &protobuf_RegisterTypes); LoginReq::default_instance_ = new LoginReq(); WeChatLoginReq::default_instance_ = new WeChatLoginReq(); LoginRsp::default_instance_ = new LoginRsp(); ExtraDeskTypeInfo::default_instance_ = new ExtraDeskTypeInfo(); GameEnterDeskReq::default_instance_ = new GameEnterDeskReq(); GameEnterDeskRsp::default_instance_ = new GameEnterDeskRsp(); UserRoomCardChange::default_instance_ = new UserRoomCardChange(); GameUserInfo::default_instance_ = new GameUserInfo(); UserCommonCards::default_instance_ = new UserCommonCards(); MyOption::default_instance_ = new MyOption(); EvtDeskUserEnter::default_instance_ = new EvtDeskUserEnter(); GameExitDeskReq::default_instance_ = new GameExitDeskReq(); GameExitDeskRsp::default_instance_ = new GameExitDeskRsp(); DeskPlayInfo::default_instance_ = new DeskPlayInfo(); EvtUserExit::default_instance_ = new EvtUserExit(); ClientNotifyStartGameReq::default_instance_ = new ClientNotifyStartGameReq(); ClientNotifyStartGameRsp::default_instance_ = new ClientNotifyStartGameRsp(); GameSendCardReq::default_instance_ = new GameSendCardReq(); GameSendCardRsp::default_instance_ = new GameSendCardRsp(); GameOptionChiReq::default_instance_ = new GameOptionChiReq(); GameOptionChiRsp::default_instance_ = new GameOptionChiRsp(); GameOptionPengReq::default_instance_ = new GameOptionPengReq(); GameOptionPengRsp::default_instance_ = new GameOptionPengRsp(); GameOptionGangReq::default_instance_ = new GameOptionGangReq(); GameOptionGangRsp::default_instance_ = new GameOptionGangRsp(); GameOptionHuReq::default_instance_ = new GameOptionHuReq(); GameOptionHuRsp::default_instance_ = new GameOptionHuRsp(); GameOptionPassReq::default_instance_ = new GameOptionPassReq(); GameOptionPassRsp::default_instance_ = new GameOptionPassRsp(); GamePlayerReadyReq::default_instance_ = new GamePlayerReadyReq(); UserStatus::default_instance_ = new UserStatus(); GamePlayerReadyEvt::default_instance_ = new GamePlayerReadyEvt(); GameOptionGangNotFirstReq::default_instance_ = new GameOptionGangNotFirstReq(); GameOptionGangNotFirstRsp::default_instance_ = new GameOptionGangNotFirstRsp(); ApplyDeleteReq::default_instance_ = new ApplyDeleteReq(); ApplyDeleteEvt::default_instance_ = new ApplyDeleteEvt(); UserOption::default_instance_ = new UserOption(); GameInfoEvt::default_instance_ = new GameInfoEvt(); GameOverResultInfo::default_instance_ = new GameOverResultInfo(); EvtGameOver::default_instance_ = new EvtGameOver(); RecordInfo::default_instance_ = new RecordInfo(); PerPlayRecord::default_instance_ = new PerPlayRecord(); MyPlayRecordListReq::default_instance_ = new MyPlayRecordListReq(); MyPlayRecordListRsp::default_instance_ = new MyPlayRecordListRsp(); RoundPlayRecordsReq::default_instance_ = new RoundPlayRecordsReq(); RoundPlayRecordsRsp::default_instance_ = new RoundPlayRecordsRsp(); DeskChatReq::default_instance_ = new DeskChatReq(); DeskChatEvt::default_instance_ = new DeskChatEvt(); LogOutReq::default_instance_ = new LogOutReq(); LogOutRsp::default_instance_ = new LogOutRsp(); EvtBroadCast::default_instance_ = new EvtBroadCast(); UserCreatePreBill::default_instance_ = new UserCreatePreBill(); CreateFormalBill::default_instance_ = new CreateFormalBill(); SetInviteUserReq::default_instance_ = new SetInviteUserReq(); SetInviteUserRsp::default_instance_ = new SetInviteUserRsp(); HeartBeatReq::default_instance_ = new HeartBeatReq(); HeartBeatRsp::default_instance_ = new HeartBeatRsp(); ws_msg::default_instance_ = new ws_msg(); WsProtoTest::default_instance_ = new WsProtoTest(); LoginReq::default_instance_->InitAsDefaultInstance(); WeChatLoginReq::default_instance_->InitAsDefaultInstance(); LoginRsp::default_instance_->InitAsDefaultInstance(); ExtraDeskTypeInfo::default_instance_->InitAsDefaultInstance(); GameEnterDeskReq::default_instance_->InitAsDefaultInstance(); GameEnterDeskRsp::default_instance_->InitAsDefaultInstance(); UserRoomCardChange::default_instance_->InitAsDefaultInstance(); GameUserInfo::default_instance_->InitAsDefaultInstance(); UserCommonCards::default_instance_->InitAsDefaultInstance(); MyOption::default_instance_->InitAsDefaultInstance(); EvtDeskUserEnter::default_instance_->InitAsDefaultInstance(); GameExitDeskReq::default_instance_->InitAsDefaultInstance(); GameExitDeskRsp::default_instance_->InitAsDefaultInstance(); DeskPlayInfo::default_instance_->InitAsDefaultInstance(); EvtUserExit::default_instance_->InitAsDefaultInstance(); ClientNotifyStartGameReq::default_instance_->InitAsDefaultInstance(); ClientNotifyStartGameRsp::default_instance_->InitAsDefaultInstance(); GameSendCardReq::default_instance_->InitAsDefaultInstance(); GameSendCardRsp::default_instance_->InitAsDefaultInstance(); GameOptionChiReq::default_instance_->InitAsDefaultInstance(); GameOptionChiRsp::default_instance_->InitAsDefaultInstance(); GameOptionPengReq::default_instance_->InitAsDefaultInstance(); GameOptionPengRsp::default_instance_->InitAsDefaultInstance(); GameOptionGangReq::default_instance_->InitAsDefaultInstance(); GameOptionGangRsp::default_instance_->InitAsDefaultInstance(); GameOptionHuReq::default_instance_->InitAsDefaultInstance(); GameOptionHuRsp::default_instance_->InitAsDefaultInstance(); GameOptionPassReq::default_instance_->InitAsDefaultInstance(); GameOptionPassRsp::default_instance_->InitAsDefaultInstance(); GamePlayerReadyReq::default_instance_->InitAsDefaultInstance(); UserStatus::default_instance_->InitAsDefaultInstance(); GamePlayerReadyEvt::default_instance_->InitAsDefaultInstance(); GameOptionGangNotFirstReq::default_instance_->InitAsDefaultInstance(); GameOptionGangNotFirstRsp::default_instance_->InitAsDefaultInstance(); ApplyDeleteReq::default_instance_->InitAsDefaultInstance(); ApplyDeleteEvt::default_instance_->InitAsDefaultInstance(); UserOption::default_instance_->InitAsDefaultInstance(); GameInfoEvt::default_instance_->InitAsDefaultInstance(); GameOverResultInfo::default_instance_->InitAsDefaultInstance(); EvtGameOver::default_instance_->InitAsDefaultInstance(); RecordInfo::default_instance_->InitAsDefaultInstance(); PerPlayRecord::default_instance_->InitAsDefaultInstance(); MyPlayRecordListReq::default_instance_->InitAsDefaultInstance(); MyPlayRecordListRsp::default_instance_->InitAsDefaultInstance(); RoundPlayRecordsReq::default_instance_->InitAsDefaultInstance(); RoundPlayRecordsRsp::default_instance_->InitAsDefaultInstance(); DeskChatReq::default_instance_->InitAsDefaultInstance(); DeskChatEvt::default_instance_->InitAsDefaultInstance(); LogOutReq::default_instance_->InitAsDefaultInstance(); LogOutRsp::default_instance_->InitAsDefaultInstance(); EvtBroadCast::default_instance_->InitAsDefaultInstance(); UserCreatePreBill::default_instance_->InitAsDefaultInstance(); CreateFormalBill::default_instance_->InitAsDefaultInstance(); SetInviteUserReq::default_instance_->InitAsDefaultInstance(); SetInviteUserRsp::default_instance_->InitAsDefaultInstance(); HeartBeatReq::default_instance_->InitAsDefaultInstance(); HeartBeatRsp::default_instance_->InitAsDefaultInstance(); ws_msg::default_instance_->InitAsDefaultInstance(); WsProtoTest::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_mahjong_2eproto); } // Force AddDescriptors() to be called at static initialization time. struct StaticDescriptorInitializer_mahjong_2eproto { StaticDescriptorInitializer_mahjong_2eproto() { protobuf_AddDesc_mahjong_2eproto(); } } static_descriptor_initializer_mahjong_2eproto_; // =================================================================== #ifndef _MSC_VER const int LoginReq::kNickFieldNumber; const int LoginReq::kUuidFieldNumber; const int LoginReq::kSignFieldNumber; const int LoginReq::kChannelFieldNumber; const int LoginReq::kVersionFieldNumber; const int LoginReq::kOsFieldNumber; const int LoginReq::kIsRegisterFieldNumber; const int LoginReq::kExtraUsernameFieldNumber; const int LoginReq::kExtraPasswordFieldNumber; #endif // !_MSC_VER LoginReq::LoginReq() : ::google::protobuf::Message() { SharedCtor(); } void LoginReq::InitAsDefaultInstance() { } LoginReq::LoginReq(const LoginReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void LoginReq::SharedCtor() { _cached_size_ = 0; nick_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); uuid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); sign_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); channel_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); version_ = 0; os_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); is_register_ = false; extra_username_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); extra_password_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } LoginReq::~LoginReq() { SharedDtor(); } void LoginReq::SharedDtor() { if (nick_ != &::google::protobuf::internal::kEmptyString) { delete nick_; } if (uuid_ != &::google::protobuf::internal::kEmptyString) { delete uuid_; } if (sign_ != &::google::protobuf::internal::kEmptyString) { delete sign_; } if (channel_ != &::google::protobuf::internal::kEmptyString) { delete channel_; } if (os_ != &::google::protobuf::internal::kEmptyString) { delete os_; } if (extra_username_ != &::google::protobuf::internal::kEmptyString) { delete extra_username_; } if (extra_password_ != &::google::protobuf::internal::kEmptyString) { delete extra_password_; } if (this != default_instance_) { } } void LoginReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* LoginReq::descriptor() { protobuf_AssignDescriptorsOnce(); return LoginReq_descriptor_; } const LoginReq& LoginReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } LoginReq* LoginReq::default_instance_ = NULL; LoginReq* LoginReq::New() const { return new LoginReq; } void LoginReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_nick()) { if (nick_ != &::google::protobuf::internal::kEmptyString) { nick_->clear(); } } if (has_uuid()) { if (uuid_ != &::google::protobuf::internal::kEmptyString) { uuid_->clear(); } } if (has_sign()) { if (sign_ != &::google::protobuf::internal::kEmptyString) { sign_->clear(); } } if (has_channel()) { if (channel_ != &::google::protobuf::internal::kEmptyString) { channel_->clear(); } } version_ = 0; if (has_os()) { if (os_ != &::google::protobuf::internal::kEmptyString) { os_->clear(); } } is_register_ = false; if (has_extra_username()) { if (extra_username_ != &::google::protobuf::internal::kEmptyString) { extra_username_->clear(); } } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (has_extra_password()) { if (extra_password_ != &::google::protobuf::internal::kEmptyString) { extra_password_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool LoginReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string nick = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_nick())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_uuid; break; } // optional string uuid = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_uuid: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_uuid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->uuid().data(), this->uuid().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(26)) goto parse_sign; break; } // optional string sign = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_sign: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_sign())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->sign().data(), this->sign().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(34)) goto parse_channel; break; } // optional string channel = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_channel: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_channel())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->channel().data(), this->channel().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_version; break; } // optional int32 version = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &version_))); set_has_version(); } else { goto handle_uninterpreted; } if (input->ExpectTag(50)) goto parse_os; break; } // optional string os = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_os: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_os())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->os().data(), this->os().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_is_register; break; } // optional bool is_register = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_is_register: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &is_register_))); set_has_is_register(); } else { goto handle_uninterpreted; } if (input->ExpectTag(66)) goto parse_extra_username; break; } // optional string extra_username = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_extra_username: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_extra_username())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->extra_username().data(), this->extra_username().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(74)) goto parse_extra_password; break; } // optional string extra_password = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_extra_password: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_extra_password())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->extra_password().data(), this->extra_password().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void LoginReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional string nick = 1; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 1, this->nick(), output); } // optional string uuid = 2; if (has_uuid()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->uuid().data(), this->uuid().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 2, this->uuid(), output); } // optional string sign = 3; if (has_sign()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->sign().data(), this->sign().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->sign(), output); } // optional string channel = 4; if (has_channel()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->channel().data(), this->channel().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 4, this->channel(), output); } // optional int32 version = 5; if (has_version()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->version(), output); } // optional string os = 6; if (has_os()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->os().data(), this->os().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 6, this->os(), output); } // optional bool is_register = 7; if (has_is_register()) { ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->is_register(), output); } // optional string extra_username = 8; if (has_extra_username()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->extra_username().data(), this->extra_username().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 8, this->extra_username(), output); } // optional string extra_password = 9; if (has_extra_password()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->extra_password().data(), this->extra_password().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 9, this->extra_password(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* LoginReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional string nick = 1; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->nick(), target); } // optional string uuid = 2; if (has_uuid()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->uuid().data(), this->uuid().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->uuid(), target); } // optional string sign = 3; if (has_sign()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->sign().data(), this->sign().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->sign(), target); } // optional string channel = 4; if (has_channel()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->channel().data(), this->channel().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 4, this->channel(), target); } // optional int32 version = 5; if (has_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->version(), target); } // optional string os = 6; if (has_os()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->os().data(), this->os().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 6, this->os(), target); } // optional bool is_register = 7; if (has_is_register()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->is_register(), target); } // optional string extra_username = 8; if (has_extra_username()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->extra_username().data(), this->extra_username().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 8, this->extra_username(), target); } // optional string extra_password = 9; if (has_extra_password()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->extra_password().data(), this->extra_password().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 9, this->extra_password(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int LoginReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string nick = 1; if (has_nick()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->nick()); } // optional string uuid = 2; if (has_uuid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->uuid()); } // optional string sign = 3; if (has_sign()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->sign()); } // optional string channel = 4; if (has_channel()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->channel()); } // optional int32 version = 5; if (has_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->version()); } // optional string os = 6; if (has_os()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->os()); } // optional bool is_register = 7; if (has_is_register()) { total_size += 1 + 1; } // optional string extra_username = 8; if (has_extra_username()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->extra_username()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional string extra_password = 9; if (has_extra_password()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->extra_password()); } } 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 LoginReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const LoginReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const LoginReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void LoginReq::MergeFrom(const LoginReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_nick()) { set_nick(from.nick()); } if (from.has_uuid()) { set_uuid(from.uuid()); } if (from.has_sign()) { set_sign(from.sign()); } if (from.has_channel()) { set_channel(from.channel()); } if (from.has_version()) { set_version(from.version()); } if (from.has_os()) { set_os(from.os()); } if (from.has_is_register()) { set_is_register(from.is_register()); } if (from.has_extra_username()) { set_extra_username(from.extra_username()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_extra_password()) { set_extra_password(from.extra_password()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void LoginReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void LoginReq::CopyFrom(const LoginReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool LoginReq::IsInitialized() const { return true; } void LoginReq::Swap(LoginReq* other) { if (other != this) { std::swap(nick_, other->nick_); std::swap(uuid_, other->uuid_); std::swap(sign_, other->sign_); std::swap(channel_, other->channel_); std::swap(version_, other->version_); std::swap(os_, other->os_); std::swap(is_register_, other->is_register_); std::swap(extra_username_, other->extra_username_); std::swap(extra_password_, other->extra_password_); 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 LoginReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = LoginReq_descriptor_; metadata.reflection = LoginReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int WeChatLoginReq::kSignFieldNumber; const int WeChatLoginReq::kOpenidFieldNumber; const int WeChatLoginReq::kTokenFieldNumber; const int WeChatLoginReq::kExpireDateFieldNumber; const int WeChatLoginReq::kChannelFieldNumber; const int WeChatLoginReq::kVersionFieldNumber; const int WeChatLoginReq::kOsFieldNumber; #endif // !_MSC_VER WeChatLoginReq::WeChatLoginReq() : ::google::protobuf::Message() { SharedCtor(); } void WeChatLoginReq::InitAsDefaultInstance() { } WeChatLoginReq::WeChatLoginReq(const WeChatLoginReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void WeChatLoginReq::SharedCtor() { _cached_size_ = 0; sign_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); openid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); token_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); expire_date_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); channel_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); version_ = 0; os_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } WeChatLoginReq::~WeChatLoginReq() { SharedDtor(); } void WeChatLoginReq::SharedDtor() { if (sign_ != &::google::protobuf::internal::kEmptyString) { delete sign_; } if (openid_ != &::google::protobuf::internal::kEmptyString) { delete openid_; } if (token_ != &::google::protobuf::internal::kEmptyString) { delete token_; } if (expire_date_ != &::google::protobuf::internal::kEmptyString) { delete expire_date_; } if (channel_ != &::google::protobuf::internal::kEmptyString) { delete channel_; } if (os_ != &::google::protobuf::internal::kEmptyString) { delete os_; } if (this != default_instance_) { } } void WeChatLoginReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* WeChatLoginReq::descriptor() { protobuf_AssignDescriptorsOnce(); return WeChatLoginReq_descriptor_; } const WeChatLoginReq& WeChatLoginReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } WeChatLoginReq* WeChatLoginReq::default_instance_ = NULL; WeChatLoginReq* WeChatLoginReq::New() const { return new WeChatLoginReq; } void WeChatLoginReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_sign()) { if (sign_ != &::google::protobuf::internal::kEmptyString) { sign_->clear(); } } if (has_openid()) { if (openid_ != &::google::protobuf::internal::kEmptyString) { openid_->clear(); } } if (has_token()) { if (token_ != &::google::protobuf::internal::kEmptyString) { token_->clear(); } } if (has_expire_date()) { if (expire_date_ != &::google::protobuf::internal::kEmptyString) { expire_date_->clear(); } } if (has_channel()) { if (channel_ != &::google::protobuf::internal::kEmptyString) { channel_->clear(); } } version_ = 0; if (has_os()) { if (os_ != &::google::protobuf::internal::kEmptyString) { os_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool WeChatLoginReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string sign = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_sign())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->sign().data(), this->sign().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_openid; break; } // optional string openid = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_openid: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_openid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->openid().data(), this->openid().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(26)) goto parse_token; break; } // optional string token = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_token: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_token())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->token().data(), this->token().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(34)) goto parse_expire_date; break; } // optional string expire_date = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_expire_date: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_expire_date())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->expire_date().data(), this->expire_date().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(42)) goto parse_channel; break; } // optional string channel = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_channel: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_channel())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->channel().data(), this->channel().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_version; break; } // optional int32 version = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_version: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &version_))); set_has_version(); } else { goto handle_uninterpreted; } if (input->ExpectTag(58)) goto parse_os; break; } // optional string os = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_os: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_os())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->os().data(), this->os().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void WeChatLoginReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional string sign = 1; if (has_sign()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->sign().data(), this->sign().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 1, this->sign(), output); } // optional string openid = 2; if (has_openid()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->openid().data(), this->openid().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 2, this->openid(), output); } // optional string token = 3; if (has_token()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->token().data(), this->token().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->token(), output); } // optional string expire_date = 4; if (has_expire_date()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->expire_date().data(), this->expire_date().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 4, this->expire_date(), output); } // optional string channel = 5; if (has_channel()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->channel().data(), this->channel().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 5, this->channel(), output); } // optional int32 version = 6; if (has_version()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->version(), output); } // optional string os = 7; if (has_os()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->os().data(), this->os().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 7, this->os(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* WeChatLoginReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional string sign = 1; if (has_sign()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->sign().data(), this->sign().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->sign(), target); } // optional string openid = 2; if (has_openid()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->openid().data(), this->openid().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->openid(), target); } // optional string token = 3; if (has_token()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->token().data(), this->token().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->token(), target); } // optional string expire_date = 4; if (has_expire_date()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->expire_date().data(), this->expire_date().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 4, this->expire_date(), target); } // optional string channel = 5; if (has_channel()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->channel().data(), this->channel().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 5, this->channel(), target); } // optional int32 version = 6; if (has_version()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->version(), target); } // optional string os = 7; if (has_os()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->os().data(), this->os().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 7, this->os(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int WeChatLoginReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string sign = 1; if (has_sign()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->sign()); } // optional string openid = 2; if (has_openid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->openid()); } // optional string token = 3; if (has_token()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->token()); } // optional string expire_date = 4; if (has_expire_date()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->expire_date()); } // optional string channel = 5; if (has_channel()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->channel()); } // optional int32 version = 6; if (has_version()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->version()); } // optional string os = 7; if (has_os()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->os()); } } 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 WeChatLoginReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const WeChatLoginReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const WeChatLoginReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void WeChatLoginReq::MergeFrom(const WeChatLoginReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_sign()) { set_sign(from.sign()); } if (from.has_openid()) { set_openid(from.openid()); } if (from.has_token()) { set_token(from.token()); } if (from.has_expire_date()) { set_expire_date(from.expire_date()); } if (from.has_channel()) { set_channel(from.channel()); } if (from.has_version()) { set_version(from.version()); } if (from.has_os()) { set_os(from.os()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void WeChatLoginReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void WeChatLoginReq::CopyFrom(const WeChatLoginReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool WeChatLoginReq::IsInitialized() const { return true; } void WeChatLoginReq::Swap(WeChatLoginReq* other) { if (other != this) { std::swap(sign_, other->sign_); std::swap(openid_, other->openid_); std::swap(token_, other->token_); std::swap(expire_date_, other->expire_date_); std::swap(channel_, other->channel_); std::swap(version_, other->version_); std::swap(os_, other->os_); 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 WeChatLoginReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = WeChatLoginReq_descriptor_; metadata.reflection = WeChatLoginReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int LoginRsp::kUinFieldNumber; const int LoginRsp::kPasswordFieldNumber; const int LoginRsp::kNickFieldNumber; const int LoginRsp::kSexFieldNumber; const int LoginRsp::kOldDeskidFieldNumber; const int LoginRsp::kPortraitFieldNumber; const int LoginRsp::kWxPublicIdFieldNumber; const int LoginRsp::kWxAgentIdFieldNumber; const int LoginRsp::kIpFieldNumber; const int LoginRsp::kRoomCardFieldNumber; const int LoginRsp::kRetFieldNumber; const int LoginRsp::kWyYunxinTokenFieldNumber; const int LoginRsp::kHallBillbandFieldNumber; #endif // !_MSC_VER LoginRsp::LoginRsp() : ::google::protobuf::Message() { SharedCtor(); } void LoginRsp::InitAsDefaultInstance() { } LoginRsp::LoginRsp(const LoginRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void LoginRsp::SharedCtor() { _cached_size_ = 0; uin_ = 0; password_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); nick_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); sex_ = 0; old_deskid_ = 0; portrait_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); wx_public_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); wx_agent_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); room_card_ = 0; ret_ = 0; wy_yunxin_token_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); hall_billband_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } LoginRsp::~LoginRsp() { SharedDtor(); } void LoginRsp::SharedDtor() { if (password_ != &::google::protobuf::internal::kEmptyString) { delete password_; } if (nick_ != &::google::protobuf::internal::kEmptyString) { delete nick_; } if (portrait_ != &::google::protobuf::internal::kEmptyString) { delete portrait_; } if (wx_public_id_ != &::google::protobuf::internal::kEmptyString) { delete wx_public_id_; } if (wx_agent_id_ != &::google::protobuf::internal::kEmptyString) { delete wx_agent_id_; } if (ip_ != &::google::protobuf::internal::kEmptyString) { delete ip_; } if (wy_yunxin_token_ != &::google::protobuf::internal::kEmptyString) { delete wy_yunxin_token_; } if (hall_billband_ != &::google::protobuf::internal::kEmptyString) { delete hall_billband_; } if (this != default_instance_) { } } void LoginRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* LoginRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return LoginRsp_descriptor_; } const LoginRsp& LoginRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } LoginRsp* LoginRsp::default_instance_ = NULL; LoginRsp* LoginRsp::New() const { return new LoginRsp; } void LoginRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; if (has_password()) { if (password_ != &::google::protobuf::internal::kEmptyString) { password_->clear(); } } if (has_nick()) { if (nick_ != &::google::protobuf::internal::kEmptyString) { nick_->clear(); } } sex_ = 0; old_deskid_ = 0; if (has_portrait()) { if (portrait_ != &::google::protobuf::internal::kEmptyString) { portrait_->clear(); } } if (has_wx_public_id()) { if (wx_public_id_ != &::google::protobuf::internal::kEmptyString) { wx_public_id_->clear(); } } if (has_wx_agent_id()) { if (wx_agent_id_ != &::google::protobuf::internal::kEmptyString) { wx_agent_id_->clear(); } } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (has_ip()) { if (ip_ != &::google::protobuf::internal::kEmptyString) { ip_->clear(); } } room_card_ = 0; ret_ = 0; if (has_wy_yunxin_token()) { if (wy_yunxin_token_ != &::google::protobuf::internal::kEmptyString) { wy_yunxin_token_->clear(); } } if (has_hall_billband()) { if (hall_billband_ != &::google::protobuf::internal::kEmptyString) { hall_billband_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool LoginRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_password; break; } // optional string password = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_password: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_password())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->password().data(), this->password().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(26)) goto parse_nick; break; } // optional string nick = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_nick: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_nick())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_sex; break; } // optional int32 sex = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_sex: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &sex_))); set_has_sex(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_old_deskid; break; } // optional int32 old_deskid = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_old_deskid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &old_deskid_))); set_has_old_deskid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(58)) goto parse_portrait; break; } // optional string portrait = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_portrait: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_portrait())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(66)) goto parse_wx_public_id; break; } // optional string wx_public_id = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_wx_public_id: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_wx_public_id())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wx_public_id().data(), this->wx_public_id().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(74)) goto parse_wx_agent_id; break; } // optional string wx_agent_id = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_wx_agent_id: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_wx_agent_id())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wx_agent_id().data(), this->wx_agent_id().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(82)) goto parse_ip; break; } // optional string ip = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_ip: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_ip())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->ip().data(), this->ip().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(88)) goto parse_room_card; break; } // optional int32 room_card = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_room_card: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &room_card_))); set_has_room_card(); } else { goto handle_uninterpreted; } if (input->ExpectTag(96)) goto parse_ret; break; } // optional int32 ret = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_ret: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectTag(106)) goto parse_wy_yunxin_token; break; } // optional string wy_yunxin_token = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_wy_yunxin_token: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_wy_yunxin_token())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wy_yunxin_token().data(), this->wy_yunxin_token().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(114)) goto parse_hall_billband; break; } // optional string hall_billband = 14; case 14: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_hall_billband: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_hall_billband())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->hall_billband().data(), this->hall_billband().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void LoginRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional string password = 2; if (has_password()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->password().data(), this->password().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 2, this->password(), output); } // optional string nick = 3; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->nick(), output); } // optional int32 sex = 4; if (has_sex()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->sex(), output); } // optional int32 old_deskid = 5; if (has_old_deskid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->old_deskid(), output); } // optional string portrait = 7; if (has_portrait()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 7, this->portrait(), output); } // optional string wx_public_id = 8; if (has_wx_public_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wx_public_id().data(), this->wx_public_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 8, this->wx_public_id(), output); } // optional string wx_agent_id = 9; if (has_wx_agent_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wx_agent_id().data(), this->wx_agent_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 9, this->wx_agent_id(), output); } // optional string ip = 10; if (has_ip()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->ip().data(), this->ip().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 10, this->ip(), output); } // optional int32 room_card = 11; if (has_room_card()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(11, this->room_card(), output); } // optional int32 ret = 12; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->ret(), output); } // optional string wy_yunxin_token = 13; if (has_wy_yunxin_token()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wy_yunxin_token().data(), this->wy_yunxin_token().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 13, this->wy_yunxin_token(), output); } // optional string hall_billband = 14; if (has_hall_billband()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->hall_billband().data(), this->hall_billband().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 14, this->hall_billband(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* LoginRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional string password = 2; if (has_password()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->password().data(), this->password().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->password(), target); } // optional string nick = 3; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->nick(), target); } // optional int32 sex = 4; if (has_sex()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->sex(), target); } // optional int32 old_deskid = 5; if (has_old_deskid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->old_deskid(), target); } // optional string portrait = 7; if (has_portrait()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 7, this->portrait(), target); } // optional string wx_public_id = 8; if (has_wx_public_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wx_public_id().data(), this->wx_public_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 8, this->wx_public_id(), target); } // optional string wx_agent_id = 9; if (has_wx_agent_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wx_agent_id().data(), this->wx_agent_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 9, this->wx_agent_id(), target); } // optional string ip = 10; if (has_ip()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->ip().data(), this->ip().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 10, this->ip(), target); } // optional int32 room_card = 11; if (has_room_card()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(11, this->room_card(), target); } // optional int32 ret = 12; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->ret(), target); } // optional string wy_yunxin_token = 13; if (has_wy_yunxin_token()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wy_yunxin_token().data(), this->wy_yunxin_token().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 13, this->wy_yunxin_token(), target); } // optional string hall_billband = 14; if (has_hall_billband()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->hall_billband().data(), this->hall_billband().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 14, this->hall_billband(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int LoginRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional string password = 2; if (has_password()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->password()); } // optional string nick = 3; if (has_nick()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->nick()); } // optional int32 sex = 4; if (has_sex()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->sex()); } // optional int32 old_deskid = 5; if (has_old_deskid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->old_deskid()); } // optional string portrait = 7; if (has_portrait()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->portrait()); } // optional string wx_public_id = 8; if (has_wx_public_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->wx_public_id()); } // optional string wx_agent_id = 9; if (has_wx_agent_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->wx_agent_id()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional string ip = 10; if (has_ip()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->ip()); } // optional int32 room_card = 11; if (has_room_card()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->room_card()); } // optional int32 ret = 12; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } // optional string wy_yunxin_token = 13; if (has_wy_yunxin_token()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->wy_yunxin_token()); } // optional string hall_billband = 14; if (has_hall_billband()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->hall_billband()); } } 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 LoginRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const LoginRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const LoginRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void LoginRsp::MergeFrom(const LoginRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_password()) { set_password(from.password()); } if (from.has_nick()) { set_nick(from.nick()); } if (from.has_sex()) { set_sex(from.sex()); } if (from.has_old_deskid()) { set_old_deskid(from.old_deskid()); } if (from.has_portrait()) { set_portrait(from.portrait()); } if (from.has_wx_public_id()) { set_wx_public_id(from.wx_public_id()); } if (from.has_wx_agent_id()) { set_wx_agent_id(from.wx_agent_id()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_ip()) { set_ip(from.ip()); } if (from.has_room_card()) { set_room_card(from.room_card()); } if (from.has_ret()) { set_ret(from.ret()); } if (from.has_wy_yunxin_token()) { set_wy_yunxin_token(from.wy_yunxin_token()); } if (from.has_hall_billband()) { set_hall_billband(from.hall_billband()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void LoginRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void LoginRsp::CopyFrom(const LoginRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool LoginRsp::IsInitialized() const { return true; } void LoginRsp::Swap(LoginRsp* other) { if (other != this) { std::swap(uin_, other->uin_); std::swap(password_, other->password_); std::swap(nick_, other->nick_); std::swap(sex_, other->sex_); std::swap(old_deskid_, other->old_deskid_); std::swap(portrait_, other->portrait_); std::swap(wx_public_id_, other->wx_public_id_); std::swap(wx_agent_id_, other->wx_agent_id_); std::swap(ip_, other->ip_); std::swap(room_card_, other->room_card_); std::swap(ret_, other->ret_); std::swap(wy_yunxin_token_, other->wy_yunxin_token_); std::swap(hall_billband_, other->hall_billband_); 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 LoginRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = LoginRsp_descriptor_; metadata.reflection = LoginRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int ExtraDeskTypeInfo::kHongzhongFieldNumber; const int ExtraDeskTypeInfo::kQiduiFieldNumber; const int ExtraDeskTypeInfo::kZhuaniaoFieldNumber; const int ExtraDeskTypeInfo::kPiaofenFieldNumber; const int ExtraDeskTypeInfo::kShanghuoFieldNumber; #endif // !_MSC_VER ExtraDeskTypeInfo::ExtraDeskTypeInfo() : ::google::protobuf::Message() { SharedCtor(); } void ExtraDeskTypeInfo::InitAsDefaultInstance() { } ExtraDeskTypeInfo::ExtraDeskTypeInfo(const ExtraDeskTypeInfo& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void ExtraDeskTypeInfo::SharedCtor() { _cached_size_ = 0; hongzhong_ = false; qidui_ = false; zhuaniao_ = 0; piaofen_ = 0; shanghuo_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } ExtraDeskTypeInfo::~ExtraDeskTypeInfo() { SharedDtor(); } void ExtraDeskTypeInfo::SharedDtor() { if (this != default_instance_) { } } void ExtraDeskTypeInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ExtraDeskTypeInfo::descriptor() { protobuf_AssignDescriptorsOnce(); return ExtraDeskTypeInfo_descriptor_; } const ExtraDeskTypeInfo& ExtraDeskTypeInfo::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } ExtraDeskTypeInfo* ExtraDeskTypeInfo::default_instance_ = NULL; ExtraDeskTypeInfo* ExtraDeskTypeInfo::New() const { return new ExtraDeskTypeInfo; } void ExtraDeskTypeInfo::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { hongzhong_ = false; qidui_ = false; zhuaniao_ = 0; piaofen_ = 0; shanghuo_ = false; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool ExtraDeskTypeInfo::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bool hongzhong = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &hongzhong_))); set_has_hongzhong(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_qidui; break; } // optional bool qidui = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_qidui: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &qidui_))); set_has_qidui(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_zhuaniao; break; } // optional int32 zhuaniao = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_zhuaniao: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &zhuaniao_))); set_has_zhuaniao(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_piaofen; break; } // optional int32 piaofen = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_piaofen: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &piaofen_))); set_has_piaofen(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_shanghuo; break; } // optional bool shanghuo = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_shanghuo: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &shanghuo_))); set_has_shanghuo(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void ExtraDeskTypeInfo::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional bool hongzhong = 1; if (has_hongzhong()) { ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->hongzhong(), output); } // optional bool qidui = 2; if (has_qidui()) { ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->qidui(), output); } // optional int32 zhuaniao = 3; if (has_zhuaniao()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->zhuaniao(), output); } // optional int32 piaofen = 4; if (has_piaofen()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->piaofen(), output); } // optional bool shanghuo = 5; if (has_shanghuo()) { ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->shanghuo(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* ExtraDeskTypeInfo::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional bool hongzhong = 1; if (has_hongzhong()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->hongzhong(), target); } // optional bool qidui = 2; if (has_qidui()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->qidui(), target); } // optional int32 zhuaniao = 3; if (has_zhuaniao()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->zhuaniao(), target); } // optional int32 piaofen = 4; if (has_piaofen()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->piaofen(), target); } // optional bool shanghuo = 5; if (has_shanghuo()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->shanghuo(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int ExtraDeskTypeInfo::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional bool hongzhong = 1; if (has_hongzhong()) { total_size += 1 + 1; } // optional bool qidui = 2; if (has_qidui()) { total_size += 1 + 1; } // optional int32 zhuaniao = 3; if (has_zhuaniao()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->zhuaniao()); } // optional int32 piaofen = 4; if (has_piaofen()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->piaofen()); } // optional bool shanghuo = 5; if (has_shanghuo()) { 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 ExtraDeskTypeInfo::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const ExtraDeskTypeInfo* source = ::google::protobuf::internal::dynamic_cast_if_available<const ExtraDeskTypeInfo*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void ExtraDeskTypeInfo::MergeFrom(const ExtraDeskTypeInfo& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_hongzhong()) { set_hongzhong(from.hongzhong()); } if (from.has_qidui()) { set_qidui(from.qidui()); } if (from.has_zhuaniao()) { set_zhuaniao(from.zhuaniao()); } if (from.has_piaofen()) { set_piaofen(from.piaofen()); } if (from.has_shanghuo()) { set_shanghuo(from.shanghuo()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void ExtraDeskTypeInfo::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void ExtraDeskTypeInfo::CopyFrom(const ExtraDeskTypeInfo& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool ExtraDeskTypeInfo::IsInitialized() const { return true; } void ExtraDeskTypeInfo::Swap(ExtraDeskTypeInfo* other) { if (other != this) { std::swap(hongzhong_, other->hongzhong_); std::swap(qidui_, other->qidui_); std::swap(zhuaniao_, other->zhuaniao_); std::swap(piaofen_, other->piaofen_); std::swap(shanghuo_, other->shanghuo_); 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 ExtraDeskTypeInfo::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = ExtraDeskTypeInfo_descriptor_; metadata.reflection = ExtraDeskTypeInfo_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameEnterDeskReq::kDstDeskIdFieldNumber; const int GameEnterDeskReq::kNewDeskFieldNumber; const int GameEnterDeskReq::kReconnectFieldNumber; const int GameEnterDeskReq::kCardNumFieldNumber; const int GameEnterDeskReq::kDeskTypeFieldNumber; const int GameEnterDeskReq::kSeatLimitFieldNumber; const int GameEnterDeskReq::kWinTypeFieldNumber; const int GameEnterDeskReq::kExtraTypeFieldNumber; #endif // !_MSC_VER GameEnterDeskReq::GameEnterDeskReq() : ::google::protobuf::Message() { SharedCtor(); } void GameEnterDeskReq::InitAsDefaultInstance() { extra_type_ = const_cast< ::ExtraDeskTypeInfo*>(&::ExtraDeskTypeInfo::default_instance()); } GameEnterDeskReq::GameEnterDeskReq(const GameEnterDeskReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameEnterDeskReq::SharedCtor() { _cached_size_ = 0; dst_desk_id_ = 0; new_desk_ = 0; reconnect_ = 0; card_num_ = 0; desk_type_ = 0; seat_limit_ = 0; win_type_ = 0; extra_type_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameEnterDeskReq::~GameEnterDeskReq() { SharedDtor(); } void GameEnterDeskReq::SharedDtor() { if (this != default_instance_) { delete extra_type_; } } void GameEnterDeskReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameEnterDeskReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameEnterDeskReq_descriptor_; } const GameEnterDeskReq& GameEnterDeskReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameEnterDeskReq* GameEnterDeskReq::default_instance_ = NULL; GameEnterDeskReq* GameEnterDeskReq::New() const { return new GameEnterDeskReq; } void GameEnterDeskReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { dst_desk_id_ = 0; new_desk_ = 0; reconnect_ = 0; card_num_ = 0; desk_type_ = 0; seat_limit_ = 0; win_type_ = 0; if (has_extra_type()) { if (extra_type_ != NULL) extra_type_->::ExtraDeskTypeInfo::Clear(); } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameEnterDeskReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 dst_desk_id = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &dst_desk_id_))); set_has_dst_desk_id(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_new_desk; break; } // optional int32 new_desk = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_new_desk: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &new_desk_))); set_has_new_desk(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_reconnect; break; } // optional int32 reconnect = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_reconnect: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &reconnect_))); set_has_reconnect(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_card_num; break; } // optional int32 card_num = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_card_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &card_num_))); set_has_card_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_desk_type; break; } // optional int32 desk_type = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_desk_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &desk_type_))); set_has_desk_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_seat_limit; break; } // optional int32 seat_limit = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_seat_limit: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &seat_limit_))); set_has_seat_limit(); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_win_type; break; } // optional int32 win_type = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_win_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &win_type_))); set_has_win_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(66)) goto parse_extra_type; break; } // optional .ExtraDeskTypeInfo extra_type = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_extra_type: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_extra_type())); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameEnterDeskReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 dst_desk_id = 1; if (has_dst_desk_id()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->dst_desk_id(), output); } // optional int32 new_desk = 2; if (has_new_desk()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->new_desk(), output); } // optional int32 reconnect = 3; if (has_reconnect()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->reconnect(), output); } // optional int32 card_num = 4; if (has_card_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->card_num(), output); } // optional int32 desk_type = 5; if (has_desk_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->desk_type(), output); } // optional int32 seat_limit = 6; if (has_seat_limit()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->seat_limit(), output); } // optional int32 win_type = 7; if (has_win_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->win_type(), output); } // optional .ExtraDeskTypeInfo extra_type = 8; if (has_extra_type()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 8, this->extra_type(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameEnterDeskReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 dst_desk_id = 1; if (has_dst_desk_id()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->dst_desk_id(), target); } // optional int32 new_desk = 2; if (has_new_desk()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->new_desk(), target); } // optional int32 reconnect = 3; if (has_reconnect()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->reconnect(), target); } // optional int32 card_num = 4; if (has_card_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->card_num(), target); } // optional int32 desk_type = 5; if (has_desk_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->desk_type(), target); } // optional int32 seat_limit = 6; if (has_seat_limit()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->seat_limit(), target); } // optional int32 win_type = 7; if (has_win_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->win_type(), target); } // optional .ExtraDeskTypeInfo extra_type = 8; if (has_extra_type()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 8, this->extra_type(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameEnterDeskReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 dst_desk_id = 1; if (has_dst_desk_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->dst_desk_id()); } // optional int32 new_desk = 2; if (has_new_desk()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->new_desk()); } // optional int32 reconnect = 3; if (has_reconnect()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->reconnect()); } // optional int32 card_num = 4; if (has_card_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->card_num()); } // optional int32 desk_type = 5; if (has_desk_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->desk_type()); } // optional int32 seat_limit = 6; if (has_seat_limit()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->seat_limit()); } // optional int32 win_type = 7; if (has_win_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->win_type()); } // optional .ExtraDeskTypeInfo extra_type = 8; if (has_extra_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->extra_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 GameEnterDeskReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameEnterDeskReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameEnterDeskReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameEnterDeskReq::MergeFrom(const GameEnterDeskReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_dst_desk_id()) { set_dst_desk_id(from.dst_desk_id()); } if (from.has_new_desk()) { set_new_desk(from.new_desk()); } if (from.has_reconnect()) { set_reconnect(from.reconnect()); } if (from.has_card_num()) { set_card_num(from.card_num()); } if (from.has_desk_type()) { set_desk_type(from.desk_type()); } if (from.has_seat_limit()) { set_seat_limit(from.seat_limit()); } if (from.has_win_type()) { set_win_type(from.win_type()); } if (from.has_extra_type()) { mutable_extra_type()->::ExtraDeskTypeInfo::MergeFrom(from.extra_type()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameEnterDeskReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameEnterDeskReq::CopyFrom(const GameEnterDeskReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameEnterDeskReq::IsInitialized() const { return true; } void GameEnterDeskReq::Swap(GameEnterDeskReq* other) { if (other != this) { std::swap(dst_desk_id_, other->dst_desk_id_); std::swap(new_desk_, other->new_desk_); std::swap(reconnect_, other->reconnect_); std::swap(card_num_, other->card_num_); std::swap(desk_type_, other->desk_type_); std::swap(seat_limit_, other->seat_limit_); std::swap(win_type_, other->win_type_); std::swap(extra_type_, other->extra_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 GameEnterDeskReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameEnterDeskReq_descriptor_; metadata.reflection = GameEnterDeskReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameEnterDeskRsp::kRetFieldNumber; #endif // !_MSC_VER GameEnterDeskRsp::GameEnterDeskRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameEnterDeskRsp::InitAsDefaultInstance() { } GameEnterDeskRsp::GameEnterDeskRsp(const GameEnterDeskRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameEnterDeskRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameEnterDeskRsp::~GameEnterDeskRsp() { SharedDtor(); } void GameEnterDeskRsp::SharedDtor() { if (this != default_instance_) { } } void GameEnterDeskRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameEnterDeskRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameEnterDeskRsp_descriptor_; } const GameEnterDeskRsp& GameEnterDeskRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameEnterDeskRsp* GameEnterDeskRsp::default_instance_ = NULL; GameEnterDeskRsp* GameEnterDeskRsp::New() const { return new GameEnterDeskRsp; } void GameEnterDeskRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameEnterDeskRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameEnterDeskRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameEnterDeskRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameEnterDeskRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameEnterDeskRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameEnterDeskRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameEnterDeskRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameEnterDeskRsp::MergeFrom(const GameEnterDeskRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameEnterDeskRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameEnterDeskRsp::CopyFrom(const GameEnterDeskRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameEnterDeskRsp::IsInitialized() const { return true; } void GameEnterDeskRsp::Swap(GameEnterDeskRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameEnterDeskRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameEnterDeskRsp_descriptor_; metadata.reflection = GameEnterDeskRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int UserRoomCardChange::kRoomCardFieldNumber; const int UserRoomCardChange::kChangeReasonFieldNumber; #endif // !_MSC_VER UserRoomCardChange::UserRoomCardChange() : ::google::protobuf::Message() { SharedCtor(); } void UserRoomCardChange::InitAsDefaultInstance() { } UserRoomCardChange::UserRoomCardChange(const UserRoomCardChange& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void UserRoomCardChange::SharedCtor() { _cached_size_ = 0; room_card_ = 0; change_reason_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } UserRoomCardChange::~UserRoomCardChange() { SharedDtor(); } void UserRoomCardChange::SharedDtor() { if (this != default_instance_) { } } void UserRoomCardChange::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UserRoomCardChange::descriptor() { protobuf_AssignDescriptorsOnce(); return UserRoomCardChange_descriptor_; } const UserRoomCardChange& UserRoomCardChange::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } UserRoomCardChange* UserRoomCardChange::default_instance_ = NULL; UserRoomCardChange* UserRoomCardChange::New() const { return new UserRoomCardChange; } void UserRoomCardChange::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { room_card_ = 0; change_reason_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool UserRoomCardChange::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 room_card = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &room_card_))); set_has_room_card(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_change_reason; break; } // optional int32 change_reason = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_change_reason: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &change_reason_))); set_has_change_reason(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void UserRoomCardChange::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 room_card = 1; if (has_room_card()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->room_card(), output); } // optional int32 change_reason = 2; if (has_change_reason()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->change_reason(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* UserRoomCardChange::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 room_card = 1; if (has_room_card()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->room_card(), target); } // optional int32 change_reason = 2; if (has_change_reason()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->change_reason(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int UserRoomCardChange::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 room_card = 1; if (has_room_card()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->room_card()); } // optional int32 change_reason = 2; if (has_change_reason()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->change_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 UserRoomCardChange::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const UserRoomCardChange* source = ::google::protobuf::internal::dynamic_cast_if_available<const UserRoomCardChange*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void UserRoomCardChange::MergeFrom(const UserRoomCardChange& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_room_card()) { set_room_card(from.room_card()); } if (from.has_change_reason()) { set_change_reason(from.change_reason()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void UserRoomCardChange::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void UserRoomCardChange::CopyFrom(const UserRoomCardChange& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool UserRoomCardChange::IsInitialized() const { return true; } void UserRoomCardChange::Swap(UserRoomCardChange* other) { if (other != this) { std::swap(room_card_, other->room_card_); std::swap(change_reason_, other->change_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 UserRoomCardChange::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = UserRoomCardChange_descriptor_; metadata.reflection = UserRoomCardChange_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameUserInfo::kStatusFieldNumber; const int GameUserInfo::kUinFieldNumber; const int GameUserInfo::kNickFieldNumber; const int GameUserInfo::kSeatidFieldNumber; const int GameUserInfo::kSexFieldNumber; const int GameUserInfo::kPortraitFieldNumber; const int GameUserInfo::kIsMasterFieldNumber; const int GameUserInfo::kPiaofenFieldNumber; const int GameUserInfo::kShanghuoFieldNumber; const int GameUserInfo::kIpFieldNumber; #endif // !_MSC_VER GameUserInfo::GameUserInfo() : ::google::protobuf::Message() { SharedCtor(); } void GameUserInfo::InitAsDefaultInstance() { } GameUserInfo::GameUserInfo(const GameUserInfo& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameUserInfo::SharedCtor() { _cached_size_ = 0; status_ = 0; uin_ = 0; nick_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); seatid_ = 0; sex_ = 0; portrait_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); is_master_ = 0; piaofen_ = 0; shanghuo_ = 0; ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameUserInfo::~GameUserInfo() { SharedDtor(); } void GameUserInfo::SharedDtor() { if (nick_ != &::google::protobuf::internal::kEmptyString) { delete nick_; } if (portrait_ != &::google::protobuf::internal::kEmptyString) { delete portrait_; } if (ip_ != &::google::protobuf::internal::kEmptyString) { delete ip_; } if (this != default_instance_) { } } void GameUserInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameUserInfo::descriptor() { protobuf_AssignDescriptorsOnce(); return GameUserInfo_descriptor_; } const GameUserInfo& GameUserInfo::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameUserInfo* GameUserInfo::default_instance_ = NULL; GameUserInfo* GameUserInfo::New() const { return new GameUserInfo; } void GameUserInfo::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { status_ = 0; uin_ = 0; if (has_nick()) { if (nick_ != &::google::protobuf::internal::kEmptyString) { nick_->clear(); } } seatid_ = 0; sex_ = 0; if (has_portrait()) { if (portrait_ != &::google::protobuf::internal::kEmptyString) { portrait_->clear(); } } is_master_ = 0; piaofen_ = 0; } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { shanghuo_ = 0; if (has_ip()) { if (ip_ != &::google::protobuf::internal::kEmptyString) { ip_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameUserInfo::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 status = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_uin; break; } // optional int32 uin = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(26)) goto parse_nick; break; } // optional string nick = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_nick: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_nick())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_seatid; break; } // optional int32 seatid = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_seatid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &seatid_))); set_has_seatid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_sex; break; } // optional int32 sex = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_sex: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &sex_))); set_has_sex(); } else { goto handle_uninterpreted; } if (input->ExpectTag(50)) goto parse_portrait; break; } // optional string portrait = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_portrait: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_portrait())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_is_master; break; } // optional int32 is_master = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_is_master: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &is_master_))); set_has_is_master(); } else { goto handle_uninterpreted; } if (input->ExpectTag(64)) goto parse_piaofen; break; } // optional int32 piaofen = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_piaofen: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &piaofen_))); set_has_piaofen(); } else { goto handle_uninterpreted; } if (input->ExpectTag(72)) goto parse_shanghuo; break; } // optional int32 shanghuo = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_shanghuo: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &shanghuo_))); set_has_shanghuo(); } else { goto handle_uninterpreted; } if (input->ExpectTag(82)) goto parse_ip; break; } // optional string ip = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_ip: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_ip())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->ip().data(), this->ip().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameUserInfo::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 status = 1; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->status(), output); } // optional int32 uin = 2; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->uin(), output); } // optional string nick = 3; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->nick(), output); } // optional int32 seatid = 4; if (has_seatid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->seatid(), output); } // optional int32 sex = 5; if (has_sex()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->sex(), output); } // optional string portrait = 6; if (has_portrait()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 6, this->portrait(), output); } // optional int32 is_master = 7; if (has_is_master()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->is_master(), output); } // optional int32 piaofen = 8; if (has_piaofen()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->piaofen(), output); } // optional int32 shanghuo = 9; if (has_shanghuo()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->shanghuo(), output); } // optional string ip = 10; if (has_ip()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->ip().data(), this->ip().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 10, this->ip(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameUserInfo::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 status = 1; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->status(), target); } // optional int32 uin = 2; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->uin(), target); } // optional string nick = 3; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->nick(), target); } // optional int32 seatid = 4; if (has_seatid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->seatid(), target); } // optional int32 sex = 5; if (has_sex()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->sex(), target); } // optional string portrait = 6; if (has_portrait()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 6, this->portrait(), target); } // optional int32 is_master = 7; if (has_is_master()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->is_master(), target); } // optional int32 piaofen = 8; if (has_piaofen()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->piaofen(), target); } // optional int32 shanghuo = 9; if (has_shanghuo()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->shanghuo(), target); } // optional string ip = 10; if (has_ip()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->ip().data(), this->ip().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 10, this->ip(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameUserInfo::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 status = 1; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 uin = 2; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional string nick = 3; if (has_nick()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->nick()); } // optional int32 seatid = 4; if (has_seatid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->seatid()); } // optional int32 sex = 5; if (has_sex()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->sex()); } // optional string portrait = 6; if (has_portrait()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->portrait()); } // optional int32 is_master = 7; if (has_is_master()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->is_master()); } // optional int32 piaofen = 8; if (has_piaofen()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->piaofen()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional int32 shanghuo = 9; if (has_shanghuo()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->shanghuo()); } // optional string ip = 10; if (has_ip()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->ip()); } } 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 GameUserInfo::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameUserInfo* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameUserInfo*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameUserInfo::MergeFrom(const GameUserInfo& 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_uin()) { set_uin(from.uin()); } if (from.has_nick()) { set_nick(from.nick()); } if (from.has_seatid()) { set_seatid(from.seatid()); } if (from.has_sex()) { set_sex(from.sex()); } if (from.has_portrait()) { set_portrait(from.portrait()); } if (from.has_is_master()) { set_is_master(from.is_master()); } if (from.has_piaofen()) { set_piaofen(from.piaofen()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_shanghuo()) { set_shanghuo(from.shanghuo()); } if (from.has_ip()) { set_ip(from.ip()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameUserInfo::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameUserInfo::CopyFrom(const GameUserInfo& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameUserInfo::IsInitialized() const { return true; } void GameUserInfo::Swap(GameUserInfo* other) { if (other != this) { std::swap(status_, other->status_); std::swap(uin_, other->uin_); std::swap(nick_, other->nick_); std::swap(seatid_, other->seatid_); std::swap(sex_, other->sex_); std::swap(portrait_, other->portrait_); std::swap(is_master_, other->is_master_); std::swap(piaofen_, other->piaofen_); std::swap(shanghuo_, other->shanghuo_); std::swap(ip_, other->ip_); 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 GameUserInfo::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameUserInfo_descriptor_; metadata.reflection = GameUserInfo_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int UserCommonCards::kUinFieldNumber; const int UserCommonCards::kCardLenFieldNumber; const int UserCommonCards::kOutCardsFieldNumber; const int UserCommonCards::kDiscardFieldNumber; const int UserCommonCards::kSeatidFieldNumber; const int UserCommonCards::kStatusFieldNumber; const int UserCommonCards::kOpListFieldNumber; const int UserCommonCards::kChipsFieldNumber; #endif // !_MSC_VER UserCommonCards::UserCommonCards() : ::google::protobuf::Message() { SharedCtor(); } void UserCommonCards::InitAsDefaultInstance() { } UserCommonCards::UserCommonCards(const UserCommonCards& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void UserCommonCards::SharedCtor() { _cached_size_ = 0; uin_ = 0; card_len_ = 0; seatid_ = 0; status_ = 0; chips_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } UserCommonCards::~UserCommonCards() { SharedDtor(); } void UserCommonCards::SharedDtor() { if (this != default_instance_) { } } void UserCommonCards::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UserCommonCards::descriptor() { protobuf_AssignDescriptorsOnce(); return UserCommonCards_descriptor_; } const UserCommonCards& UserCommonCards::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } UserCommonCards* UserCommonCards::default_instance_ = NULL; UserCommonCards* UserCommonCards::New() const { return new UserCommonCards; } void UserCommonCards::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; card_len_ = 0; seatid_ = 0; status_ = 0; chips_ = 0; } out_cards_.Clear(); discard_.Clear(); op_list_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool UserCommonCards::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_card_len; break; } // optional int32 card_len = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_card_len: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &card_len_))); set_has_card_len(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_out_cards; break; } // repeated int32 out_cards = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_out_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 24, input, this->mutable_out_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_out_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_out_cards; if (input->ExpectTag(32)) goto parse_discard; break; } // repeated int32 discard = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_discard: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 32, input, this->mutable_discard()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_discard()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_discard; if (input->ExpectTag(40)) goto parse_seatid; break; } // optional int32 seatid = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_seatid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &seatid_))); set_has_seatid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_status; break; } // optional int32 status = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_op_list; break; } // repeated int32 op_list = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 56, input, this->mutable_op_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_op_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_op_list; if (input->ExpectTag(64)) goto parse_chips; break; } // optional int32 chips = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_chips: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &chips_))); set_has_chips(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void UserCommonCards::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional int32 card_len = 2; if (has_card_len()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->card_len(), output); } // repeated int32 out_cards = 3; for (int i = 0; i < this->out_cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 3, this->out_cards(i), output); } // repeated int32 discard = 4; for (int i = 0; i < this->discard_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 4, this->discard(i), output); } // optional int32 seatid = 5; if (has_seatid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->seatid(), output); } // optional int32 status = 6; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->status(), output); } // repeated int32 op_list = 7; for (int i = 0; i < this->op_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 7, this->op_list(i), output); } // optional int32 chips = 8; if (has_chips()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->chips(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* UserCommonCards::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional int32 card_len = 2; if (has_card_len()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->card_len(), target); } // repeated int32 out_cards = 3; for (int i = 0; i < this->out_cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(3, this->out_cards(i), target); } // repeated int32 discard = 4; for (int i = 0; i < this->discard_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(4, this->discard(i), target); } // optional int32 seatid = 5; if (has_seatid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->seatid(), target); } // optional int32 status = 6; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->status(), target); } // repeated int32 op_list = 7; for (int i = 0; i < this->op_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(7, this->op_list(i), target); } // optional int32 chips = 8; if (has_chips()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->chips(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int UserCommonCards::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional int32 card_len = 2; if (has_card_len()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->card_len()); } // optional int32 seatid = 5; if (has_seatid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->seatid()); } // optional int32 status = 6; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 chips = 8; if (has_chips()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->chips()); } } // repeated int32 out_cards = 3; { int data_size = 0; for (int i = 0; i < this->out_cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->out_cards(i)); } total_size += 1 * this->out_cards_size() + data_size; } // repeated int32 discard = 4; { int data_size = 0; for (int i = 0; i < this->discard_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->discard(i)); } total_size += 1 * this->discard_size() + data_size; } // repeated int32 op_list = 7; { int data_size = 0; for (int i = 0; i < this->op_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->op_list(i)); } total_size += 1 * this->op_list_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 UserCommonCards::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const UserCommonCards* source = ::google::protobuf::internal::dynamic_cast_if_available<const UserCommonCards*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void UserCommonCards::MergeFrom(const UserCommonCards& from) { GOOGLE_CHECK_NE(&from, this); out_cards_.MergeFrom(from.out_cards_); discard_.MergeFrom(from.discard_); op_list_.MergeFrom(from.op_list_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_card_len()) { set_card_len(from.card_len()); } if (from.has_seatid()) { set_seatid(from.seatid()); } if (from.has_status()) { set_status(from.status()); } if (from.has_chips()) { set_chips(from.chips()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void UserCommonCards::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void UserCommonCards::CopyFrom(const UserCommonCards& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool UserCommonCards::IsInitialized() const { return true; } void UserCommonCards::Swap(UserCommonCards* other) { if (other != this) { std::swap(uin_, other->uin_); std::swap(card_len_, other->card_len_); out_cards_.Swap(&other->out_cards_); discard_.Swap(&other->discard_); std::swap(seatid_, other->seatid_); std::swap(status_, other->status_); op_list_.Swap(&other->op_list_); std::swap(chips_, other->chips_); 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 UserCommonCards::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = UserCommonCards_descriptor_; metadata.reflection = UserCommonCards_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int MyOption::kOpChiFieldNumber; const int MyOption::kOpPengFieldNumber; const int MyOption::kOpGangFieldNumber; const int MyOption::kOpHuFieldNumber; const int MyOption::kNeedWaitFieldNumber; const int MyOption::kChiCardsFieldNumber; #endif // !_MSC_VER MyOption::MyOption() : ::google::protobuf::Message() { SharedCtor(); } void MyOption::InitAsDefaultInstance() { } MyOption::MyOption(const MyOption& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void MyOption::SharedCtor() { _cached_size_ = 0; op_chi_ = false; op_peng_ = false; op_gang_ = false; op_hu_ = false; need_wait_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } MyOption::~MyOption() { SharedDtor(); } void MyOption::SharedDtor() { if (this != default_instance_) { } } void MyOption::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MyOption::descriptor() { protobuf_AssignDescriptorsOnce(); return MyOption_descriptor_; } const MyOption& MyOption::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } MyOption* MyOption::default_instance_ = NULL; MyOption* MyOption::New() const { return new MyOption; } void MyOption::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { op_chi_ = false; op_peng_ = false; op_gang_ = false; op_hu_ = false; need_wait_ = false; } chi_cards_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool MyOption::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional bool op_chi = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &op_chi_))); set_has_op_chi(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_op_peng; break; } // optional bool op_peng = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_peng: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &op_peng_))); set_has_op_peng(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_op_gang; break; } // optional bool op_gang = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_gang: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &op_gang_))); set_has_op_gang(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_op_hu; break; } // optional bool op_hu = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_hu: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &op_hu_))); set_has_op_hu(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_need_wait; break; } // optional bool need_wait = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_need_wait: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &need_wait_))); set_has_need_wait(); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_chi_cards; break; } // repeated int32 chi_cards = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_chi_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 48, input, this->mutable_chi_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_chi_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_chi_cards; if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void MyOption::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional bool op_chi = 1; if (has_op_chi()) { ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->op_chi(), output); } // optional bool op_peng = 2; if (has_op_peng()) { ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->op_peng(), output); } // optional bool op_gang = 3; if (has_op_gang()) { ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->op_gang(), output); } // optional bool op_hu = 4; if (has_op_hu()) { ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->op_hu(), output); } // optional bool need_wait = 5; if (has_need_wait()) { ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->need_wait(), output); } // repeated int32 chi_cards = 6; for (int i = 0; i < this->chi_cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 6, this->chi_cards(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* MyOption::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional bool op_chi = 1; if (has_op_chi()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->op_chi(), target); } // optional bool op_peng = 2; if (has_op_peng()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->op_peng(), target); } // optional bool op_gang = 3; if (has_op_gang()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->op_gang(), target); } // optional bool op_hu = 4; if (has_op_hu()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->op_hu(), target); } // optional bool need_wait = 5; if (has_need_wait()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->need_wait(), target); } // repeated int32 chi_cards = 6; for (int i = 0; i < this->chi_cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(6, this->chi_cards(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int MyOption::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional bool op_chi = 1; if (has_op_chi()) { total_size += 1 + 1; } // optional bool op_peng = 2; if (has_op_peng()) { total_size += 1 + 1; } // optional bool op_gang = 3; if (has_op_gang()) { total_size += 1 + 1; } // optional bool op_hu = 4; if (has_op_hu()) { total_size += 1 + 1; } // optional bool need_wait = 5; if (has_need_wait()) { total_size += 1 + 1; } } // repeated int32 chi_cards = 6; { int data_size = 0; for (int i = 0; i < this->chi_cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->chi_cards(i)); } total_size += 1 * this->chi_cards_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 MyOption::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const MyOption* source = ::google::protobuf::internal::dynamic_cast_if_available<const MyOption*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void MyOption::MergeFrom(const MyOption& from) { GOOGLE_CHECK_NE(&from, this); chi_cards_.MergeFrom(from.chi_cards_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_op_chi()) { set_op_chi(from.op_chi()); } if (from.has_op_peng()) { set_op_peng(from.op_peng()); } if (from.has_op_gang()) { set_op_gang(from.op_gang()); } if (from.has_op_hu()) { set_op_hu(from.op_hu()); } if (from.has_need_wait()) { set_need_wait(from.need_wait()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void MyOption::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void MyOption::CopyFrom(const MyOption& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool MyOption::IsInitialized() const { return true; } void MyOption::Swap(MyOption* other) { if (other != this) { std::swap(op_chi_, other->op_chi_); std::swap(op_peng_, other->op_peng_); std::swap(op_gang_, other->op_gang_); std::swap(op_hu_, other->op_hu_); std::swap(need_wait_, other->need_wait_); chi_cards_.Swap(&other->chi_cards_); 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 MyOption::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = MyOption_descriptor_; metadata.reflection = MyOption_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int EvtDeskUserEnter::kDeskidFieldNumber; const int EvtDeskUserEnter::kOpUinFieldNumber; const int EvtDeskUserEnter::kStatusFieldNumber; const int EvtDeskUserEnter::kMaxRoundFieldNumber; const int EvtDeskUserEnter::kUsersFieldNumber; const int EvtDeskUserEnter::kNextUinFieldNumber; const int EvtDeskUserEnter::kDealerSeatidFieldNumber; const int EvtDeskUserEnter::kCardsFieldNumber; const int EvtDeskUserEnter::kInUsersFieldNumber; const int EvtDeskUserEnter::kShareCardsLenFieldNumber; const int EvtDeskUserEnter::kGameRoundFieldNumber; const int EvtDeskUserEnter::kMyOptionFieldNumber; const int EvtDeskUserEnter::kRecvCardUinFieldNumber; const int EvtDeskUserEnter::kDeskRemainRoundFieldNumber; const int EvtDeskUserEnter::kSeatNumFieldNumber; const int EvtDeskUserEnter::kRemainTimeFieldNumber; const int EvtDeskUserEnter::kApplyUinFieldNumber; const int EvtDeskUserEnter::kWinTypeFieldNumber; const int EvtDeskUserEnter::kExtraTypeFieldNumber; const int EvtDeskUserEnter::kTypeFieldNumber; const int EvtDeskUserEnter::kPreRemainTimeFieldNumber; #endif // !_MSC_VER EvtDeskUserEnter::EvtDeskUserEnter() : ::google::protobuf::Message() { SharedCtor(); } void EvtDeskUserEnter::InitAsDefaultInstance() { my_option_ = const_cast< ::MyOption*>(&::MyOption::default_instance()); extra_type_ = const_cast< ::ExtraDeskTypeInfo*>(&::ExtraDeskTypeInfo::default_instance()); } EvtDeskUserEnter::EvtDeskUserEnter(const EvtDeskUserEnter& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void EvtDeskUserEnter::SharedCtor() { _cached_size_ = 0; deskid_ = 0; op_uin_ = 0; status_ = 0; max_round_ = 0; next_uin_ = 0; dealer_seatid_ = 0; share_cards_len_ = 0; game_round_ = 0; my_option_ = NULL; recv_card_uin_ = 0; desk_remain_round_ = 0; seat_num_ = 0; remain_time_ = 0; apply_uin_ = 0; win_type_ = 0; extra_type_ = NULL; type_ = 0; pre_remain_time_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } EvtDeskUserEnter::~EvtDeskUserEnter() { SharedDtor(); } void EvtDeskUserEnter::SharedDtor() { if (this != default_instance_) { delete my_option_; delete extra_type_; } } void EvtDeskUserEnter::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EvtDeskUserEnter::descriptor() { protobuf_AssignDescriptorsOnce(); return EvtDeskUserEnter_descriptor_; } const EvtDeskUserEnter& EvtDeskUserEnter::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } EvtDeskUserEnter* EvtDeskUserEnter::default_instance_ = NULL; EvtDeskUserEnter* EvtDeskUserEnter::New() const { return new EvtDeskUserEnter; } void EvtDeskUserEnter::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { deskid_ = 0; op_uin_ = 0; status_ = 0; max_round_ = 0; next_uin_ = 0; dealer_seatid_ = 0; } if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) { share_cards_len_ = 0; game_round_ = 0; if (has_my_option()) { if (my_option_ != NULL) my_option_->::MyOption::Clear(); } recv_card_uin_ = 0; desk_remain_round_ = 0; seat_num_ = 0; remain_time_ = 0; } if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { apply_uin_ = 0; win_type_ = 0; if (has_extra_type()) { if (extra_type_ != NULL) extra_type_->::ExtraDeskTypeInfo::Clear(); } type_ = 0; pre_remain_time_ = 0; } users_.Clear(); cards_.Clear(); in_users_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool EvtDeskUserEnter::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 deskid = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &deskid_))); set_has_deskid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_op_uin; break; } // optional int32 op_uin = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &op_uin_))); set_has_op_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_status; break; } // optional int32 status = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_max_round; break; } // optional int32 max_round = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_max_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &max_round_))); set_has_max_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(42)) goto parse_users; break; } // repeated .GameUserInfo users = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_users: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_users())); } else { goto handle_uninterpreted; } if (input->ExpectTag(42)) goto parse_users; if (input->ExpectTag(48)) goto parse_next_uin; break; } // optional int32 next_uin = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_next_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &next_uin_))); set_has_next_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_dealer_seatid; break; } // optional int32 dealer_seatid = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_dealer_seatid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &dealer_seatid_))); set_has_dealer_seatid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(66)) goto parse_cards; break; } // repeated int32 cards = 8 [packed = true]; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 66, input, this->mutable_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(74)) goto parse_in_users; break; } // repeated .UserCommonCards in_users = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_in_users: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_in_users())); } else { goto handle_uninterpreted; } if (input->ExpectTag(74)) goto parse_in_users; if (input->ExpectTag(80)) goto parse_share_cards_len; break; } // optional int32 share_cards_len = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_share_cards_len: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &share_cards_len_))); set_has_share_cards_len(); } else { goto handle_uninterpreted; } if (input->ExpectTag(88)) goto parse_game_round; break; } // optional int32 game_round = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_game_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &game_round_))); set_has_game_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(98)) goto parse_my_option; break; } // optional .MyOption my_option = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_my_option: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_my_option())); } else { goto handle_uninterpreted; } if (input->ExpectTag(104)) goto parse_recv_card_uin; break; } // optional int32 recv_card_uin = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_recv_card_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &recv_card_uin_))); set_has_recv_card_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(112)) goto parse_desk_remain_round; break; } // optional int32 desk_remain_round = 14; case 14: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_desk_remain_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &desk_remain_round_))); set_has_desk_remain_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(120)) goto parse_seat_num; break; } // optional int32 seat_num = 15; case 15: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_seat_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &seat_num_))); set_has_seat_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(128)) goto parse_remain_time; break; } // optional int32 remain_time = 16; case 16: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_remain_time: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &remain_time_))); set_has_remain_time(); } else { goto handle_uninterpreted; } if (input->ExpectTag(136)) goto parse_apply_uin; break; } // optional int32 apply_uin = 17; case 17: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_apply_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &apply_uin_))); set_has_apply_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(144)) goto parse_win_type; break; } // optional int32 win_type = 18; case 18: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_win_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &win_type_))); set_has_win_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(154)) goto parse_extra_type; break; } // optional .ExtraDeskTypeInfo extra_type = 19; case 19: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_extra_type: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_extra_type())); } else { goto handle_uninterpreted; } if (input->ExpectTag(160)) goto parse_type; break; } // optional int32 type = 20; case 20: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &type_))); set_has_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(168)) goto parse_pre_remain_time; break; } // optional int32 pre_remain_time = 21; case 21: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_pre_remain_time: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &pre_remain_time_))); set_has_pre_remain_time(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void EvtDeskUserEnter::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 deskid = 1; if (has_deskid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->deskid(), output); } // optional int32 op_uin = 2; if (has_op_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->op_uin(), output); } // optional int32 status = 3; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->status(), output); } // optional int32 max_round = 4; if (has_max_round()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->max_round(), output); } // repeated .GameUserInfo users = 5; for (int i = 0; i < this->users_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 5, this->users(i), output); } // optional int32 next_uin = 6; if (has_next_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->next_uin(), output); } // optional int32 dealer_seatid = 7; if (has_dealer_seatid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->dealer_seatid(), output); } // repeated int32 cards = 8 [packed = true]; if (this->cards_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_cards_cached_byte_size_); } for (int i = 0; i < this->cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->cards(i), output); } // repeated .UserCommonCards in_users = 9; for (int i = 0; i < this->in_users_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 9, this->in_users(i), output); } // optional int32 share_cards_len = 10; if (has_share_cards_len()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(10, this->share_cards_len(), output); } // optional int32 game_round = 11; if (has_game_round()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(11, this->game_round(), output); } // optional .MyOption my_option = 12; if (has_my_option()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 12, this->my_option(), output); } // optional int32 recv_card_uin = 13; if (has_recv_card_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->recv_card_uin(), output); } // optional int32 desk_remain_round = 14; if (has_desk_remain_round()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->desk_remain_round(), output); } // optional int32 seat_num = 15; if (has_seat_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(15, this->seat_num(), output); } // optional int32 remain_time = 16; if (has_remain_time()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->remain_time(), output); } // optional int32 apply_uin = 17; if (has_apply_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->apply_uin(), output); } // optional int32 win_type = 18; if (has_win_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->win_type(), output); } // optional .ExtraDeskTypeInfo extra_type = 19; if (has_extra_type()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 19, this->extra_type(), output); } // optional int32 type = 20; if (has_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(20, this->type(), output); } // optional int32 pre_remain_time = 21; if (has_pre_remain_time()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(21, this->pre_remain_time(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* EvtDeskUserEnter::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 deskid = 1; if (has_deskid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->deskid(), target); } // optional int32 op_uin = 2; if (has_op_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->op_uin(), target); } // optional int32 status = 3; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->status(), target); } // optional int32 max_round = 4; if (has_max_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->max_round(), target); } // repeated .GameUserInfo users = 5; for (int i = 0; i < this->users_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 5, this->users(i), target); } // optional int32 next_uin = 6; if (has_next_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->next_uin(), target); } // optional int32 dealer_seatid = 7; if (has_dealer_seatid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->dealer_seatid(), target); } // repeated int32 cards = 8 [packed = true]; if (this->cards_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _cards_cached_byte_size_, target); } for (int i = 0; i < this->cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->cards(i), target); } // repeated .UserCommonCards in_users = 9; for (int i = 0; i < this->in_users_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 9, this->in_users(i), target); } // optional int32 share_cards_len = 10; if (has_share_cards_len()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(10, this->share_cards_len(), target); } // optional int32 game_round = 11; if (has_game_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(11, this->game_round(), target); } // optional .MyOption my_option = 12; if (has_my_option()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 12, this->my_option(), target); } // optional int32 recv_card_uin = 13; if (has_recv_card_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->recv_card_uin(), target); } // optional int32 desk_remain_round = 14; if (has_desk_remain_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->desk_remain_round(), target); } // optional int32 seat_num = 15; if (has_seat_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(15, this->seat_num(), target); } // optional int32 remain_time = 16; if (has_remain_time()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(16, this->remain_time(), target); } // optional int32 apply_uin = 17; if (has_apply_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(17, this->apply_uin(), target); } // optional int32 win_type = 18; if (has_win_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(18, this->win_type(), target); } // optional .ExtraDeskTypeInfo extra_type = 19; if (has_extra_type()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 19, this->extra_type(), target); } // optional int32 type = 20; if (has_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(20, this->type(), target); } // optional int32 pre_remain_time = 21; if (has_pre_remain_time()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(21, this->pre_remain_time(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int EvtDeskUserEnter::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 deskid = 1; if (has_deskid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->deskid()); } // optional int32 op_uin = 2; if (has_op_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->op_uin()); } // optional int32 status = 3; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 max_round = 4; if (has_max_round()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->max_round()); } // optional int32 next_uin = 6; if (has_next_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->next_uin()); } // optional int32 dealer_seatid = 7; if (has_dealer_seatid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->dealer_seatid()); } } if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) { // optional int32 share_cards_len = 10; if (has_share_cards_len()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->share_cards_len()); } // optional int32 game_round = 11; if (has_game_round()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->game_round()); } // optional .MyOption my_option = 12; if (has_my_option()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->my_option()); } // optional int32 recv_card_uin = 13; if (has_recv_card_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->recv_card_uin()); } // optional int32 desk_remain_round = 14; if (has_desk_remain_round()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->desk_remain_round()); } // optional int32 seat_num = 15; if (has_seat_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->seat_num()); } // optional int32 remain_time = 16; if (has_remain_time()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->remain_time()); } } if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { // optional int32 apply_uin = 17; if (has_apply_uin()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->apply_uin()); } // optional int32 win_type = 18; if (has_win_type()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->win_type()); } // optional .ExtraDeskTypeInfo extra_type = 19; if (has_extra_type()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->extra_type()); } // optional int32 type = 20; if (has_type()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->type()); } // optional int32 pre_remain_time = 21; if (has_pre_remain_time()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->pre_remain_time()); } } // repeated .GameUserInfo users = 5; total_size += 1 * this->users_size(); for (int i = 0; i < this->users_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->users(i)); } // repeated int32 cards = 8 [packed = true]; { int data_size = 0; for (int i = 0; i < this->cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->cards(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cards_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated .UserCommonCards in_users = 9; total_size += 1 * this->in_users_size(); for (int i = 0; i < this->in_users_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->in_users(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 EvtDeskUserEnter::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const EvtDeskUserEnter* source = ::google::protobuf::internal::dynamic_cast_if_available<const EvtDeskUserEnter*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void EvtDeskUserEnter::MergeFrom(const EvtDeskUserEnter& from) { GOOGLE_CHECK_NE(&from, this); users_.MergeFrom(from.users_); cards_.MergeFrom(from.cards_); in_users_.MergeFrom(from.in_users_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_deskid()) { set_deskid(from.deskid()); } if (from.has_op_uin()) { set_op_uin(from.op_uin()); } if (from.has_status()) { set_status(from.status()); } if (from.has_max_round()) { set_max_round(from.max_round()); } if (from.has_next_uin()) { set_next_uin(from.next_uin()); } if (from.has_dealer_seatid()) { set_dealer_seatid(from.dealer_seatid()); } } if (from._has_bits_[9 / 32] & (0xffu << (9 % 32))) { if (from.has_share_cards_len()) { set_share_cards_len(from.share_cards_len()); } if (from.has_game_round()) { set_game_round(from.game_round()); } if (from.has_my_option()) { mutable_my_option()->::MyOption::MergeFrom(from.my_option()); } if (from.has_recv_card_uin()) { set_recv_card_uin(from.recv_card_uin()); } if (from.has_desk_remain_round()) { set_desk_remain_round(from.desk_remain_round()); } if (from.has_seat_num()) { set_seat_num(from.seat_num()); } if (from.has_remain_time()) { set_remain_time(from.remain_time()); } } if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { if (from.has_apply_uin()) { set_apply_uin(from.apply_uin()); } if (from.has_win_type()) { set_win_type(from.win_type()); } if (from.has_extra_type()) { mutable_extra_type()->::ExtraDeskTypeInfo::MergeFrom(from.extra_type()); } if (from.has_type()) { set_type(from.type()); } if (from.has_pre_remain_time()) { set_pre_remain_time(from.pre_remain_time()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void EvtDeskUserEnter::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void EvtDeskUserEnter::CopyFrom(const EvtDeskUserEnter& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool EvtDeskUserEnter::IsInitialized() const { return true; } void EvtDeskUserEnter::Swap(EvtDeskUserEnter* other) { if (other != this) { std::swap(deskid_, other->deskid_); std::swap(op_uin_, other->op_uin_); std::swap(status_, other->status_); std::swap(max_round_, other->max_round_); users_.Swap(&other->users_); std::swap(next_uin_, other->next_uin_); std::swap(dealer_seatid_, other->dealer_seatid_); cards_.Swap(&other->cards_); in_users_.Swap(&other->in_users_); std::swap(share_cards_len_, other->share_cards_len_); std::swap(game_round_, other->game_round_); std::swap(my_option_, other->my_option_); std::swap(recv_card_uin_, other->recv_card_uin_); std::swap(desk_remain_round_, other->desk_remain_round_); std::swap(seat_num_, other->seat_num_); std::swap(remain_time_, other->remain_time_); std::swap(apply_uin_, other->apply_uin_); std::swap(win_type_, other->win_type_); std::swap(extra_type_, other->extra_type_); std::swap(type_, other->type_); std::swap(pre_remain_time_, other->pre_remain_time_); 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 EvtDeskUserEnter::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = EvtDeskUserEnter_descriptor_; metadata.reflection = EvtDeskUserEnter_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER GameExitDeskReq::GameExitDeskReq() : ::google::protobuf::Message() { SharedCtor(); } void GameExitDeskReq::InitAsDefaultInstance() { } GameExitDeskReq::GameExitDeskReq(const GameExitDeskReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameExitDeskReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameExitDeskReq::~GameExitDeskReq() { SharedDtor(); } void GameExitDeskReq::SharedDtor() { if (this != default_instance_) { } } void GameExitDeskReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameExitDeskReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameExitDeskReq_descriptor_; } const GameExitDeskReq& GameExitDeskReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameExitDeskReq* GameExitDeskReq::default_instance_ = NULL; GameExitDeskReq* GameExitDeskReq::New() const { return new GameExitDeskReq; } void GameExitDeskReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameExitDeskReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void GameExitDeskReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameExitDeskReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameExitDeskReq::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 GameExitDeskReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameExitDeskReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameExitDeskReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameExitDeskReq::MergeFrom(const GameExitDeskReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameExitDeskReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameExitDeskReq::CopyFrom(const GameExitDeskReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameExitDeskReq::IsInitialized() const { return true; } void GameExitDeskReq::Swap(GameExitDeskReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata GameExitDeskReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameExitDeskReq_descriptor_; metadata.reflection = GameExitDeskReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameExitDeskRsp::kRetFieldNumber; #endif // !_MSC_VER GameExitDeskRsp::GameExitDeskRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameExitDeskRsp::InitAsDefaultInstance() { } GameExitDeskRsp::GameExitDeskRsp(const GameExitDeskRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameExitDeskRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameExitDeskRsp::~GameExitDeskRsp() { SharedDtor(); } void GameExitDeskRsp::SharedDtor() { if (this != default_instance_) { } } void GameExitDeskRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameExitDeskRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameExitDeskRsp_descriptor_; } const GameExitDeskRsp& GameExitDeskRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameExitDeskRsp* GameExitDeskRsp::default_instance_ = NULL; GameExitDeskRsp* GameExitDeskRsp::New() const { return new GameExitDeskRsp; } void GameExitDeskRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameExitDeskRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameExitDeskRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameExitDeskRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameExitDeskRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameExitDeskRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameExitDeskRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameExitDeskRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameExitDeskRsp::MergeFrom(const GameExitDeskRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameExitDeskRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameExitDeskRsp::CopyFrom(const GameExitDeskRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameExitDeskRsp::IsInitialized() const { return true; } void GameExitDeskRsp::Swap(GameExitDeskRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameExitDeskRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameExitDeskRsp_descriptor_; metadata.reflection = GameExitDeskRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int DeskPlayInfo::kCardsFieldNumber; const int DeskPlayInfo::kCardLenFieldNumber; const int DeskPlayInfo::kOutCardsFieldNumber; const int DeskPlayInfo::kOutCardLenFieldNumber; const int DeskPlayInfo::kDiscardsFieldNumber; const int DeskPlayInfo::kStatusFieldNumber; const int DeskPlayInfo::kChipsFieldNumber; const int DeskPlayInfo::kRoundWinChipsFieldNumber; const int DeskPlayInfo::kTotalChiNumFieldNumber; const int DeskPlayInfo::kTotalPengNumFieldNumber; const int DeskPlayInfo::kTotalGangNumFieldNumber; const int DeskPlayInfo::kTotalGangedNumFieldNumber; const int DeskPlayInfo::kTotalHuNumFieldNumber; const int DeskPlayInfo::kTotalHuedNumFieldNumber; const int DeskPlayInfo::kRoundChiNumFieldNumber; const int DeskPlayInfo::kRoundPengNumFieldNumber; const int DeskPlayInfo::kRoundGangNumFieldNumber; const int DeskPlayInfo::kRoundGangedNumFieldNumber; const int DeskPlayInfo::kRoleFieldNumber; #endif // !_MSC_VER DeskPlayInfo::DeskPlayInfo() : ::google::protobuf::Message() { SharedCtor(); } void DeskPlayInfo::InitAsDefaultInstance() { } DeskPlayInfo::DeskPlayInfo(const DeskPlayInfo& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void DeskPlayInfo::SharedCtor() { _cached_size_ = 0; card_len_ = 0; out_card_len_ = 0; status_ = 0; chips_ = 0; round_win_chips_ = 0; total_chi_num_ = 0; total_peng_num_ = 0; total_gang_num_ = 0; total_ganged_num_ = 0; total_hu_num_ = 0; total_hued_num_ = 0; round_chi_num_ = 0; round_peng_num_ = 0; round_gang_num_ = 0; round_ganged_num_ = 0; role_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } DeskPlayInfo::~DeskPlayInfo() { SharedDtor(); } void DeskPlayInfo::SharedDtor() { if (this != default_instance_) { } } void DeskPlayInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* DeskPlayInfo::descriptor() { protobuf_AssignDescriptorsOnce(); return DeskPlayInfo_descriptor_; } const DeskPlayInfo& DeskPlayInfo::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } DeskPlayInfo* DeskPlayInfo::default_instance_ = NULL; DeskPlayInfo* DeskPlayInfo::New() const { return new DeskPlayInfo; } void DeskPlayInfo::Clear() { if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { card_len_ = 0; out_card_len_ = 0; status_ = 0; chips_ = 0; round_win_chips_ = 0; } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { total_chi_num_ = 0; total_peng_num_ = 0; total_gang_num_ = 0; total_ganged_num_ = 0; total_hu_num_ = 0; total_hued_num_ = 0; round_chi_num_ = 0; round_peng_num_ = 0; } if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { round_gang_num_ = 0; round_ganged_num_ = 0; role_ = 0; } cards_.Clear(); out_cards_.Clear(); discards_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool DeskPlayInfo::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated int32 cards = 1 [packed = true]; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 10, input, this->mutable_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_card_len; break; } // optional int32 card_len = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_card_len: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &card_len_))); set_has_card_len(); } else { goto handle_uninterpreted; } if (input->ExpectTag(26)) goto parse_out_cards; break; } // repeated int32 out_cards = 3 [packed = true]; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_out_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_out_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 26, input, this->mutable_out_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_out_card_len; break; } // optional int32 out_card_len = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_out_card_len: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &out_card_len_))); set_has_out_card_len(); } else { goto handle_uninterpreted; } if (input->ExpectTag(42)) goto parse_discards; break; } // repeated int32 discards = 5 [packed = true]; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_discards: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_discards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 42, input, this->mutable_discards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_status; break; } // optional int32 status = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_chips; break; } // optional int32 chips = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_chips: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &chips_))); set_has_chips(); } else { goto handle_uninterpreted; } if (input->ExpectTag(64)) goto parse_round_win_chips; break; } // optional int32 round_win_chips = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_win_chips: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_win_chips_))); set_has_round_win_chips(); } else { goto handle_uninterpreted; } if (input->ExpectTag(72)) goto parse_total_chi_num; break; } // optional int32 total_chi_num = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_chi_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_chi_num_))); set_has_total_chi_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(80)) goto parse_total_peng_num; break; } // optional int32 total_peng_num = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_peng_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_peng_num_))); set_has_total_peng_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(88)) goto parse_total_gang_num; break; } // optional int32 total_gang_num = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_gang_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_gang_num_))); set_has_total_gang_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(96)) goto parse_total_ganged_num; break; } // optional int32 total_ganged_num = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_ganged_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_ganged_num_))); set_has_total_ganged_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(104)) goto parse_total_hu_num; break; } // optional int32 total_hu_num = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_hu_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_hu_num_))); set_has_total_hu_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(112)) goto parse_total_hued_num; break; } // optional int32 total_hued_num = 14; case 14: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_hued_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_hued_num_))); set_has_total_hued_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(120)) goto parse_round_chi_num; break; } // optional int32 round_chi_num = 15; case 15: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_chi_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_chi_num_))); set_has_round_chi_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(128)) goto parse_round_peng_num; break; } // optional int32 round_peng_num = 16; case 16: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_peng_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_peng_num_))); set_has_round_peng_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(136)) goto parse_round_gang_num; break; } // optional int32 round_gang_num = 17; case 17: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_gang_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_gang_num_))); set_has_round_gang_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(144)) goto parse_round_ganged_num; break; } // optional int32 round_ganged_num = 18; case 18: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_ganged_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_ganged_num_))); set_has_round_ganged_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(152)) goto parse_role; break; } // optional int32 role = 19; case 19: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_role: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &role_))); set_has_role(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void DeskPlayInfo::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // repeated int32 cards = 1 [packed = true]; if (this->cards_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_cards_cached_byte_size_); } for (int i = 0; i < this->cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->cards(i), output); } // optional int32 card_len = 2; if (has_card_len()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->card_len(), output); } // repeated int32 out_cards = 3 [packed = true]; if (this->out_cards_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_out_cards_cached_byte_size_); } for (int i = 0; i < this->out_cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->out_cards(i), output); } // optional int32 out_card_len = 4; if (has_out_card_len()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->out_card_len(), output); } // repeated int32 discards = 5 [packed = true]; if (this->discards_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_discards_cached_byte_size_); } for (int i = 0; i < this->discards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->discards(i), output); } // optional int32 status = 6; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->status(), output); } // optional int32 chips = 7; if (has_chips()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->chips(), output); } // optional int32 round_win_chips = 8; if (has_round_win_chips()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->round_win_chips(), output); } // optional int32 total_chi_num = 9; if (has_total_chi_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->total_chi_num(), output); } // optional int32 total_peng_num = 10; if (has_total_peng_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(10, this->total_peng_num(), output); } // optional int32 total_gang_num = 11; if (has_total_gang_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(11, this->total_gang_num(), output); } // optional int32 total_ganged_num = 12; if (has_total_ganged_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->total_ganged_num(), output); } // optional int32 total_hu_num = 13; if (has_total_hu_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->total_hu_num(), output); } // optional int32 total_hued_num = 14; if (has_total_hued_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->total_hued_num(), output); } // optional int32 round_chi_num = 15; if (has_round_chi_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(15, this->round_chi_num(), output); } // optional int32 round_peng_num = 16; if (has_round_peng_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->round_peng_num(), output); } // optional int32 round_gang_num = 17; if (has_round_gang_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->round_gang_num(), output); } // optional int32 round_ganged_num = 18; if (has_round_ganged_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->round_ganged_num(), output); } // optional int32 role = 19; if (has_role()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(19, this->role(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* DeskPlayInfo::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // repeated int32 cards = 1 [packed = true]; if (this->cards_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _cards_cached_byte_size_, target); } for (int i = 0; i < this->cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->cards(i), target); } // optional int32 card_len = 2; if (has_card_len()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->card_len(), target); } // repeated int32 out_cards = 3 [packed = true]; if (this->out_cards_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _out_cards_cached_byte_size_, target); } for (int i = 0; i < this->out_cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->out_cards(i), target); } // optional int32 out_card_len = 4; if (has_out_card_len()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->out_card_len(), target); } // repeated int32 discards = 5 [packed = true]; if (this->discards_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _discards_cached_byte_size_, target); } for (int i = 0; i < this->discards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->discards(i), target); } // optional int32 status = 6; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->status(), target); } // optional int32 chips = 7; if (has_chips()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->chips(), target); } // optional int32 round_win_chips = 8; if (has_round_win_chips()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->round_win_chips(), target); } // optional int32 total_chi_num = 9; if (has_total_chi_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->total_chi_num(), target); } // optional int32 total_peng_num = 10; if (has_total_peng_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(10, this->total_peng_num(), target); } // optional int32 total_gang_num = 11; if (has_total_gang_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(11, this->total_gang_num(), target); } // optional int32 total_ganged_num = 12; if (has_total_ganged_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->total_ganged_num(), target); } // optional int32 total_hu_num = 13; if (has_total_hu_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->total_hu_num(), target); } // optional int32 total_hued_num = 14; if (has_total_hued_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->total_hued_num(), target); } // optional int32 round_chi_num = 15; if (has_round_chi_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(15, this->round_chi_num(), target); } // optional int32 round_peng_num = 16; if (has_round_peng_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(16, this->round_peng_num(), target); } // optional int32 round_gang_num = 17; if (has_round_gang_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(17, this->round_gang_num(), target); } // optional int32 round_ganged_num = 18; if (has_round_ganged_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(18, this->round_ganged_num(), target); } // optional int32 role = 19; if (has_role()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(19, this->role(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int DeskPlayInfo::ByteSize() const { int total_size = 0; if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { // optional int32 card_len = 2; if (has_card_len()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->card_len()); } // optional int32 out_card_len = 4; if (has_out_card_len()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->out_card_len()); } // optional int32 status = 6; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 chips = 7; if (has_chips()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->chips()); } // optional int32 round_win_chips = 8; if (has_round_win_chips()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_win_chips()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional int32 total_chi_num = 9; if (has_total_chi_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_chi_num()); } // optional int32 total_peng_num = 10; if (has_total_peng_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_peng_num()); } // optional int32 total_gang_num = 11; if (has_total_gang_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_gang_num()); } // optional int32 total_ganged_num = 12; if (has_total_ganged_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_ganged_num()); } // optional int32 total_hu_num = 13; if (has_total_hu_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_hu_num()); } // optional int32 total_hued_num = 14; if (has_total_hued_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_hued_num()); } // optional int32 round_chi_num = 15; if (has_round_chi_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_chi_num()); } // optional int32 round_peng_num = 16; if (has_round_peng_num()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_peng_num()); } } if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { // optional int32 round_gang_num = 17; if (has_round_gang_num()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_gang_num()); } // optional int32 round_ganged_num = 18; if (has_round_ganged_num()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_ganged_num()); } // optional int32 role = 19; if (has_role()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->role()); } } // repeated int32 cards = 1 [packed = true]; { int data_size = 0; for (int i = 0; i < this->cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->cards(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cards_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated int32 out_cards = 3 [packed = true]; { int data_size = 0; for (int i = 0; i < this->out_cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->out_cards(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _out_cards_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated int32 discards = 5 [packed = true]; { int data_size = 0; for (int i = 0; i < this->discards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->discards(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _discards_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 DeskPlayInfo::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const DeskPlayInfo* source = ::google::protobuf::internal::dynamic_cast_if_available<const DeskPlayInfo*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void DeskPlayInfo::MergeFrom(const DeskPlayInfo& from) { GOOGLE_CHECK_NE(&from, this); cards_.MergeFrom(from.cards_); out_cards_.MergeFrom(from.out_cards_); discards_.MergeFrom(from.discards_); if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { if (from.has_card_len()) { set_card_len(from.card_len()); } if (from.has_out_card_len()) { set_out_card_len(from.out_card_len()); } if (from.has_status()) { set_status(from.status()); } if (from.has_chips()) { set_chips(from.chips()); } if (from.has_round_win_chips()) { set_round_win_chips(from.round_win_chips()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_total_chi_num()) { set_total_chi_num(from.total_chi_num()); } if (from.has_total_peng_num()) { set_total_peng_num(from.total_peng_num()); } if (from.has_total_gang_num()) { set_total_gang_num(from.total_gang_num()); } if (from.has_total_ganged_num()) { set_total_ganged_num(from.total_ganged_num()); } if (from.has_total_hu_num()) { set_total_hu_num(from.total_hu_num()); } if (from.has_total_hued_num()) { set_total_hued_num(from.total_hued_num()); } if (from.has_round_chi_num()) { set_round_chi_num(from.round_chi_num()); } if (from.has_round_peng_num()) { set_round_peng_num(from.round_peng_num()); } } if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { if (from.has_round_gang_num()) { set_round_gang_num(from.round_gang_num()); } if (from.has_round_ganged_num()) { set_round_ganged_num(from.round_ganged_num()); } if (from.has_role()) { set_role(from.role()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void DeskPlayInfo::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void DeskPlayInfo::CopyFrom(const DeskPlayInfo& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool DeskPlayInfo::IsInitialized() const { return true; } void DeskPlayInfo::Swap(DeskPlayInfo* other) { if (other != this) { cards_.Swap(&other->cards_); std::swap(card_len_, other->card_len_); out_cards_.Swap(&other->out_cards_); std::swap(out_card_len_, other->out_card_len_); discards_.Swap(&other->discards_); std::swap(status_, other->status_); std::swap(chips_, other->chips_); std::swap(round_win_chips_, other->round_win_chips_); std::swap(total_chi_num_, other->total_chi_num_); std::swap(total_peng_num_, other->total_peng_num_); std::swap(total_gang_num_, other->total_gang_num_); std::swap(total_ganged_num_, other->total_ganged_num_); std::swap(total_hu_num_, other->total_hu_num_); std::swap(total_hued_num_, other->total_hued_num_); std::swap(round_chi_num_, other->round_chi_num_); std::swap(round_peng_num_, other->round_peng_num_); std::swap(round_gang_num_, other->round_gang_num_); std::swap(round_ganged_num_, other->round_ganged_num_); std::swap(role_, other->role_); 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 DeskPlayInfo::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = DeskPlayInfo_descriptor_; metadata.reflection = DeskPlayInfo_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int EvtUserExit::kDeskidFieldNumber; const int EvtUserExit::kDealerFieldNumber; const int EvtUserExit::kOpUinFieldNumber; const int EvtUserExit::kOpStatusFieldNumber; const int EvtUserExit::kNextUinFieldNumber; const int EvtUserExit::kPlayInfoFieldNumber; const int EvtUserExit::kPlayerOpPastTimeFieldNumber; const int EvtUserExit::kDealerSeatidFieldNumber; const int EvtUserExit::kReasonFieldNumber; #endif // !_MSC_VER EvtUserExit::EvtUserExit() : ::google::protobuf::Message() { SharedCtor(); } void EvtUserExit::InitAsDefaultInstance() { play_info_ = const_cast< ::DeskPlayInfo*>(&::DeskPlayInfo::default_instance()); } EvtUserExit::EvtUserExit(const EvtUserExit& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void EvtUserExit::SharedCtor() { _cached_size_ = 0; deskid_ = 0; dealer_ = 0; op_uin_ = 0; op_status_ = 0; next_uin_ = 0; play_info_ = NULL; player_op_past_time_ = GOOGLE_LONGLONG(0); dealer_seatid_ = 0; reason_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } EvtUserExit::~EvtUserExit() { SharedDtor(); } void EvtUserExit::SharedDtor() { if (this != default_instance_) { delete play_info_; } } void EvtUserExit::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EvtUserExit::descriptor() { protobuf_AssignDescriptorsOnce(); return EvtUserExit_descriptor_; } const EvtUserExit& EvtUserExit::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } EvtUserExit* EvtUserExit::default_instance_ = NULL; EvtUserExit* EvtUserExit::New() const { return new EvtUserExit; } void EvtUserExit::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { deskid_ = 0; dealer_ = 0; op_uin_ = 0; op_status_ = 0; next_uin_ = 0; if (has_play_info()) { if (play_info_ != NULL) play_info_->::DeskPlayInfo::Clear(); } player_op_past_time_ = GOOGLE_LONGLONG(0); dealer_seatid_ = 0; } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { reason_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool EvtUserExit::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 deskid = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &deskid_))); set_has_deskid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_dealer; break; } // optional int32 dealer = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_dealer: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &dealer_))); set_has_dealer(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_op_uin; break; } // optional int32 op_uin = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &op_uin_))); set_has_op_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_op_status; break; } // optional int32 op_status = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &op_status_))); set_has_op_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_next_uin; break; } // optional int32 next_uin = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_next_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &next_uin_))); set_has_next_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(50)) goto parse_play_info; break; } // optional .DeskPlayInfo play_info = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_play_info: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_play_info())); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_player_op_past_time; break; } // optional int64 player_op_past_time = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_player_op_past_time: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &player_op_past_time_))); set_has_player_op_past_time(); } else { goto handle_uninterpreted; } if (input->ExpectTag(64)) goto parse_dealer_seatid; break; } // optional int32 dealer_seatid = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_dealer_seatid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &dealer_seatid_))); set_has_dealer_seatid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(72)) goto parse_reason; break; } // optional int32 reason = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_reason: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &reason_))); set_has_reason(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void EvtUserExit::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 deskid = 1; if (has_deskid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->deskid(), output); } // optional int32 dealer = 2; if (has_dealer()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->dealer(), output); } // optional int32 op_uin = 3; if (has_op_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->op_uin(), output); } // optional int32 op_status = 4; if (has_op_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->op_status(), output); } // optional int32 next_uin = 5; if (has_next_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->next_uin(), output); } // optional .DeskPlayInfo play_info = 6; if (has_play_info()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 6, this->play_info(), output); } // optional int64 player_op_past_time = 7; if (has_player_op_past_time()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(7, this->player_op_past_time(), output); } // optional int32 dealer_seatid = 8; if (has_dealer_seatid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->dealer_seatid(), output); } // optional int32 reason = 9; if (has_reason()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->reason(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* EvtUserExit::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 deskid = 1; if (has_deskid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->deskid(), target); } // optional int32 dealer = 2; if (has_dealer()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->dealer(), target); } // optional int32 op_uin = 3; if (has_op_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->op_uin(), target); } // optional int32 op_status = 4; if (has_op_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->op_status(), target); } // optional int32 next_uin = 5; if (has_next_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->next_uin(), target); } // optional .DeskPlayInfo play_info = 6; if (has_play_info()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 6, this->play_info(), target); } // optional int64 player_op_past_time = 7; if (has_player_op_past_time()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(7, this->player_op_past_time(), target); } // optional int32 dealer_seatid = 8; if (has_dealer_seatid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->dealer_seatid(), target); } // optional int32 reason = 9; if (has_reason()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->reason(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int EvtUserExit::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 deskid = 1; if (has_deskid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->deskid()); } // optional int32 dealer = 2; if (has_dealer()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->dealer()); } // optional int32 op_uin = 3; if (has_op_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->op_uin()); } // optional int32 op_status = 4; if (has_op_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->op_status()); } // optional int32 next_uin = 5; if (has_next_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->next_uin()); } // optional .DeskPlayInfo play_info = 6; if (has_play_info()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->play_info()); } // optional int64 player_op_past_time = 7; if (has_player_op_past_time()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( this->player_op_past_time()); } // optional int32 dealer_seatid = 8; if (has_dealer_seatid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->dealer_seatid()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional int32 reason = 9; if (has_reason()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->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 EvtUserExit::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const EvtUserExit* source = ::google::protobuf::internal::dynamic_cast_if_available<const EvtUserExit*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void EvtUserExit::MergeFrom(const EvtUserExit& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_deskid()) { set_deskid(from.deskid()); } if (from.has_dealer()) { set_dealer(from.dealer()); } if (from.has_op_uin()) { set_op_uin(from.op_uin()); } if (from.has_op_status()) { set_op_status(from.op_status()); } if (from.has_next_uin()) { set_next_uin(from.next_uin()); } if (from.has_play_info()) { mutable_play_info()->::DeskPlayInfo::MergeFrom(from.play_info()); } if (from.has_player_op_past_time()) { set_player_op_past_time(from.player_op_past_time()); } if (from.has_dealer_seatid()) { set_dealer_seatid(from.dealer_seatid()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_reason()) { set_reason(from.reason()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void EvtUserExit::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void EvtUserExit::CopyFrom(const EvtUserExit& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool EvtUserExit::IsInitialized() const { return true; } void EvtUserExit::Swap(EvtUserExit* other) { if (other != this) { std::swap(deskid_, other->deskid_); std::swap(dealer_, other->dealer_); std::swap(op_uin_, other->op_uin_); std::swap(op_status_, other->op_status_); std::swap(next_uin_, other->next_uin_); std::swap(play_info_, other->play_info_); std::swap(player_op_past_time_, other->player_op_past_time_); std::swap(dealer_seatid_, other->dealer_seatid_); std::swap(reason_, other->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 EvtUserExit::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = EvtUserExit_descriptor_; metadata.reflection = EvtUserExit_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER ClientNotifyStartGameReq::ClientNotifyStartGameReq() : ::google::protobuf::Message() { SharedCtor(); } void ClientNotifyStartGameReq::InitAsDefaultInstance() { } ClientNotifyStartGameReq::ClientNotifyStartGameReq(const ClientNotifyStartGameReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void ClientNotifyStartGameReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } ClientNotifyStartGameReq::~ClientNotifyStartGameReq() { SharedDtor(); } void ClientNotifyStartGameReq::SharedDtor() { if (this != default_instance_) { } } void ClientNotifyStartGameReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ClientNotifyStartGameReq::descriptor() { protobuf_AssignDescriptorsOnce(); return ClientNotifyStartGameReq_descriptor_; } const ClientNotifyStartGameReq& ClientNotifyStartGameReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } ClientNotifyStartGameReq* ClientNotifyStartGameReq::default_instance_ = NULL; ClientNotifyStartGameReq* ClientNotifyStartGameReq::New() const { return new ClientNotifyStartGameReq; } void ClientNotifyStartGameReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool ClientNotifyStartGameReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void ClientNotifyStartGameReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* ClientNotifyStartGameReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int ClientNotifyStartGameReq::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 ClientNotifyStartGameReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const ClientNotifyStartGameReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const ClientNotifyStartGameReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void ClientNotifyStartGameReq::MergeFrom(const ClientNotifyStartGameReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void ClientNotifyStartGameReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void ClientNotifyStartGameReq::CopyFrom(const ClientNotifyStartGameReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool ClientNotifyStartGameReq::IsInitialized() const { return true; } void ClientNotifyStartGameReq::Swap(ClientNotifyStartGameReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata ClientNotifyStartGameReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = ClientNotifyStartGameReq_descriptor_; metadata.reflection = ClientNotifyStartGameReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int ClientNotifyStartGameRsp::kRetFieldNumber; #endif // !_MSC_VER ClientNotifyStartGameRsp::ClientNotifyStartGameRsp() : ::google::protobuf::Message() { SharedCtor(); } void ClientNotifyStartGameRsp::InitAsDefaultInstance() { } ClientNotifyStartGameRsp::ClientNotifyStartGameRsp(const ClientNotifyStartGameRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void ClientNotifyStartGameRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } ClientNotifyStartGameRsp::~ClientNotifyStartGameRsp() { SharedDtor(); } void ClientNotifyStartGameRsp::SharedDtor() { if (this != default_instance_) { } } void ClientNotifyStartGameRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ClientNotifyStartGameRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return ClientNotifyStartGameRsp_descriptor_; } const ClientNotifyStartGameRsp& ClientNotifyStartGameRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } ClientNotifyStartGameRsp* ClientNotifyStartGameRsp::default_instance_ = NULL; ClientNotifyStartGameRsp* ClientNotifyStartGameRsp::New() const { return new ClientNotifyStartGameRsp; } void ClientNotifyStartGameRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool ClientNotifyStartGameRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void ClientNotifyStartGameRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* ClientNotifyStartGameRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int ClientNotifyStartGameRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 ClientNotifyStartGameRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const ClientNotifyStartGameRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const ClientNotifyStartGameRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void ClientNotifyStartGameRsp::MergeFrom(const ClientNotifyStartGameRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void ClientNotifyStartGameRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void ClientNotifyStartGameRsp::CopyFrom(const ClientNotifyStartGameRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool ClientNotifyStartGameRsp::IsInitialized() const { return true; } void ClientNotifyStartGameRsp::Swap(ClientNotifyStartGameRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 ClientNotifyStartGameRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = ClientNotifyStartGameRsp_descriptor_; metadata.reflection = ClientNotifyStartGameRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameSendCardReq::kCardFieldNumber; #endif // !_MSC_VER GameSendCardReq::GameSendCardReq() : ::google::protobuf::Message() { SharedCtor(); } void GameSendCardReq::InitAsDefaultInstance() { } GameSendCardReq::GameSendCardReq(const GameSendCardReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameSendCardReq::SharedCtor() { _cached_size_ = 0; card_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameSendCardReq::~GameSendCardReq() { SharedDtor(); } void GameSendCardReq::SharedDtor() { if (this != default_instance_) { } } void GameSendCardReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameSendCardReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameSendCardReq_descriptor_; } const GameSendCardReq& GameSendCardReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameSendCardReq* GameSendCardReq::default_instance_ = NULL; GameSendCardReq* GameSendCardReq::New() const { return new GameSendCardReq; } void GameSendCardReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { card_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameSendCardReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 card = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &card_))); set_has_card(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameSendCardReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 card = 1; if (has_card()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->card(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameSendCardReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 card = 1; if (has_card()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->card(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameSendCardReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 card = 1; if (has_card()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->card()); } } 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 GameSendCardReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameSendCardReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameSendCardReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameSendCardReq::MergeFrom(const GameSendCardReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_card()) { set_card(from.card()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameSendCardReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameSendCardReq::CopyFrom(const GameSendCardReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameSendCardReq::IsInitialized() const { return true; } void GameSendCardReq::Swap(GameSendCardReq* other) { if (other != this) { std::swap(card_, other->card_); 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 GameSendCardReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameSendCardReq_descriptor_; metadata.reflection = GameSendCardReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameSendCardRsp::kRetFieldNumber; #endif // !_MSC_VER GameSendCardRsp::GameSendCardRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameSendCardRsp::InitAsDefaultInstance() { } GameSendCardRsp::GameSendCardRsp(const GameSendCardRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameSendCardRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameSendCardRsp::~GameSendCardRsp() { SharedDtor(); } void GameSendCardRsp::SharedDtor() { if (this != default_instance_) { } } void GameSendCardRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameSendCardRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameSendCardRsp_descriptor_; } const GameSendCardRsp& GameSendCardRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameSendCardRsp* GameSendCardRsp::default_instance_ = NULL; GameSendCardRsp* GameSendCardRsp::New() const { return new GameSendCardRsp; } void GameSendCardRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameSendCardRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameSendCardRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameSendCardRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameSendCardRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameSendCardRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameSendCardRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameSendCardRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameSendCardRsp::MergeFrom(const GameSendCardRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameSendCardRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameSendCardRsp::CopyFrom(const GameSendCardRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameSendCardRsp::IsInitialized() const { return true; } void GameSendCardRsp::Swap(GameSendCardRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameSendCardRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameSendCardRsp_descriptor_; metadata.reflection = GameSendCardRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOptionChiReq::kIndexFieldNumber; #endif // !_MSC_VER GameOptionChiReq::GameOptionChiReq() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionChiReq::InitAsDefaultInstance() { } GameOptionChiReq::GameOptionChiReq(const GameOptionChiReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionChiReq::SharedCtor() { _cached_size_ = 0; index_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionChiReq::~GameOptionChiReq() { SharedDtor(); } void GameOptionChiReq::SharedDtor() { if (this != default_instance_) { } } void GameOptionChiReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionChiReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionChiReq_descriptor_; } const GameOptionChiReq& GameOptionChiReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionChiReq* GameOptionChiReq::default_instance_ = NULL; GameOptionChiReq* GameOptionChiReq::New() const { return new GameOptionChiReq; } void GameOptionChiReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { index_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionChiReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 index = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &index_))); set_has_index(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOptionChiReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 index = 1; if (has_index()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->index(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionChiReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 index = 1; if (has_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->index(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionChiReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 index = 1; if (has_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->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 GameOptionChiReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionChiReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionChiReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionChiReq::MergeFrom(const GameOptionChiReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_index()) { set_index(from.index()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionChiReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionChiReq::CopyFrom(const GameOptionChiReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionChiReq::IsInitialized() const { return true; } void GameOptionChiReq::Swap(GameOptionChiReq* other) { if (other != this) { std::swap(index_, other->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 GameOptionChiReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionChiReq_descriptor_; metadata.reflection = GameOptionChiReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOptionChiRsp::kRetFieldNumber; #endif // !_MSC_VER GameOptionChiRsp::GameOptionChiRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionChiRsp::InitAsDefaultInstance() { } GameOptionChiRsp::GameOptionChiRsp(const GameOptionChiRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionChiRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionChiRsp::~GameOptionChiRsp() { SharedDtor(); } void GameOptionChiRsp::SharedDtor() { if (this != default_instance_) { } } void GameOptionChiRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionChiRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionChiRsp_descriptor_; } const GameOptionChiRsp& GameOptionChiRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionChiRsp* GameOptionChiRsp::default_instance_ = NULL; GameOptionChiRsp* GameOptionChiRsp::New() const { return new GameOptionChiRsp; } void GameOptionChiRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionChiRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOptionChiRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionChiRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionChiRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameOptionChiRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionChiRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionChiRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionChiRsp::MergeFrom(const GameOptionChiRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionChiRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionChiRsp::CopyFrom(const GameOptionChiRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionChiRsp::IsInitialized() const { return true; } void GameOptionChiRsp::Swap(GameOptionChiRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameOptionChiRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionChiRsp_descriptor_; metadata.reflection = GameOptionChiRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER GameOptionPengReq::GameOptionPengReq() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionPengReq::InitAsDefaultInstance() { } GameOptionPengReq::GameOptionPengReq(const GameOptionPengReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionPengReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionPengReq::~GameOptionPengReq() { SharedDtor(); } void GameOptionPengReq::SharedDtor() { if (this != default_instance_) { } } void GameOptionPengReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionPengReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionPengReq_descriptor_; } const GameOptionPengReq& GameOptionPengReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionPengReq* GameOptionPengReq::default_instance_ = NULL; GameOptionPengReq* GameOptionPengReq::New() const { return new GameOptionPengReq; } void GameOptionPengReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionPengReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void GameOptionPengReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionPengReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionPengReq::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 GameOptionPengReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionPengReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionPengReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionPengReq::MergeFrom(const GameOptionPengReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionPengReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionPengReq::CopyFrom(const GameOptionPengReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionPengReq::IsInitialized() const { return true; } void GameOptionPengReq::Swap(GameOptionPengReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata GameOptionPengReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionPengReq_descriptor_; metadata.reflection = GameOptionPengReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOptionPengRsp::kRetFieldNumber; #endif // !_MSC_VER GameOptionPengRsp::GameOptionPengRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionPengRsp::InitAsDefaultInstance() { } GameOptionPengRsp::GameOptionPengRsp(const GameOptionPengRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionPengRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionPengRsp::~GameOptionPengRsp() { SharedDtor(); } void GameOptionPengRsp::SharedDtor() { if (this != default_instance_) { } } void GameOptionPengRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionPengRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionPengRsp_descriptor_; } const GameOptionPengRsp& GameOptionPengRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionPengRsp* GameOptionPengRsp::default_instance_ = NULL; GameOptionPengRsp* GameOptionPengRsp::New() const { return new GameOptionPengRsp; } void GameOptionPengRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionPengRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOptionPengRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionPengRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionPengRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameOptionPengRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionPengRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionPengRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionPengRsp::MergeFrom(const GameOptionPengRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionPengRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionPengRsp::CopyFrom(const GameOptionPengRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionPengRsp::IsInitialized() const { return true; } void GameOptionPengRsp::Swap(GameOptionPengRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameOptionPengRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionPengRsp_descriptor_; metadata.reflection = GameOptionPengRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER GameOptionGangReq::GameOptionGangReq() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionGangReq::InitAsDefaultInstance() { } GameOptionGangReq::GameOptionGangReq(const GameOptionGangReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionGangReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionGangReq::~GameOptionGangReq() { SharedDtor(); } void GameOptionGangReq::SharedDtor() { if (this != default_instance_) { } } void GameOptionGangReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionGangReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionGangReq_descriptor_; } const GameOptionGangReq& GameOptionGangReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionGangReq* GameOptionGangReq::default_instance_ = NULL; GameOptionGangReq* GameOptionGangReq::New() const { return new GameOptionGangReq; } void GameOptionGangReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionGangReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void GameOptionGangReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionGangReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionGangReq::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 GameOptionGangReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionGangReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionGangReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionGangReq::MergeFrom(const GameOptionGangReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionGangReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionGangReq::CopyFrom(const GameOptionGangReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionGangReq::IsInitialized() const { return true; } void GameOptionGangReq::Swap(GameOptionGangReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata GameOptionGangReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionGangReq_descriptor_; metadata.reflection = GameOptionGangReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOptionGangRsp::kRetFieldNumber; #endif // !_MSC_VER GameOptionGangRsp::GameOptionGangRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionGangRsp::InitAsDefaultInstance() { } GameOptionGangRsp::GameOptionGangRsp(const GameOptionGangRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionGangRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionGangRsp::~GameOptionGangRsp() { SharedDtor(); } void GameOptionGangRsp::SharedDtor() { if (this != default_instance_) { } } void GameOptionGangRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionGangRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionGangRsp_descriptor_; } const GameOptionGangRsp& GameOptionGangRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionGangRsp* GameOptionGangRsp::default_instance_ = NULL; GameOptionGangRsp* GameOptionGangRsp::New() const { return new GameOptionGangRsp; } void GameOptionGangRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionGangRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOptionGangRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionGangRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionGangRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameOptionGangRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionGangRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionGangRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionGangRsp::MergeFrom(const GameOptionGangRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionGangRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionGangRsp::CopyFrom(const GameOptionGangRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionGangRsp::IsInitialized() const { return true; } void GameOptionGangRsp::Swap(GameOptionGangRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameOptionGangRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionGangRsp_descriptor_; metadata.reflection = GameOptionGangRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER GameOptionHuReq::GameOptionHuReq() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionHuReq::InitAsDefaultInstance() { } GameOptionHuReq::GameOptionHuReq(const GameOptionHuReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionHuReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionHuReq::~GameOptionHuReq() { SharedDtor(); } void GameOptionHuReq::SharedDtor() { if (this != default_instance_) { } } void GameOptionHuReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionHuReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionHuReq_descriptor_; } const GameOptionHuReq& GameOptionHuReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionHuReq* GameOptionHuReq::default_instance_ = NULL; GameOptionHuReq* GameOptionHuReq::New() const { return new GameOptionHuReq; } void GameOptionHuReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionHuReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void GameOptionHuReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionHuReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionHuReq::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 GameOptionHuReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionHuReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionHuReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionHuReq::MergeFrom(const GameOptionHuReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionHuReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionHuReq::CopyFrom(const GameOptionHuReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionHuReq::IsInitialized() const { return true; } void GameOptionHuReq::Swap(GameOptionHuReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata GameOptionHuReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionHuReq_descriptor_; metadata.reflection = GameOptionHuReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOptionHuRsp::kRetFieldNumber; #endif // !_MSC_VER GameOptionHuRsp::GameOptionHuRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionHuRsp::InitAsDefaultInstance() { } GameOptionHuRsp::GameOptionHuRsp(const GameOptionHuRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionHuRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionHuRsp::~GameOptionHuRsp() { SharedDtor(); } void GameOptionHuRsp::SharedDtor() { if (this != default_instance_) { } } void GameOptionHuRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionHuRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionHuRsp_descriptor_; } const GameOptionHuRsp& GameOptionHuRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionHuRsp* GameOptionHuRsp::default_instance_ = NULL; GameOptionHuRsp* GameOptionHuRsp::New() const { return new GameOptionHuRsp; } void GameOptionHuRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionHuRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOptionHuRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionHuRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionHuRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameOptionHuRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionHuRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionHuRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionHuRsp::MergeFrom(const GameOptionHuRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionHuRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionHuRsp::CopyFrom(const GameOptionHuRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionHuRsp::IsInitialized() const { return true; } void GameOptionHuRsp::Swap(GameOptionHuRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameOptionHuRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionHuRsp_descriptor_; metadata.reflection = GameOptionHuRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER GameOptionPassReq::GameOptionPassReq() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionPassReq::InitAsDefaultInstance() { } GameOptionPassReq::GameOptionPassReq(const GameOptionPassReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionPassReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionPassReq::~GameOptionPassReq() { SharedDtor(); } void GameOptionPassReq::SharedDtor() { if (this != default_instance_) { } } void GameOptionPassReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionPassReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionPassReq_descriptor_; } const GameOptionPassReq& GameOptionPassReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionPassReq* GameOptionPassReq::default_instance_ = NULL; GameOptionPassReq* GameOptionPassReq::New() const { return new GameOptionPassReq; } void GameOptionPassReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionPassReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void GameOptionPassReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionPassReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionPassReq::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 GameOptionPassReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionPassReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionPassReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionPassReq::MergeFrom(const GameOptionPassReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionPassReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionPassReq::CopyFrom(const GameOptionPassReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionPassReq::IsInitialized() const { return true; } void GameOptionPassReq::Swap(GameOptionPassReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata GameOptionPassReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionPassReq_descriptor_; metadata.reflection = GameOptionPassReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOptionPassRsp::kRetFieldNumber; #endif // !_MSC_VER GameOptionPassRsp::GameOptionPassRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionPassRsp::InitAsDefaultInstance() { } GameOptionPassRsp::GameOptionPassRsp(const GameOptionPassRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionPassRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionPassRsp::~GameOptionPassRsp() { SharedDtor(); } void GameOptionPassRsp::SharedDtor() { if (this != default_instance_) { } } void GameOptionPassRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionPassRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionPassRsp_descriptor_; } const GameOptionPassRsp& GameOptionPassRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionPassRsp* GameOptionPassRsp::default_instance_ = NULL; GameOptionPassRsp* GameOptionPassRsp::New() const { return new GameOptionPassRsp; } void GameOptionPassRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionPassRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOptionPassRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionPassRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionPassRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameOptionPassRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionPassRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionPassRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionPassRsp::MergeFrom(const GameOptionPassRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionPassRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionPassRsp::CopyFrom(const GameOptionPassRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionPassRsp::IsInitialized() const { return true; } void GameOptionPassRsp::Swap(GameOptionPassRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameOptionPassRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionPassRsp_descriptor_; metadata.reflection = GameOptionPassRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GamePlayerReadyReq::kStatusFieldNumber; const int GamePlayerReadyReq::kPiaofenFieldNumber; #endif // !_MSC_VER GamePlayerReadyReq::GamePlayerReadyReq() : ::google::protobuf::Message() { SharedCtor(); } void GamePlayerReadyReq::InitAsDefaultInstance() { } GamePlayerReadyReq::GamePlayerReadyReq(const GamePlayerReadyReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GamePlayerReadyReq::SharedCtor() { _cached_size_ = 0; status_ = 0; piaofen_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GamePlayerReadyReq::~GamePlayerReadyReq() { SharedDtor(); } void GamePlayerReadyReq::SharedDtor() { if (this != default_instance_) { } } void GamePlayerReadyReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GamePlayerReadyReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GamePlayerReadyReq_descriptor_; } const GamePlayerReadyReq& GamePlayerReadyReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GamePlayerReadyReq* GamePlayerReadyReq::default_instance_ = NULL; GamePlayerReadyReq* GamePlayerReadyReq::New() const { return new GamePlayerReadyReq; } void GamePlayerReadyReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { status_ = 0; piaofen_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GamePlayerReadyReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 status = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_piaofen; break; } // optional int32 piaofen = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_piaofen: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &piaofen_))); set_has_piaofen(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GamePlayerReadyReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 status = 1; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->status(), output); } // optional int32 piaofen = 2; if (has_piaofen()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->piaofen(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GamePlayerReadyReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 status = 1; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->status(), target); } // optional int32 piaofen = 2; if (has_piaofen()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->piaofen(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GamePlayerReadyReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 status = 1; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 piaofen = 2; if (has_piaofen()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->piaofen()); } } 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 GamePlayerReadyReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GamePlayerReadyReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GamePlayerReadyReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GamePlayerReadyReq::MergeFrom(const GamePlayerReadyReq& 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_piaofen()) { set_piaofen(from.piaofen()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GamePlayerReadyReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GamePlayerReadyReq::CopyFrom(const GamePlayerReadyReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GamePlayerReadyReq::IsInitialized() const { return true; } void GamePlayerReadyReq::Swap(GamePlayerReadyReq* other) { if (other != this) { std::swap(status_, other->status_); std::swap(piaofen_, other->piaofen_); 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 GamePlayerReadyReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GamePlayerReadyReq_descriptor_; metadata.reflection = GamePlayerReadyReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int UserStatus::kUinFieldNumber; const int UserStatus::kStatusFieldNumber; const int UserStatus::kPiaofenFieldNumber; const int UserStatus::kShanghuoFieldNumber; #endif // !_MSC_VER UserStatus::UserStatus() : ::google::protobuf::Message() { SharedCtor(); } void UserStatus::InitAsDefaultInstance() { } UserStatus::UserStatus(const UserStatus& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void UserStatus::SharedCtor() { _cached_size_ = 0; uin_ = 0; status_ = 0; piaofen_ = 0; shanghuo_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } UserStatus::~UserStatus() { SharedDtor(); } void UserStatus::SharedDtor() { if (this != default_instance_) { } } void UserStatus::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UserStatus::descriptor() { protobuf_AssignDescriptorsOnce(); return UserStatus_descriptor_; } const UserStatus& UserStatus::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } UserStatus* UserStatus::default_instance_ = NULL; UserStatus* UserStatus::New() const { return new UserStatus; } void UserStatus::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; status_ = 0; piaofen_ = 0; shanghuo_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool UserStatus::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_status; break; } // optional int32 status = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_piaofen; break; } // optional int32 piaofen = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_piaofen: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &piaofen_))); set_has_piaofen(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_shanghuo; break; } // optional int32 shanghuo = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_shanghuo: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &shanghuo_))); set_has_shanghuo(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void UserStatus::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional int32 status = 2; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->status(), output); } // optional int32 piaofen = 3; if (has_piaofen()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->piaofen(), output); } // optional int32 shanghuo = 4; if (has_shanghuo()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->shanghuo(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* UserStatus::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional int32 status = 2; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->status(), target); } // optional int32 piaofen = 3; if (has_piaofen()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->piaofen(), target); } // optional int32 shanghuo = 4; if (has_shanghuo()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->shanghuo(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int UserStatus::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional int32 status = 2; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 piaofen = 3; if (has_piaofen()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->piaofen()); } // optional int32 shanghuo = 4; if (has_shanghuo()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->shanghuo()); } } 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 UserStatus::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const UserStatus* source = ::google::protobuf::internal::dynamic_cast_if_available<const UserStatus*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void UserStatus::MergeFrom(const UserStatus& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_status()) { set_status(from.status()); } if (from.has_piaofen()) { set_piaofen(from.piaofen()); } if (from.has_shanghuo()) { set_shanghuo(from.shanghuo()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void UserStatus::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void UserStatus::CopyFrom(const UserStatus& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool UserStatus::IsInitialized() const { return true; } void UserStatus::Swap(UserStatus* other) { if (other != this) { std::swap(uin_, other->uin_); std::swap(status_, other->status_); std::swap(piaofen_, other->piaofen_); std::swap(shanghuo_, other->shanghuo_); 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 UserStatus::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = UserStatus_descriptor_; metadata.reflection = UserStatus_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GamePlayerReadyEvt::kUsersFieldNumber; const int GamePlayerReadyEvt::kPreRemainTimeFieldNumber; const int GamePlayerReadyEvt::kDeskidFieldNumber; #endif // !_MSC_VER GamePlayerReadyEvt::GamePlayerReadyEvt() : ::google::protobuf::Message() { SharedCtor(); } void GamePlayerReadyEvt::InitAsDefaultInstance() { } GamePlayerReadyEvt::GamePlayerReadyEvt(const GamePlayerReadyEvt& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GamePlayerReadyEvt::SharedCtor() { _cached_size_ = 0; pre_remain_time_ = 0; deskid_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GamePlayerReadyEvt::~GamePlayerReadyEvt() { SharedDtor(); } void GamePlayerReadyEvt::SharedDtor() { if (this != default_instance_) { } } void GamePlayerReadyEvt::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GamePlayerReadyEvt::descriptor() { protobuf_AssignDescriptorsOnce(); return GamePlayerReadyEvt_descriptor_; } const GamePlayerReadyEvt& GamePlayerReadyEvt::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GamePlayerReadyEvt* GamePlayerReadyEvt::default_instance_ = NULL; GamePlayerReadyEvt* GamePlayerReadyEvt::New() const { return new GamePlayerReadyEvt; } void GamePlayerReadyEvt::Clear() { if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { pre_remain_time_ = 0; deskid_ = 0; } users_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GamePlayerReadyEvt::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .UserStatus users = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_users: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_users())); } else { goto handle_uninterpreted; } if (input->ExpectTag(10)) goto parse_users; if (input->ExpectTag(16)) goto parse_pre_remain_time; break; } // optional int32 pre_remain_time = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_pre_remain_time: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &pre_remain_time_))); set_has_pre_remain_time(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_deskid; break; } // optional int32 deskid = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_deskid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &deskid_))); set_has_deskid(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GamePlayerReadyEvt::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // repeated .UserStatus users = 1; for (int i = 0; i < this->users_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1, this->users(i), output); } // optional int32 pre_remain_time = 2; if (has_pre_remain_time()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->pre_remain_time(), output); } // optional int32 deskid = 3; if (has_deskid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->deskid(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GamePlayerReadyEvt::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // repeated .UserStatus users = 1; for (int i = 0; i < this->users_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 1, this->users(i), target); } // optional int32 pre_remain_time = 2; if (has_pre_remain_time()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->pre_remain_time(), target); } // optional int32 deskid = 3; if (has_deskid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->deskid(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GamePlayerReadyEvt::ByteSize() const { int total_size = 0; if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { // optional int32 pre_remain_time = 2; if (has_pre_remain_time()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->pre_remain_time()); } // optional int32 deskid = 3; if (has_deskid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->deskid()); } } // repeated .UserStatus users = 1; total_size += 1 * this->users_size(); for (int i = 0; i < this->users_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->users(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 GamePlayerReadyEvt::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GamePlayerReadyEvt* source = ::google::protobuf::internal::dynamic_cast_if_available<const GamePlayerReadyEvt*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GamePlayerReadyEvt::MergeFrom(const GamePlayerReadyEvt& from) { GOOGLE_CHECK_NE(&from, this); users_.MergeFrom(from.users_); if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { if (from.has_pre_remain_time()) { set_pre_remain_time(from.pre_remain_time()); } if (from.has_deskid()) { set_deskid(from.deskid()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GamePlayerReadyEvt::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GamePlayerReadyEvt::CopyFrom(const GamePlayerReadyEvt& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GamePlayerReadyEvt::IsInitialized() const { return true; } void GamePlayerReadyEvt::Swap(GamePlayerReadyEvt* other) { if (other != this) { users_.Swap(&other->users_); std::swap(pre_remain_time_, other->pre_remain_time_); std::swap(deskid_, other->deskid_); 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 GamePlayerReadyEvt::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GamePlayerReadyEvt_descriptor_; metadata.reflection = GamePlayerReadyEvt_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOptionGangNotFirstReq::kGangCardFieldNumber; #endif // !_MSC_VER GameOptionGangNotFirstReq::GameOptionGangNotFirstReq() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionGangNotFirstReq::InitAsDefaultInstance() { } GameOptionGangNotFirstReq::GameOptionGangNotFirstReq(const GameOptionGangNotFirstReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionGangNotFirstReq::SharedCtor() { _cached_size_ = 0; gang_card_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionGangNotFirstReq::~GameOptionGangNotFirstReq() { SharedDtor(); } void GameOptionGangNotFirstReq::SharedDtor() { if (this != default_instance_) { } } void GameOptionGangNotFirstReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionGangNotFirstReq::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionGangNotFirstReq_descriptor_; } const GameOptionGangNotFirstReq& GameOptionGangNotFirstReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionGangNotFirstReq* GameOptionGangNotFirstReq::default_instance_ = NULL; GameOptionGangNotFirstReq* GameOptionGangNotFirstReq::New() const { return new GameOptionGangNotFirstReq; } void GameOptionGangNotFirstReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { gang_card_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionGangNotFirstReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 gang_card = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &gang_card_))); set_has_gang_card(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOptionGangNotFirstReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 gang_card = 1; if (has_gang_card()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->gang_card(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionGangNotFirstReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 gang_card = 1; if (has_gang_card()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->gang_card(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionGangNotFirstReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 gang_card = 1; if (has_gang_card()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->gang_card()); } } 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 GameOptionGangNotFirstReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionGangNotFirstReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionGangNotFirstReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionGangNotFirstReq::MergeFrom(const GameOptionGangNotFirstReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_gang_card()) { set_gang_card(from.gang_card()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionGangNotFirstReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionGangNotFirstReq::CopyFrom(const GameOptionGangNotFirstReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionGangNotFirstReq::IsInitialized() const { return true; } void GameOptionGangNotFirstReq::Swap(GameOptionGangNotFirstReq* other) { if (other != this) { std::swap(gang_card_, other->gang_card_); 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 GameOptionGangNotFirstReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionGangNotFirstReq_descriptor_; metadata.reflection = GameOptionGangNotFirstReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOptionGangNotFirstRsp::kRetFieldNumber; #endif // !_MSC_VER GameOptionGangNotFirstRsp::GameOptionGangNotFirstRsp() : ::google::protobuf::Message() { SharedCtor(); } void GameOptionGangNotFirstRsp::InitAsDefaultInstance() { } GameOptionGangNotFirstRsp::GameOptionGangNotFirstRsp(const GameOptionGangNotFirstRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOptionGangNotFirstRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOptionGangNotFirstRsp::~GameOptionGangNotFirstRsp() { SharedDtor(); } void GameOptionGangNotFirstRsp::SharedDtor() { if (this != default_instance_) { } } void GameOptionGangNotFirstRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOptionGangNotFirstRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOptionGangNotFirstRsp_descriptor_; } const GameOptionGangNotFirstRsp& GameOptionGangNotFirstRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOptionGangNotFirstRsp* GameOptionGangNotFirstRsp::default_instance_ = NULL; GameOptionGangNotFirstRsp* GameOptionGangNotFirstRsp::New() const { return new GameOptionGangNotFirstRsp; } void GameOptionGangNotFirstRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOptionGangNotFirstRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOptionGangNotFirstRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOptionGangNotFirstRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOptionGangNotFirstRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 GameOptionGangNotFirstRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOptionGangNotFirstRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOptionGangNotFirstRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOptionGangNotFirstRsp::MergeFrom(const GameOptionGangNotFirstRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOptionGangNotFirstRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOptionGangNotFirstRsp::CopyFrom(const GameOptionGangNotFirstRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOptionGangNotFirstRsp::IsInitialized() const { return true; } void GameOptionGangNotFirstRsp::Swap(GameOptionGangNotFirstRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 GameOptionGangNotFirstRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOptionGangNotFirstRsp_descriptor_; metadata.reflection = GameOptionGangNotFirstRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER ApplyDeleteReq::ApplyDeleteReq() : ::google::protobuf::Message() { SharedCtor(); } void ApplyDeleteReq::InitAsDefaultInstance() { } ApplyDeleteReq::ApplyDeleteReq(const ApplyDeleteReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void ApplyDeleteReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } ApplyDeleteReq::~ApplyDeleteReq() { SharedDtor(); } void ApplyDeleteReq::SharedDtor() { if (this != default_instance_) { } } void ApplyDeleteReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ApplyDeleteReq::descriptor() { protobuf_AssignDescriptorsOnce(); return ApplyDeleteReq_descriptor_; } const ApplyDeleteReq& ApplyDeleteReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } ApplyDeleteReq* ApplyDeleteReq::default_instance_ = NULL; ApplyDeleteReq* ApplyDeleteReq::New() const { return new ApplyDeleteReq; } void ApplyDeleteReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool ApplyDeleteReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void ApplyDeleteReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* ApplyDeleteReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int ApplyDeleteReq::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 ApplyDeleteReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const ApplyDeleteReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const ApplyDeleteReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void ApplyDeleteReq::MergeFrom(const ApplyDeleteReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void ApplyDeleteReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void ApplyDeleteReq::CopyFrom(const ApplyDeleteReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool ApplyDeleteReq::IsInitialized() const { return true; } void ApplyDeleteReq::Swap(ApplyDeleteReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata ApplyDeleteReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = ApplyDeleteReq_descriptor_; metadata.reflection = ApplyDeleteReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int ApplyDeleteEvt::kApplyUinFieldNumber; const int ApplyDeleteEvt::kGameStatusFieldNumber; const int ApplyDeleteEvt::kRemainTimeFieldNumber; const int ApplyDeleteEvt::kStatusFieldNumber; const int ApplyDeleteEvt::kDeskidFieldNumber; #endif // !_MSC_VER ApplyDeleteEvt::ApplyDeleteEvt() : ::google::protobuf::Message() { SharedCtor(); } void ApplyDeleteEvt::InitAsDefaultInstance() { } ApplyDeleteEvt::ApplyDeleteEvt(const ApplyDeleteEvt& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void ApplyDeleteEvt::SharedCtor() { _cached_size_ = 0; apply_uin_ = 0; game_status_ = 0; remain_time_ = 0; status_ = 0; deskid_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } ApplyDeleteEvt::~ApplyDeleteEvt() { SharedDtor(); } void ApplyDeleteEvt::SharedDtor() { if (this != default_instance_) { } } void ApplyDeleteEvt::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ApplyDeleteEvt::descriptor() { protobuf_AssignDescriptorsOnce(); return ApplyDeleteEvt_descriptor_; } const ApplyDeleteEvt& ApplyDeleteEvt::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } ApplyDeleteEvt* ApplyDeleteEvt::default_instance_ = NULL; ApplyDeleteEvt* ApplyDeleteEvt::New() const { return new ApplyDeleteEvt; } void ApplyDeleteEvt::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { apply_uin_ = 0; game_status_ = 0; remain_time_ = 0; status_ = 0; deskid_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool ApplyDeleteEvt::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 apply_uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &apply_uin_))); set_has_apply_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_game_status; break; } // optional int32 game_status = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_game_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &game_status_))); set_has_game_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_remain_time; break; } // optional int32 remain_time = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_remain_time: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &remain_time_))); set_has_remain_time(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_status; break; } // optional int32 status = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_deskid; break; } // optional int32 deskid = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_deskid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &deskid_))); set_has_deskid(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void ApplyDeleteEvt::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 apply_uin = 1; if (has_apply_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->apply_uin(), output); } // optional int32 game_status = 2; if (has_game_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->game_status(), output); } // optional int32 remain_time = 3; if (has_remain_time()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->remain_time(), output); } // optional int32 status = 4; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->status(), output); } // optional int32 deskid = 5; if (has_deskid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->deskid(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* ApplyDeleteEvt::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 apply_uin = 1; if (has_apply_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->apply_uin(), target); } // optional int32 game_status = 2; if (has_game_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->game_status(), target); } // optional int32 remain_time = 3; if (has_remain_time()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->remain_time(), target); } // optional int32 status = 4; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->status(), target); } // optional int32 deskid = 5; if (has_deskid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->deskid(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int ApplyDeleteEvt::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 apply_uin = 1; if (has_apply_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->apply_uin()); } // optional int32 game_status = 2; if (has_game_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->game_status()); } // optional int32 remain_time = 3; if (has_remain_time()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->remain_time()); } // optional int32 status = 4; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 deskid = 5; if (has_deskid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->deskid()); } } 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 ApplyDeleteEvt::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const ApplyDeleteEvt* source = ::google::protobuf::internal::dynamic_cast_if_available<const ApplyDeleteEvt*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void ApplyDeleteEvt::MergeFrom(const ApplyDeleteEvt& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_apply_uin()) { set_apply_uin(from.apply_uin()); } if (from.has_game_status()) { set_game_status(from.game_status()); } if (from.has_remain_time()) { set_remain_time(from.remain_time()); } if (from.has_status()) { set_status(from.status()); } if (from.has_deskid()) { set_deskid(from.deskid()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void ApplyDeleteEvt::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void ApplyDeleteEvt::CopyFrom(const ApplyDeleteEvt& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool ApplyDeleteEvt::IsInitialized() const { return true; } void ApplyDeleteEvt::Swap(ApplyDeleteEvt* other) { if (other != this) { std::swap(apply_uin_, other->apply_uin_); std::swap(game_status_, other->game_status_); std::swap(remain_time_, other->remain_time_); std::swap(status_, other->status_); std::swap(deskid_, other->deskid_); 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 ApplyDeleteEvt::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = ApplyDeleteEvt_descriptor_; metadata.reflection = ApplyDeleteEvt_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int UserOption::kUinFieldNumber; const int UserOption::kTypeFieldNumber; #endif // !_MSC_VER UserOption::UserOption() : ::google::protobuf::Message() { SharedCtor(); } void UserOption::InitAsDefaultInstance() { } UserOption::UserOption(const UserOption& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void UserOption::SharedCtor() { _cached_size_ = 0; uin_ = 0; type_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } UserOption::~UserOption() { SharedDtor(); } void UserOption::SharedDtor() { if (this != default_instance_) { } } void UserOption::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UserOption::descriptor() { protobuf_AssignDescriptorsOnce(); return UserOption_descriptor_; } const UserOption& UserOption::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } UserOption* UserOption::default_instance_ = NULL; UserOption* UserOption::New() const { return new UserOption; } void UserOption::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; type_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool UserOption::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_type; break; } // optional int32 type = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &type_))); set_has_type(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void UserOption::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional int32 type = 2; if (has_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->type(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* UserOption::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional int32 type = 2; if (has_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->type(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int UserOption::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional int32 type = 2; if (has_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->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 UserOption::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const UserOption* source = ::google::protobuf::internal::dynamic_cast_if_available<const UserOption*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void UserOption::MergeFrom(const UserOption& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_type()) { set_type(from.type()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void UserOption::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void UserOption::CopyFrom(const UserOption& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool UserOption::IsInitialized() const { return true; } void UserOption::Swap(UserOption* other) { if (other != this) { std::swap(uin_, other->uin_); std::swap(type_, other->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 UserOption::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = UserOption_descriptor_; metadata.reflection = UserOption_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameInfoEvt::kDeskidFieldNumber; const int GameInfoEvt::kNextUinFieldNumber; const int GameInfoEvt::kMaxRoundFieldNumber; const int GameInfoEvt::kCardsFieldNumber; const int GameInfoEvt::kDealerSeatidFieldNumber; const int GameInfoEvt::kUsersFieldNumber; const int GameInfoEvt::kOpUserFieldNumber; const int GameInfoEvt::kShareCardsLenFieldNumber; const int GameInfoEvt::kGameRoundFieldNumber; const int GameInfoEvt::kMyOptionFieldNumber; const int GameInfoEvt::kStatusFieldNumber; const int GameInfoEvt::kRecvCardUinFieldNumber; const int GameInfoEvt::kDeskRemainRoundFieldNumber; const int GameInfoEvt::kSeatNumFieldNumber; #endif // !_MSC_VER GameInfoEvt::GameInfoEvt() : ::google::protobuf::Message() { SharedCtor(); } void GameInfoEvt::InitAsDefaultInstance() { op_user_ = const_cast< ::UserOption*>(&::UserOption::default_instance()); my_option_ = const_cast< ::MyOption*>(&::MyOption::default_instance()); } GameInfoEvt::GameInfoEvt(const GameInfoEvt& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameInfoEvt::SharedCtor() { _cached_size_ = 0; deskid_ = 0; next_uin_ = 0; max_round_ = 0; dealer_seatid_ = 0; op_user_ = NULL; share_cards_len_ = 0; game_round_ = 0; my_option_ = NULL; status_ = 0; recv_card_uin_ = 0; desk_remain_round_ = 0; seat_num_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameInfoEvt::~GameInfoEvt() { SharedDtor(); } void GameInfoEvt::SharedDtor() { if (this != default_instance_) { delete op_user_; delete my_option_; } } void GameInfoEvt::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameInfoEvt::descriptor() { protobuf_AssignDescriptorsOnce(); return GameInfoEvt_descriptor_; } const GameInfoEvt& GameInfoEvt::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameInfoEvt* GameInfoEvt::default_instance_ = NULL; GameInfoEvt* GameInfoEvt::New() const { return new GameInfoEvt; } void GameInfoEvt::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { deskid_ = 0; next_uin_ = 0; max_round_ = 0; dealer_seatid_ = 0; if (has_op_user()) { if (op_user_ != NULL) op_user_->::UserOption::Clear(); } share_cards_len_ = 0; } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { game_round_ = 0; if (has_my_option()) { if (my_option_ != NULL) my_option_->::MyOption::Clear(); } status_ = 0; recv_card_uin_ = 0; desk_remain_round_ = 0; seat_num_ = 0; } cards_.Clear(); users_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameInfoEvt::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 deskid = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &deskid_))); set_has_deskid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_next_uin; break; } // optional int32 next_uin = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_next_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &next_uin_))); set_has_next_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_max_round; break; } // optional int32 max_round = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_max_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &max_round_))); set_has_max_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(34)) goto parse_cards; break; } // repeated int32 cards = 4 [packed = true]; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 34, input, this->mutable_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_dealer_seatid; break; } // optional int32 dealer_seatid = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_dealer_seatid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &dealer_seatid_))); set_has_dealer_seatid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(50)) goto parse_users; break; } // repeated .UserCommonCards users = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_users: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_users())); } else { goto handle_uninterpreted; } if (input->ExpectTag(50)) goto parse_users; if (input->ExpectTag(58)) goto parse_op_user; break; } // optional .UserOption op_user = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_op_user: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_op_user())); } else { goto handle_uninterpreted; } if (input->ExpectTag(64)) goto parse_share_cards_len; break; } // optional int32 share_cards_len = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_share_cards_len: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &share_cards_len_))); set_has_share_cards_len(); } else { goto handle_uninterpreted; } if (input->ExpectTag(72)) goto parse_game_round; break; } // optional int32 game_round = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_game_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &game_round_))); set_has_game_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(82)) goto parse_my_option; break; } // optional .MyOption my_option = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_my_option: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_my_option())); } else { goto handle_uninterpreted; } if (input->ExpectTag(88)) goto parse_status; break; } // optional int32 status = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(96)) goto parse_recv_card_uin; break; } // optional int32 recv_card_uin = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_recv_card_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &recv_card_uin_))); set_has_recv_card_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(104)) goto parse_desk_remain_round; break; } // optional int32 desk_remain_round = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_desk_remain_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &desk_remain_round_))); set_has_desk_remain_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(112)) goto parse_seat_num; break; } // optional int32 seat_num = 14; case 14: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_seat_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &seat_num_))); set_has_seat_num(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameInfoEvt::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 deskid = 1; if (has_deskid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->deskid(), output); } // optional int32 next_uin = 2; if (has_next_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->next_uin(), output); } // optional int32 max_round = 3; if (has_max_round()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->max_round(), output); } // repeated int32 cards = 4 [packed = true]; if (this->cards_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_cards_cached_byte_size_); } for (int i = 0; i < this->cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->cards(i), output); } // optional int32 dealer_seatid = 5; if (has_dealer_seatid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->dealer_seatid(), output); } // repeated .UserCommonCards users = 6; for (int i = 0; i < this->users_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 6, this->users(i), output); } // optional .UserOption op_user = 7; if (has_op_user()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 7, this->op_user(), output); } // optional int32 share_cards_len = 8; if (has_share_cards_len()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->share_cards_len(), output); } // optional int32 game_round = 9; if (has_game_round()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->game_round(), output); } // optional .MyOption my_option = 10; if (has_my_option()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 10, this->my_option(), output); } // optional int32 status = 11; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(11, this->status(), output); } // optional int32 recv_card_uin = 12; if (has_recv_card_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->recv_card_uin(), output); } // optional int32 desk_remain_round = 13; if (has_desk_remain_round()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->desk_remain_round(), output); } // optional int32 seat_num = 14; if (has_seat_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->seat_num(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameInfoEvt::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 deskid = 1; if (has_deskid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->deskid(), target); } // optional int32 next_uin = 2; if (has_next_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->next_uin(), target); } // optional int32 max_round = 3; if (has_max_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->max_round(), target); } // repeated int32 cards = 4 [packed = true]; if (this->cards_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _cards_cached_byte_size_, target); } for (int i = 0; i < this->cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->cards(i), target); } // optional int32 dealer_seatid = 5; if (has_dealer_seatid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->dealer_seatid(), target); } // repeated .UserCommonCards users = 6; for (int i = 0; i < this->users_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 6, this->users(i), target); } // optional .UserOption op_user = 7; if (has_op_user()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 7, this->op_user(), target); } // optional int32 share_cards_len = 8; if (has_share_cards_len()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->share_cards_len(), target); } // optional int32 game_round = 9; if (has_game_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->game_round(), target); } // optional .MyOption my_option = 10; if (has_my_option()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 10, this->my_option(), target); } // optional int32 status = 11; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(11, this->status(), target); } // optional int32 recv_card_uin = 12; if (has_recv_card_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->recv_card_uin(), target); } // optional int32 desk_remain_round = 13; if (has_desk_remain_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->desk_remain_round(), target); } // optional int32 seat_num = 14; if (has_seat_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->seat_num(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameInfoEvt::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 deskid = 1; if (has_deskid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->deskid()); } // optional int32 next_uin = 2; if (has_next_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->next_uin()); } // optional int32 max_round = 3; if (has_max_round()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->max_round()); } // optional int32 dealer_seatid = 5; if (has_dealer_seatid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->dealer_seatid()); } // optional .UserOption op_user = 7; if (has_op_user()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->op_user()); } // optional int32 share_cards_len = 8; if (has_share_cards_len()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->share_cards_len()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional int32 game_round = 9; if (has_game_round()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->game_round()); } // optional .MyOption my_option = 10; if (has_my_option()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->my_option()); } // optional int32 status = 11; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 recv_card_uin = 12; if (has_recv_card_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->recv_card_uin()); } // optional int32 desk_remain_round = 13; if (has_desk_remain_round()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->desk_remain_round()); } // optional int32 seat_num = 14; if (has_seat_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->seat_num()); } } // repeated int32 cards = 4 [packed = true]; { int data_size = 0; for (int i = 0; i < this->cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->cards(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cards_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated .UserCommonCards users = 6; total_size += 1 * this->users_size(); for (int i = 0; i < this->users_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->users(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 GameInfoEvt::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameInfoEvt* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameInfoEvt*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameInfoEvt::MergeFrom(const GameInfoEvt& from) { GOOGLE_CHECK_NE(&from, this); cards_.MergeFrom(from.cards_); users_.MergeFrom(from.users_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_deskid()) { set_deskid(from.deskid()); } if (from.has_next_uin()) { set_next_uin(from.next_uin()); } if (from.has_max_round()) { set_max_round(from.max_round()); } if (from.has_dealer_seatid()) { set_dealer_seatid(from.dealer_seatid()); } if (from.has_op_user()) { mutable_op_user()->::UserOption::MergeFrom(from.op_user()); } if (from.has_share_cards_len()) { set_share_cards_len(from.share_cards_len()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_game_round()) { set_game_round(from.game_round()); } if (from.has_my_option()) { mutable_my_option()->::MyOption::MergeFrom(from.my_option()); } if (from.has_status()) { set_status(from.status()); } if (from.has_recv_card_uin()) { set_recv_card_uin(from.recv_card_uin()); } if (from.has_desk_remain_round()) { set_desk_remain_round(from.desk_remain_round()); } if (from.has_seat_num()) { set_seat_num(from.seat_num()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameInfoEvt::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameInfoEvt::CopyFrom(const GameInfoEvt& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameInfoEvt::IsInitialized() const { return true; } void GameInfoEvt::Swap(GameInfoEvt* other) { if (other != this) { std::swap(deskid_, other->deskid_); std::swap(next_uin_, other->next_uin_); std::swap(max_round_, other->max_round_); cards_.Swap(&other->cards_); std::swap(dealer_seatid_, other->dealer_seatid_); users_.Swap(&other->users_); std::swap(op_user_, other->op_user_); std::swap(share_cards_len_, other->share_cards_len_); std::swap(game_round_, other->game_round_); std::swap(my_option_, other->my_option_); std::swap(status_, other->status_); std::swap(recv_card_uin_, other->recv_card_uin_); std::swap(desk_remain_round_, other->desk_remain_round_); std::swap(seat_num_, other->seat_num_); 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 GameInfoEvt::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameInfoEvt_descriptor_; metadata.reflection = GameInfoEvt_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int GameOverResultInfo::kUinFieldNumber; const int GameOverResultInfo::kChipsFieldNumber; const int GameOverResultInfo::kRoundChiNumFieldNumber; const int GameOverResultInfo::kRoundPengNumFieldNumber; const int GameOverResultInfo::kRoundGangListFieldNumber; const int GameOverResultInfo::kRoundHuListFieldNumber; const int GameOverResultInfo::kRoundWinListFieldNumber; const int GameOverResultInfo::kTotalChiNumFieldNumber; const int GameOverResultInfo::kTotalPengNumFieldNumber; const int GameOverResultInfo::kTotalGangListFieldNumber; const int GameOverResultInfo::kTotalHuListFieldNumber; const int GameOverResultInfo::kTotalWinListFieldNumber; const int GameOverResultInfo::kStatusFieldNumber; const int GameOverResultInfo::kPiaofenFieldNumber; const int GameOverResultInfo::kShanghuoFieldNumber; const int GameOverResultInfo::kBirdNumFieldNumber; const int GameOverResultInfo::kCardsFieldNumber; const int GameOverResultInfo::kOutCardsFieldNumber; const int GameOverResultInfo::kOpListFieldNumber; const int GameOverResultInfo::kRoundWinChipsFieldNumber; const int GameOverResultInfo::kOverChipsDetailsFieldNumber; const int GameOverResultInfo::kRoundWinChipsBeforeFieldNumber; #endif // !_MSC_VER GameOverResultInfo::GameOverResultInfo() : ::google::protobuf::Message() { SharedCtor(); } void GameOverResultInfo::InitAsDefaultInstance() { } GameOverResultInfo::GameOverResultInfo(const GameOverResultInfo& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void GameOverResultInfo::SharedCtor() { _cached_size_ = 0; uin_ = 0; chips_ = GOOGLE_LONGLONG(0); round_chi_num_ = 0; round_peng_num_ = 0; total_chi_num_ = 0; total_peng_num_ = 0; status_ = 0; piaofen_ = 0; shanghuo_ = 0; bird_num_ = 0; round_win_chips_ = 0; round_win_chips_before_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } GameOverResultInfo::~GameOverResultInfo() { SharedDtor(); } void GameOverResultInfo::SharedDtor() { if (this != default_instance_) { } } void GameOverResultInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* GameOverResultInfo::descriptor() { protobuf_AssignDescriptorsOnce(); return GameOverResultInfo_descriptor_; } const GameOverResultInfo& GameOverResultInfo::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } GameOverResultInfo* GameOverResultInfo::default_instance_ = NULL; GameOverResultInfo* GameOverResultInfo::New() const { return new GameOverResultInfo; } void GameOverResultInfo::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; chips_ = GOOGLE_LONGLONG(0); round_chi_num_ = 0; round_peng_num_ = 0; total_chi_num_ = 0; } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { total_peng_num_ = 0; status_ = 0; piaofen_ = 0; shanghuo_ = 0; bird_num_ = 0; } if (_has_bits_[19 / 32] & (0xffu << (19 % 32))) { round_win_chips_ = 0; round_win_chips_before_ = 0; } round_gang_list_.Clear(); round_hu_list_.Clear(); round_win_list_.Clear(); total_gang_list_.Clear(); total_hu_list_.Clear(); total_win_list_.Clear(); cards_.Clear(); out_cards_.Clear(); op_list_.Clear(); over_chips_details_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool GameOverResultInfo::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_chips; break; } // optional int64 chips = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_chips: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &chips_))); set_has_chips(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_round_chi_num; break; } // optional int32 round_chi_num = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_chi_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_chi_num_))); set_has_round_chi_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_round_peng_num; break; } // optional int32 round_peng_num = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_peng_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_peng_num_))); set_has_round_peng_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_round_gang_list; break; } // repeated int32 round_gang_list = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_gang_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 40, input, this->mutable_round_gang_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_round_gang_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_round_gang_list; if (input->ExpectTag(48)) goto parse_round_hu_list; break; } // repeated int32 round_hu_list = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_hu_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 48, input, this->mutable_round_hu_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_round_hu_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_round_hu_list; if (input->ExpectTag(56)) goto parse_round_win_list; break; } // repeated int32 round_win_list = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_win_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 56, input, this->mutable_round_win_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_round_win_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_round_win_list; if (input->ExpectTag(64)) goto parse_total_chi_num; break; } // optional int32 total_chi_num = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_chi_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_chi_num_))); set_has_total_chi_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(72)) goto parse_total_peng_num; break; } // optional int32 total_peng_num = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_peng_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_peng_num_))); set_has_total_peng_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(80)) goto parse_total_gang_list; break; } // repeated int32 total_gang_list = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_gang_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 80, input, this->mutable_total_gang_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_total_gang_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(80)) goto parse_total_gang_list; if (input->ExpectTag(88)) goto parse_total_hu_list; break; } // repeated int32 total_hu_list = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_hu_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 88, input, this->mutable_total_hu_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_total_hu_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(88)) goto parse_total_hu_list; if (input->ExpectTag(96)) goto parse_total_win_list; break; } // repeated int32 total_win_list = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_win_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 96, input, this->mutable_total_win_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_total_win_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(96)) goto parse_total_win_list; if (input->ExpectTag(104)) goto parse_status; break; } // optional int32 status = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(112)) goto parse_piaofen; break; } // optional int32 piaofen = 14; case 14: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_piaofen: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &piaofen_))); set_has_piaofen(); } else { goto handle_uninterpreted; } if (input->ExpectTag(120)) goto parse_shanghuo; break; } // optional int32 shanghuo = 15; case 15: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_shanghuo: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &shanghuo_))); set_has_shanghuo(); } else { goto handle_uninterpreted; } if (input->ExpectTag(128)) goto parse_bird_num; break; } // optional int32 bird_num = 16; case 16: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_bird_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &bird_num_))); set_has_bird_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(136)) goto parse_cards; break; } // repeated int32 cards = 17; case 17: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2, 136, input, this->mutable_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(136)) goto parse_cards; if (input->ExpectTag(144)) goto parse_out_cards; break; } // repeated int32 out_cards = 18; case 18: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_out_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2, 144, input, this->mutable_out_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_out_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(144)) goto parse_out_cards; if (input->ExpectTag(152)) goto parse_op_list; break; } // repeated int32 op_list = 19; case 19: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2, 152, input, this->mutable_op_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_op_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(152)) goto parse_op_list; if (input->ExpectTag(160)) goto parse_round_win_chips; break; } // optional int32 round_win_chips = 20; case 20: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_win_chips: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_win_chips_))); set_has_round_win_chips(); } else { goto handle_uninterpreted; } if (input->ExpectTag(168)) goto parse_over_chips_details; break; } // repeated int32 over_chips_details = 21; case 21: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_over_chips_details: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2, 168, input, this->mutable_over_chips_details()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_over_chips_details()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(168)) goto parse_over_chips_details; if (input->ExpectTag(176)) goto parse_round_win_chips_before; break; } // optional int32 round_win_chips_before = 22; case 22: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_win_chips_before: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_win_chips_before_))); set_has_round_win_chips_before(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void GameOverResultInfo::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional int64 chips = 2; if (has_chips()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->chips(), output); } // optional int32 round_chi_num = 3; if (has_round_chi_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->round_chi_num(), output); } // optional int32 round_peng_num = 4; if (has_round_peng_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->round_peng_num(), output); } // repeated int32 round_gang_list = 5; for (int i = 0; i < this->round_gang_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 5, this->round_gang_list(i), output); } // repeated int32 round_hu_list = 6; for (int i = 0; i < this->round_hu_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 6, this->round_hu_list(i), output); } // repeated int32 round_win_list = 7; for (int i = 0; i < this->round_win_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 7, this->round_win_list(i), output); } // optional int32 total_chi_num = 8; if (has_total_chi_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->total_chi_num(), output); } // optional int32 total_peng_num = 9; if (has_total_peng_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->total_peng_num(), output); } // repeated int32 total_gang_list = 10; for (int i = 0; i < this->total_gang_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 10, this->total_gang_list(i), output); } // repeated int32 total_hu_list = 11; for (int i = 0; i < this->total_hu_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 11, this->total_hu_list(i), output); } // repeated int32 total_win_list = 12; for (int i = 0; i < this->total_win_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 12, this->total_win_list(i), output); } // optional int32 status = 13; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->status(), output); } // optional int32 piaofen = 14; if (has_piaofen()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->piaofen(), output); } // optional int32 shanghuo = 15; if (has_shanghuo()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(15, this->shanghuo(), output); } // optional int32 bird_num = 16; if (has_bird_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->bird_num(), output); } // repeated int32 cards = 17; for (int i = 0; i < this->cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 17, this->cards(i), output); } // repeated int32 out_cards = 18; for (int i = 0; i < this->out_cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 18, this->out_cards(i), output); } // repeated int32 op_list = 19; for (int i = 0; i < this->op_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 19, this->op_list(i), output); } // optional int32 round_win_chips = 20; if (has_round_win_chips()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(20, this->round_win_chips(), output); } // repeated int32 over_chips_details = 21; for (int i = 0; i < this->over_chips_details_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 21, this->over_chips_details(i), output); } // optional int32 round_win_chips_before = 22; if (has_round_win_chips_before()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(22, this->round_win_chips_before(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* GameOverResultInfo::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional int64 chips = 2; if (has_chips()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->chips(), target); } // optional int32 round_chi_num = 3; if (has_round_chi_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->round_chi_num(), target); } // optional int32 round_peng_num = 4; if (has_round_peng_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->round_peng_num(), target); } // repeated int32 round_gang_list = 5; for (int i = 0; i < this->round_gang_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(5, this->round_gang_list(i), target); } // repeated int32 round_hu_list = 6; for (int i = 0; i < this->round_hu_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(6, this->round_hu_list(i), target); } // repeated int32 round_win_list = 7; for (int i = 0; i < this->round_win_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(7, this->round_win_list(i), target); } // optional int32 total_chi_num = 8; if (has_total_chi_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->total_chi_num(), target); } // optional int32 total_peng_num = 9; if (has_total_peng_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->total_peng_num(), target); } // repeated int32 total_gang_list = 10; for (int i = 0; i < this->total_gang_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(10, this->total_gang_list(i), target); } // repeated int32 total_hu_list = 11; for (int i = 0; i < this->total_hu_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(11, this->total_hu_list(i), target); } // repeated int32 total_win_list = 12; for (int i = 0; i < this->total_win_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(12, this->total_win_list(i), target); } // optional int32 status = 13; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->status(), target); } // optional int32 piaofen = 14; if (has_piaofen()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->piaofen(), target); } // optional int32 shanghuo = 15; if (has_shanghuo()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(15, this->shanghuo(), target); } // optional int32 bird_num = 16; if (has_bird_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(16, this->bird_num(), target); } // repeated int32 cards = 17; for (int i = 0; i < this->cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(17, this->cards(i), target); } // repeated int32 out_cards = 18; for (int i = 0; i < this->out_cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(18, this->out_cards(i), target); } // repeated int32 op_list = 19; for (int i = 0; i < this->op_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(19, this->op_list(i), target); } // optional int32 round_win_chips = 20; if (has_round_win_chips()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(20, this->round_win_chips(), target); } // repeated int32 over_chips_details = 21; for (int i = 0; i < this->over_chips_details_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(21, this->over_chips_details(i), target); } // optional int32 round_win_chips_before = 22; if (has_round_win_chips_before()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(22, this->round_win_chips_before(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int GameOverResultInfo::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional int64 chips = 2; if (has_chips()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( this->chips()); } // optional int32 round_chi_num = 3; if (has_round_chi_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_chi_num()); } // optional int32 round_peng_num = 4; if (has_round_peng_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_peng_num()); } // optional int32 total_chi_num = 8; if (has_total_chi_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_chi_num()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional int32 total_peng_num = 9; if (has_total_peng_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_peng_num()); } // optional int32 status = 13; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 piaofen = 14; if (has_piaofen()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->piaofen()); } // optional int32 shanghuo = 15; if (has_shanghuo()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->shanghuo()); } // optional int32 bird_num = 16; if (has_bird_num()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->bird_num()); } } if (_has_bits_[19 / 32] & (0xffu << (19 % 32))) { // optional int32 round_win_chips = 20; if (has_round_win_chips()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_win_chips()); } // optional int32 round_win_chips_before = 22; if (has_round_win_chips_before()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_win_chips_before()); } } // repeated int32 round_gang_list = 5; { int data_size = 0; for (int i = 0; i < this->round_gang_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->round_gang_list(i)); } total_size += 1 * this->round_gang_list_size() + data_size; } // repeated int32 round_hu_list = 6; { int data_size = 0; for (int i = 0; i < this->round_hu_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->round_hu_list(i)); } total_size += 1 * this->round_hu_list_size() + data_size; } // repeated int32 round_win_list = 7; { int data_size = 0; for (int i = 0; i < this->round_win_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->round_win_list(i)); } total_size += 1 * this->round_win_list_size() + data_size; } // repeated int32 total_gang_list = 10; { int data_size = 0; for (int i = 0; i < this->total_gang_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->total_gang_list(i)); } total_size += 1 * this->total_gang_list_size() + data_size; } // repeated int32 total_hu_list = 11; { int data_size = 0; for (int i = 0; i < this->total_hu_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->total_hu_list(i)); } total_size += 1 * this->total_hu_list_size() + data_size; } // repeated int32 total_win_list = 12; { int data_size = 0; for (int i = 0; i < this->total_win_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->total_win_list(i)); } total_size += 1 * this->total_win_list_size() + data_size; } // repeated int32 cards = 17; { int data_size = 0; for (int i = 0; i < this->cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->cards(i)); } total_size += 2 * this->cards_size() + data_size; } // repeated int32 out_cards = 18; { int data_size = 0; for (int i = 0; i < this->out_cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->out_cards(i)); } total_size += 2 * this->out_cards_size() + data_size; } // repeated int32 op_list = 19; { int data_size = 0; for (int i = 0; i < this->op_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->op_list(i)); } total_size += 2 * this->op_list_size() + data_size; } // repeated int32 over_chips_details = 21; { int data_size = 0; for (int i = 0; i < this->over_chips_details_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->over_chips_details(i)); } total_size += 2 * this->over_chips_details_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 GameOverResultInfo::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const GameOverResultInfo* source = ::google::protobuf::internal::dynamic_cast_if_available<const GameOverResultInfo*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void GameOverResultInfo::MergeFrom(const GameOverResultInfo& from) { GOOGLE_CHECK_NE(&from, this); round_gang_list_.MergeFrom(from.round_gang_list_); round_hu_list_.MergeFrom(from.round_hu_list_); round_win_list_.MergeFrom(from.round_win_list_); total_gang_list_.MergeFrom(from.total_gang_list_); total_hu_list_.MergeFrom(from.total_hu_list_); total_win_list_.MergeFrom(from.total_win_list_); cards_.MergeFrom(from.cards_); out_cards_.MergeFrom(from.out_cards_); op_list_.MergeFrom(from.op_list_); over_chips_details_.MergeFrom(from.over_chips_details_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_chips()) { set_chips(from.chips()); } if (from.has_round_chi_num()) { set_round_chi_num(from.round_chi_num()); } if (from.has_round_peng_num()) { set_round_peng_num(from.round_peng_num()); } if (from.has_total_chi_num()) { set_total_chi_num(from.total_chi_num()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_total_peng_num()) { set_total_peng_num(from.total_peng_num()); } if (from.has_status()) { set_status(from.status()); } if (from.has_piaofen()) { set_piaofen(from.piaofen()); } if (from.has_shanghuo()) { set_shanghuo(from.shanghuo()); } if (from.has_bird_num()) { set_bird_num(from.bird_num()); } } if (from._has_bits_[19 / 32] & (0xffu << (19 % 32))) { if (from.has_round_win_chips()) { set_round_win_chips(from.round_win_chips()); } if (from.has_round_win_chips_before()) { set_round_win_chips_before(from.round_win_chips_before()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void GameOverResultInfo::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void GameOverResultInfo::CopyFrom(const GameOverResultInfo& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool GameOverResultInfo::IsInitialized() const { return true; } void GameOverResultInfo::Swap(GameOverResultInfo* other) { if (other != this) { std::swap(uin_, other->uin_); std::swap(chips_, other->chips_); std::swap(round_chi_num_, other->round_chi_num_); std::swap(round_peng_num_, other->round_peng_num_); round_gang_list_.Swap(&other->round_gang_list_); round_hu_list_.Swap(&other->round_hu_list_); round_win_list_.Swap(&other->round_win_list_); std::swap(total_chi_num_, other->total_chi_num_); std::swap(total_peng_num_, other->total_peng_num_); total_gang_list_.Swap(&other->total_gang_list_); total_hu_list_.Swap(&other->total_hu_list_); total_win_list_.Swap(&other->total_win_list_); std::swap(status_, other->status_); std::swap(piaofen_, other->piaofen_); std::swap(shanghuo_, other->shanghuo_); std::swap(bird_num_, other->bird_num_); cards_.Swap(&other->cards_); out_cards_.Swap(&other->out_cards_); op_list_.Swap(&other->op_list_); std::swap(round_win_chips_, other->round_win_chips_); over_chips_details_.Swap(&other->over_chips_details_); std::swap(round_win_chips_before_, other->round_win_chips_before_); 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 GameOverResultInfo::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = GameOverResultInfo_descriptor_; metadata.reflection = GameOverResultInfo_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int EvtGameOver::kWinnersFieldNumber; const int EvtGameOver::kResultFieldNumber; const int EvtGameOver::kDeskidFieldNumber; const int EvtGameOver::kStatusFieldNumber; const int EvtGameOver::kRemainRoundNumFieldNumber; const int EvtGameOver::kBirdCardFieldNumber; const int EvtGameOver::kTypeFieldNumber; const int EvtGameOver::kSeatLimitFieldNumber; const int EvtGameOver::kWinTypeFieldNumber; const int EvtGameOver::kExtraTypeFieldNumber; const int EvtGameOver::kLastRoundFieldNumber; const int EvtGameOver::kOverTimeFieldNumber; const int EvtGameOver::kOverReasonFieldNumber; #endif // !_MSC_VER EvtGameOver::EvtGameOver() : ::google::protobuf::Message() { SharedCtor(); } void EvtGameOver::InitAsDefaultInstance() { extra_type_ = const_cast< ::ExtraDeskTypeInfo*>(&::ExtraDeskTypeInfo::default_instance()); } EvtGameOver::EvtGameOver(const EvtGameOver& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void EvtGameOver::SharedCtor() { _cached_size_ = 0; deskid_ = 0; status_ = 0; remain_round_num_ = 0; type_ = 0; seat_limit_ = 0; win_type_ = 0; extra_type_ = NULL; last_round_ = false; over_time_ = 0; over_reason_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } EvtGameOver::~EvtGameOver() { SharedDtor(); } void EvtGameOver::SharedDtor() { if (this != default_instance_) { delete extra_type_; } } void EvtGameOver::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EvtGameOver::descriptor() { protobuf_AssignDescriptorsOnce(); return EvtGameOver_descriptor_; } const EvtGameOver& EvtGameOver::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } EvtGameOver* EvtGameOver::default_instance_ = NULL; EvtGameOver* EvtGameOver::New() const { return new EvtGameOver; } void EvtGameOver::Clear() { if (_has_bits_[2 / 32] & (0xffu << (2 % 32))) { deskid_ = 0; status_ = 0; remain_round_num_ = 0; type_ = 0; seat_limit_ = 0; } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { win_type_ = 0; if (has_extra_type()) { if (extra_type_ != NULL) extra_type_->::ExtraDeskTypeInfo::Clear(); } last_round_ = false; over_time_ = 0; over_reason_ = 0; } winners_.Clear(); result_.Clear(); bird_card_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool EvtGameOver::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated int32 winners = 1 [packed = true]; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_winners()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 10, input, this->mutable_winners()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_result; break; } // repeated .GameOverResultInfo result = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_result: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_result())); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_result; if (input->ExpectTag(24)) goto parse_deskid; break; } // optional int32 deskid = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_deskid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &deskid_))); set_has_deskid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_status; break; } // optional int32 status = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &status_))); set_has_status(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_remain_round_num; break; } // optional int32 remain_round_num = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_remain_round_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &remain_round_num_))); set_has_remain_round_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(50)) goto parse_bird_card; break; } // repeated int32 bird_card = 6 [packed = true]; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_bird_card: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_bird_card()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 50, input, this->mutable_bird_card()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_type; break; } // optional int32 type = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &type_))); set_has_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(64)) goto parse_seat_limit; break; } // optional int32 seat_limit = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_seat_limit: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &seat_limit_))); set_has_seat_limit(); } else { goto handle_uninterpreted; } if (input->ExpectTag(72)) goto parse_win_type; break; } // optional int32 win_type = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_win_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &win_type_))); set_has_win_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(82)) goto parse_extra_type; break; } // optional .ExtraDeskTypeInfo extra_type = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_extra_type: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_extra_type())); } else { goto handle_uninterpreted; } if (input->ExpectTag(88)) goto parse_last_round; break; } // optional bool last_round = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_last_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &last_round_))); set_has_last_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(96)) goto parse_over_time; break; } // optional int32 over_time = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_over_time: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &over_time_))); set_has_over_time(); } else { goto handle_uninterpreted; } if (input->ExpectTag(104)) goto parse_over_reason; break; } // optional int32 over_reason = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_over_reason: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &over_reason_))); set_has_over_reason(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void EvtGameOver::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // repeated int32 winners = 1 [packed = true]; if (this->winners_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_winners_cached_byte_size_); } for (int i = 0; i < this->winners_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->winners(i), output); } // repeated .GameOverResultInfo result = 2; for (int i = 0; i < this->result_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2, this->result(i), output); } // optional int32 deskid = 3; if (has_deskid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->deskid(), output); } // optional int32 status = 4; if (has_status()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->status(), output); } // optional int32 remain_round_num = 5; if (has_remain_round_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->remain_round_num(), output); } // repeated int32 bird_card = 6 [packed = true]; if (this->bird_card_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_bird_card_cached_byte_size_); } for (int i = 0; i < this->bird_card_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->bird_card(i), output); } // optional int32 type = 7; if (has_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->type(), output); } // optional int32 seat_limit = 8; if (has_seat_limit()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->seat_limit(), output); } // optional int32 win_type = 9; if (has_win_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->win_type(), output); } // optional .ExtraDeskTypeInfo extra_type = 10; if (has_extra_type()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 10, this->extra_type(), output); } // optional bool last_round = 11; if (has_last_round()) { ::google::protobuf::internal::WireFormatLite::WriteBool(11, this->last_round(), output); } // optional int32 over_time = 12; if (has_over_time()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->over_time(), output); } // optional int32 over_reason = 13; if (has_over_reason()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->over_reason(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* EvtGameOver::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // repeated int32 winners = 1 [packed = true]; if (this->winners_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _winners_cached_byte_size_, target); } for (int i = 0; i < this->winners_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->winners(i), target); } // repeated .GameOverResultInfo result = 2; for (int i = 0; i < this->result_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 2, this->result(i), target); } // optional int32 deskid = 3; if (has_deskid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->deskid(), target); } // optional int32 status = 4; if (has_status()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->status(), target); } // optional int32 remain_round_num = 5; if (has_remain_round_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->remain_round_num(), target); } // repeated int32 bird_card = 6 [packed = true]; if (this->bird_card_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _bird_card_cached_byte_size_, target); } for (int i = 0; i < this->bird_card_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->bird_card(i), target); } // optional int32 type = 7; if (has_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->type(), target); } // optional int32 seat_limit = 8; if (has_seat_limit()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->seat_limit(), target); } // optional int32 win_type = 9; if (has_win_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->win_type(), target); } // optional .ExtraDeskTypeInfo extra_type = 10; if (has_extra_type()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 10, this->extra_type(), target); } // optional bool last_round = 11; if (has_last_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(11, this->last_round(), target); } // optional int32 over_time = 12; if (has_over_time()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->over_time(), target); } // optional int32 over_reason = 13; if (has_over_reason()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->over_reason(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int EvtGameOver::ByteSize() const { int total_size = 0; if (_has_bits_[2 / 32] & (0xffu << (2 % 32))) { // optional int32 deskid = 3; if (has_deskid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->deskid()); } // optional int32 status = 4; if (has_status()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->status()); } // optional int32 remain_round_num = 5; if (has_remain_round_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->remain_round_num()); } // optional int32 type = 7; if (has_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->type()); } // optional int32 seat_limit = 8; if (has_seat_limit()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->seat_limit()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional int32 win_type = 9; if (has_win_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->win_type()); } // optional .ExtraDeskTypeInfo extra_type = 10; if (has_extra_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->extra_type()); } // optional bool last_round = 11; if (has_last_round()) { total_size += 1 + 1; } // optional int32 over_time = 12; if (has_over_time()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->over_time()); } // optional int32 over_reason = 13; if (has_over_reason()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->over_reason()); } } // repeated int32 winners = 1 [packed = true]; { int data_size = 0; for (int i = 0; i < this->winners_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->winners(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _winners_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated .GameOverResultInfo result = 2; total_size += 1 * this->result_size(); for (int i = 0; i < this->result_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->result(i)); } // repeated int32 bird_card = 6 [packed = true]; { int data_size = 0; for (int i = 0; i < this->bird_card_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->bird_card(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _bird_card_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 EvtGameOver::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const EvtGameOver* source = ::google::protobuf::internal::dynamic_cast_if_available<const EvtGameOver*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void EvtGameOver::MergeFrom(const EvtGameOver& from) { GOOGLE_CHECK_NE(&from, this); winners_.MergeFrom(from.winners_); result_.MergeFrom(from.result_); bird_card_.MergeFrom(from.bird_card_); if (from._has_bits_[2 / 32] & (0xffu << (2 % 32))) { if (from.has_deskid()) { set_deskid(from.deskid()); } if (from.has_status()) { set_status(from.status()); } if (from.has_remain_round_num()) { set_remain_round_num(from.remain_round_num()); } if (from.has_type()) { set_type(from.type()); } if (from.has_seat_limit()) { set_seat_limit(from.seat_limit()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_win_type()) { set_win_type(from.win_type()); } if (from.has_extra_type()) { mutable_extra_type()->::ExtraDeskTypeInfo::MergeFrom(from.extra_type()); } if (from.has_last_round()) { set_last_round(from.last_round()); } if (from.has_over_time()) { set_over_time(from.over_time()); } if (from.has_over_reason()) { set_over_reason(from.over_reason()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void EvtGameOver::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void EvtGameOver::CopyFrom(const EvtGameOver& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool EvtGameOver::IsInitialized() const { return true; } void EvtGameOver::Swap(EvtGameOver* other) { if (other != this) { winners_.Swap(&other->winners_); result_.Swap(&other->result_); std::swap(deskid_, other->deskid_); std::swap(status_, other->status_); std::swap(remain_round_num_, other->remain_round_num_); bird_card_.Swap(&other->bird_card_); std::swap(type_, other->type_); std::swap(seat_limit_, other->seat_limit_); std::swap(win_type_, other->win_type_); std::swap(extra_type_, other->extra_type_); std::swap(last_round_, other->last_round_); std::swap(over_time_, other->over_time_); std::swap(over_reason_, other->over_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 EvtGameOver::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = EvtGameOver_descriptor_; metadata.reflection = EvtGameOver_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int RecordInfo::kUinFieldNumber; const int RecordInfo::kRoleFieldNumber; const int RecordInfo::kChipsFieldNumber; const int RecordInfo::kRoundWinChipsFieldNumber; const int RecordInfo::kRoundChiNumFieldNumber; const int RecordInfo::kRoundPengNumFieldNumber; const int RecordInfo::kRoundGangListFieldNumber; const int RecordInfo::kRoundHuListFieldNumber; const int RecordInfo::kRoundWinListFieldNumber; const int RecordInfo::kTotalChiNumFieldNumber; const int RecordInfo::kTotalPengNumFieldNumber; const int RecordInfo::kTotalGangListFieldNumber; const int RecordInfo::kTotalHuListFieldNumber; const int RecordInfo::kTotalWinListFieldNumber; const int RecordInfo::kPiaofenFieldNumber; const int RecordInfo::kShanghuoFieldNumber; const int RecordInfo::kBirdNumFieldNumber; const int RecordInfo::kCardsFieldNumber; const int RecordInfo::kOutCardsFieldNumber; const int RecordInfo::kOpListFieldNumber; const int RecordInfo::kOverChipsDetailsFieldNumber; const int RecordInfo::kRoundWinChipsBeforeFieldNumber; const int RecordInfo::kNickFieldNumber; const int RecordInfo::kSeatidFieldNumber; const int RecordInfo::kSexFieldNumber; const int RecordInfo::kPortraitFieldNumber; #endif // !_MSC_VER RecordInfo::RecordInfo() : ::google::protobuf::Message() { SharedCtor(); } void RecordInfo::InitAsDefaultInstance() { } RecordInfo::RecordInfo(const RecordInfo& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void RecordInfo::SharedCtor() { _cached_size_ = 0; uin_ = 0; role_ = 0; chips_ = GOOGLE_LONGLONG(0); round_win_chips_ = 0; round_chi_num_ = 0; round_peng_num_ = 0; total_chi_num_ = 0; total_peng_num_ = 0; piaofen_ = 0; shanghuo_ = 0; bird_num_ = 0; round_win_chips_before_ = 0; nick_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); seatid_ = 0; sex_ = 0; portrait_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } RecordInfo::~RecordInfo() { SharedDtor(); } void RecordInfo::SharedDtor() { if (nick_ != &::google::protobuf::internal::kEmptyString) { delete nick_; } if (portrait_ != &::google::protobuf::internal::kEmptyString) { delete portrait_; } if (this != default_instance_) { } } void RecordInfo::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* RecordInfo::descriptor() { protobuf_AssignDescriptorsOnce(); return RecordInfo_descriptor_; } const RecordInfo& RecordInfo::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } RecordInfo* RecordInfo::default_instance_ = NULL; RecordInfo* RecordInfo::New() const { return new RecordInfo; } void RecordInfo::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; role_ = 0; chips_ = GOOGLE_LONGLONG(0); round_win_chips_ = 0; round_chi_num_ = 0; round_peng_num_ = 0; } if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) { total_chi_num_ = 0; total_peng_num_ = 0; piaofen_ = 0; shanghuo_ = 0; } if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { bird_num_ = 0; round_win_chips_before_ = 0; if (has_nick()) { if (nick_ != &::google::protobuf::internal::kEmptyString) { nick_->clear(); } } seatid_ = 0; } if (_has_bits_[24 / 32] & (0xffu << (24 % 32))) { sex_ = 0; if (has_portrait()) { if (portrait_ != &::google::protobuf::internal::kEmptyString) { portrait_->clear(); } } } round_gang_list_.Clear(); round_hu_list_.Clear(); round_win_list_.Clear(); total_gang_list_.Clear(); total_hu_list_.Clear(); total_win_list_.Clear(); cards_.Clear(); out_cards_.Clear(); op_list_.Clear(); over_chips_details_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool RecordInfo::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_role; break; } // optional int32 role = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_role: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &role_))); set_has_role(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_chips; break; } // optional int64 chips = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_chips: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, &chips_))); set_has_chips(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_round_win_chips; break; } // optional int32 round_win_chips = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_win_chips: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_win_chips_))); set_has_round_win_chips(); } else { goto handle_uninterpreted; } if (input->ExpectTag(40)) goto parse_round_chi_num; break; } // optional int32 round_chi_num = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_chi_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_chi_num_))); set_has_round_chi_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_round_peng_num; break; } // optional int32 round_peng_num = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_peng_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_peng_num_))); set_has_round_peng_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_round_gang_list; break; } // repeated int32 round_gang_list = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_gang_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 56, input, this->mutable_round_gang_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_round_gang_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(56)) goto parse_round_gang_list; if (input->ExpectTag(64)) goto parse_round_hu_list; break; } // repeated int32 round_hu_list = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_hu_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 64, input, this->mutable_round_hu_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_round_hu_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(64)) goto parse_round_hu_list; if (input->ExpectTag(72)) goto parse_round_win_list; break; } // repeated int32 round_win_list = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_win_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 72, input, this->mutable_round_win_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_round_win_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(72)) goto parse_round_win_list; if (input->ExpectTag(80)) goto parse_total_chi_num; break; } // optional int32 total_chi_num = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_chi_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_chi_num_))); set_has_total_chi_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(88)) goto parse_total_peng_num; break; } // optional int32 total_peng_num = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_peng_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &total_peng_num_))); set_has_total_peng_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(96)) goto parse_total_gang_list; break; } // repeated int32 total_gang_list = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_gang_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 96, input, this->mutable_total_gang_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_total_gang_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(96)) goto parse_total_gang_list; if (input->ExpectTag(104)) goto parse_total_hu_list; break; } // repeated int32 total_hu_list = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_hu_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 104, input, this->mutable_total_hu_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_total_hu_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(104)) goto parse_total_hu_list; if (input->ExpectTag(112)) goto parse_total_win_list; break; } // repeated int32 total_win_list = 14; case 14: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_total_win_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 112, input, this->mutable_total_win_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_total_win_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(112)) goto parse_total_win_list; if (input->ExpectTag(120)) goto parse_piaofen; break; } // optional int32 piaofen = 15; case 15: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_piaofen: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &piaofen_))); set_has_piaofen(); } else { goto handle_uninterpreted; } if (input->ExpectTag(128)) goto parse_shanghuo; break; } // optional int32 shanghuo = 16; case 16: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_shanghuo: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &shanghuo_))); set_has_shanghuo(); } else { goto handle_uninterpreted; } if (input->ExpectTag(136)) goto parse_bird_num; break; } // optional int32 bird_num = 17; case 17: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_bird_num: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &bird_num_))); set_has_bird_num(); } else { goto handle_uninterpreted; } if (input->ExpectTag(144)) goto parse_cards; break; } // repeated int32 cards = 18; case 18: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2, 144, input, this->mutable_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(144)) goto parse_cards; if (input->ExpectTag(152)) goto parse_out_cards; break; } // repeated int32 out_cards = 19; case 19: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_out_cards: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2, 152, input, this->mutable_out_cards()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_out_cards()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(152)) goto parse_out_cards; if (input->ExpectTag(160)) goto parse_op_list; break; } // repeated int32 op_list = 20; case 20: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_list: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2, 160, input, this->mutable_op_list()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_op_list()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(160)) goto parse_op_list; if (input->ExpectTag(168)) goto parse_over_chips_details; break; } // repeated int32 over_chips_details = 21; case 21: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_over_chips_details: DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2, 168, input, this->mutable_over_chips_details()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_LENGTH_DELIMITED) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_over_chips_details()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(168)) goto parse_over_chips_details; if (input->ExpectTag(176)) goto parse_round_win_chips_before; break; } // optional int32 round_win_chips_before = 22; case 22: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_round_win_chips_before: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &round_win_chips_before_))); set_has_round_win_chips_before(); } else { goto handle_uninterpreted; } if (input->ExpectTag(186)) goto parse_nick; break; } // optional string nick = 23; case 23: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_nick: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_nick())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(192)) goto parse_seatid; break; } // optional int32 seatid = 24; case 24: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_seatid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &seatid_))); set_has_seatid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(200)) goto parse_sex; break; } // optional int32 sex = 25; case 25: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_sex: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &sex_))); set_has_sex(); } else { goto handle_uninterpreted; } if (input->ExpectTag(210)) goto parse_portrait; break; } // optional string portrait = 26; case 26: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_portrait: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_portrait())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void RecordInfo::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional int32 role = 2; if (has_role()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->role(), output); } // optional int64 chips = 3; if (has_chips()) { ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->chips(), output); } // optional int32 round_win_chips = 4; if (has_round_win_chips()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->round_win_chips(), output); } // optional int32 round_chi_num = 5; if (has_round_chi_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->round_chi_num(), output); } // optional int32 round_peng_num = 6; if (has_round_peng_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->round_peng_num(), output); } // repeated int32 round_gang_list = 7; for (int i = 0; i < this->round_gang_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 7, this->round_gang_list(i), output); } // repeated int32 round_hu_list = 8; for (int i = 0; i < this->round_hu_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 8, this->round_hu_list(i), output); } // repeated int32 round_win_list = 9; for (int i = 0; i < this->round_win_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 9, this->round_win_list(i), output); } // optional int32 total_chi_num = 10; if (has_total_chi_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(10, this->total_chi_num(), output); } // optional int32 total_peng_num = 11; if (has_total_peng_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(11, this->total_peng_num(), output); } // repeated int32 total_gang_list = 12; for (int i = 0; i < this->total_gang_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 12, this->total_gang_list(i), output); } // repeated int32 total_hu_list = 13; for (int i = 0; i < this->total_hu_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 13, this->total_hu_list(i), output); } // repeated int32 total_win_list = 14; for (int i = 0; i < this->total_win_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 14, this->total_win_list(i), output); } // optional int32 piaofen = 15; if (has_piaofen()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(15, this->piaofen(), output); } // optional int32 shanghuo = 16; if (has_shanghuo()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(16, this->shanghuo(), output); } // optional int32 bird_num = 17; if (has_bird_num()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->bird_num(), output); } // repeated int32 cards = 18; for (int i = 0; i < this->cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 18, this->cards(i), output); } // repeated int32 out_cards = 19; for (int i = 0; i < this->out_cards_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 19, this->out_cards(i), output); } // repeated int32 op_list = 20; for (int i = 0; i < this->op_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 20, this->op_list(i), output); } // repeated int32 over_chips_details = 21; for (int i = 0; i < this->over_chips_details_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32( 21, this->over_chips_details(i), output); } // optional int32 round_win_chips_before = 22; if (has_round_win_chips_before()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(22, this->round_win_chips_before(), output); } // optional string nick = 23; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 23, this->nick(), output); } // optional int32 seatid = 24; if (has_seatid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(24, this->seatid(), output); } // optional int32 sex = 25; if (has_sex()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(25, this->sex(), output); } // optional string portrait = 26; if (has_portrait()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 26, this->portrait(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* RecordInfo::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional int32 role = 2; if (has_role()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->role(), target); } // optional int64 chips = 3; if (has_chips()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->chips(), target); } // optional int32 round_win_chips = 4; if (has_round_win_chips()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->round_win_chips(), target); } // optional int32 round_chi_num = 5; if (has_round_chi_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->round_chi_num(), target); } // optional int32 round_peng_num = 6; if (has_round_peng_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->round_peng_num(), target); } // repeated int32 round_gang_list = 7; for (int i = 0; i < this->round_gang_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(7, this->round_gang_list(i), target); } // repeated int32 round_hu_list = 8; for (int i = 0; i < this->round_hu_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(8, this->round_hu_list(i), target); } // repeated int32 round_win_list = 9; for (int i = 0; i < this->round_win_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(9, this->round_win_list(i), target); } // optional int32 total_chi_num = 10; if (has_total_chi_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(10, this->total_chi_num(), target); } // optional int32 total_peng_num = 11; if (has_total_peng_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(11, this->total_peng_num(), target); } // repeated int32 total_gang_list = 12; for (int i = 0; i < this->total_gang_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(12, this->total_gang_list(i), target); } // repeated int32 total_hu_list = 13; for (int i = 0; i < this->total_hu_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(13, this->total_hu_list(i), target); } // repeated int32 total_win_list = 14; for (int i = 0; i < this->total_win_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(14, this->total_win_list(i), target); } // optional int32 piaofen = 15; if (has_piaofen()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(15, this->piaofen(), target); } // optional int32 shanghuo = 16; if (has_shanghuo()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(16, this->shanghuo(), target); } // optional int32 bird_num = 17; if (has_bird_num()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(17, this->bird_num(), target); } // repeated int32 cards = 18; for (int i = 0; i < this->cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(18, this->cards(i), target); } // repeated int32 out_cards = 19; for (int i = 0; i < this->out_cards_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(19, this->out_cards(i), target); } // repeated int32 op_list = 20; for (int i = 0; i < this->op_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(20, this->op_list(i), target); } // repeated int32 over_chips_details = 21; for (int i = 0; i < this->over_chips_details_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32ToArray(21, this->over_chips_details(i), target); } // optional int32 round_win_chips_before = 22; if (has_round_win_chips_before()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(22, this->round_win_chips_before(), target); } // optional string nick = 23; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 23, this->nick(), target); } // optional int32 seatid = 24; if (has_seatid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(24, this->seatid(), target); } // optional int32 sex = 25; if (has_sex()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(25, this->sex(), target); } // optional string portrait = 26; if (has_portrait()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->portrait().data(), this->portrait().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 26, this->portrait(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int RecordInfo::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional int32 role = 2; if (has_role()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->role()); } // optional int64 chips = 3; if (has_chips()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( this->chips()); } // optional int32 round_win_chips = 4; if (has_round_win_chips()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_win_chips()); } // optional int32 round_chi_num = 5; if (has_round_chi_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_chi_num()); } // optional int32 round_peng_num = 6; if (has_round_peng_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_peng_num()); } } if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) { // optional int32 total_chi_num = 10; if (has_total_chi_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_chi_num()); } // optional int32 total_peng_num = 11; if (has_total_peng_num()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->total_peng_num()); } // optional int32 piaofen = 15; if (has_piaofen()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->piaofen()); } // optional int32 shanghuo = 16; if (has_shanghuo()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->shanghuo()); } } if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { // optional int32 bird_num = 17; if (has_bird_num()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->bird_num()); } // optional int32 round_win_chips_before = 22; if (has_round_win_chips_before()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->round_win_chips_before()); } // optional string nick = 23; if (has_nick()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this->nick()); } // optional int32 seatid = 24; if (has_seatid()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->seatid()); } } if (_has_bits_[24 / 32] & (0xffu << (24 % 32))) { // optional int32 sex = 25; if (has_sex()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->sex()); } // optional string portrait = 26; if (has_portrait()) { total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize( this->portrait()); } } // repeated int32 round_gang_list = 7; { int data_size = 0; for (int i = 0; i < this->round_gang_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->round_gang_list(i)); } total_size += 1 * this->round_gang_list_size() + data_size; } // repeated int32 round_hu_list = 8; { int data_size = 0; for (int i = 0; i < this->round_hu_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->round_hu_list(i)); } total_size += 1 * this->round_hu_list_size() + data_size; } // repeated int32 round_win_list = 9; { int data_size = 0; for (int i = 0; i < this->round_win_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->round_win_list(i)); } total_size += 1 * this->round_win_list_size() + data_size; } // repeated int32 total_gang_list = 12; { int data_size = 0; for (int i = 0; i < this->total_gang_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->total_gang_list(i)); } total_size += 1 * this->total_gang_list_size() + data_size; } // repeated int32 total_hu_list = 13; { int data_size = 0; for (int i = 0; i < this->total_hu_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->total_hu_list(i)); } total_size += 1 * this->total_hu_list_size() + data_size; } // repeated int32 total_win_list = 14; { int data_size = 0; for (int i = 0; i < this->total_win_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->total_win_list(i)); } total_size += 1 * this->total_win_list_size() + data_size; } // repeated int32 cards = 18; { int data_size = 0; for (int i = 0; i < this->cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->cards(i)); } total_size += 2 * this->cards_size() + data_size; } // repeated int32 out_cards = 19; { int data_size = 0; for (int i = 0; i < this->out_cards_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->out_cards(i)); } total_size += 2 * this->out_cards_size() + data_size; } // repeated int32 op_list = 20; { int data_size = 0; for (int i = 0; i < this->op_list_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->op_list(i)); } total_size += 2 * this->op_list_size() + data_size; } // repeated int32 over_chips_details = 21; { int data_size = 0; for (int i = 0; i < this->over_chips_details_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->over_chips_details(i)); } total_size += 2 * this->over_chips_details_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 RecordInfo::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const RecordInfo* source = ::google::protobuf::internal::dynamic_cast_if_available<const RecordInfo*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void RecordInfo::MergeFrom(const RecordInfo& from) { GOOGLE_CHECK_NE(&from, this); round_gang_list_.MergeFrom(from.round_gang_list_); round_hu_list_.MergeFrom(from.round_hu_list_); round_win_list_.MergeFrom(from.round_win_list_); total_gang_list_.MergeFrom(from.total_gang_list_); total_hu_list_.MergeFrom(from.total_hu_list_); total_win_list_.MergeFrom(from.total_win_list_); cards_.MergeFrom(from.cards_); out_cards_.MergeFrom(from.out_cards_); op_list_.MergeFrom(from.op_list_); over_chips_details_.MergeFrom(from.over_chips_details_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_role()) { set_role(from.role()); } if (from.has_chips()) { set_chips(from.chips()); } if (from.has_round_win_chips()) { set_round_win_chips(from.round_win_chips()); } if (from.has_round_chi_num()) { set_round_chi_num(from.round_chi_num()); } if (from.has_round_peng_num()) { set_round_peng_num(from.round_peng_num()); } } if (from._has_bits_[9 / 32] & (0xffu << (9 % 32))) { if (from.has_total_chi_num()) { set_total_chi_num(from.total_chi_num()); } if (from.has_total_peng_num()) { set_total_peng_num(from.total_peng_num()); } if (from.has_piaofen()) { set_piaofen(from.piaofen()); } if (from.has_shanghuo()) { set_shanghuo(from.shanghuo()); } } if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { if (from.has_bird_num()) { set_bird_num(from.bird_num()); } if (from.has_round_win_chips_before()) { set_round_win_chips_before(from.round_win_chips_before()); } if (from.has_nick()) { set_nick(from.nick()); } if (from.has_seatid()) { set_seatid(from.seatid()); } } if (from._has_bits_[24 / 32] & (0xffu << (24 % 32))) { if (from.has_sex()) { set_sex(from.sex()); } if (from.has_portrait()) { set_portrait(from.portrait()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void RecordInfo::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void RecordInfo::CopyFrom(const RecordInfo& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool RecordInfo::IsInitialized() const { return true; } void RecordInfo::Swap(RecordInfo* other) { if (other != this) { std::swap(uin_, other->uin_); std::swap(role_, other->role_); std::swap(chips_, other->chips_); std::swap(round_win_chips_, other->round_win_chips_); std::swap(round_chi_num_, other->round_chi_num_); std::swap(round_peng_num_, other->round_peng_num_); round_gang_list_.Swap(&other->round_gang_list_); round_hu_list_.Swap(&other->round_hu_list_); round_win_list_.Swap(&other->round_win_list_); std::swap(total_chi_num_, other->total_chi_num_); std::swap(total_peng_num_, other->total_peng_num_); total_gang_list_.Swap(&other->total_gang_list_); total_hu_list_.Swap(&other->total_hu_list_); total_win_list_.Swap(&other->total_win_list_); std::swap(piaofen_, other->piaofen_); std::swap(shanghuo_, other->shanghuo_); std::swap(bird_num_, other->bird_num_); cards_.Swap(&other->cards_); out_cards_.Swap(&other->out_cards_); op_list_.Swap(&other->op_list_); over_chips_details_.Swap(&other->over_chips_details_); std::swap(round_win_chips_before_, other->round_win_chips_before_); std::swap(nick_, other->nick_); std::swap(seatid_, other->seatid_); std::swap(sex_, other->sex_); std::swap(portrait_, other->portrait_); 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 RecordInfo::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = RecordInfo_descriptor_; metadata.reflection = RecordInfo_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int PerPlayRecord::kRoundidFieldNumber; const int PerPlayRecord::kResultFieldNumber; const int PerPlayRecord::kDeskidFieldNumber; const int PerPlayRecord::kGameRoundFieldNumber; const int PerPlayRecord::kDeskRoundFieldNumber; const int PerPlayRecord::kBirdCardFieldNumber; const int PerPlayRecord::kTypeFieldNumber; const int PerPlayRecord::kSeatLimitFieldNumber; const int PerPlayRecord::kWinTypeFieldNumber; const int PerPlayRecord::kExtraTypeFieldNumber; const int PerPlayRecord::kOverTimeFieldNumber; const int PerPlayRecord::kMasterUinFieldNumber; const int PerPlayRecord::kWinnersFieldNumber; #endif // !_MSC_VER PerPlayRecord::PerPlayRecord() : ::google::protobuf::Message() { SharedCtor(); } void PerPlayRecord::InitAsDefaultInstance() { extra_type_ = const_cast< ::ExtraDeskTypeInfo*>(&::ExtraDeskTypeInfo::default_instance()); } PerPlayRecord::PerPlayRecord(const PerPlayRecord& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void PerPlayRecord::SharedCtor() { _cached_size_ = 0; roundid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); deskid_ = 0; game_round_ = 0; desk_round_ = 0; type_ = 0; seat_limit_ = 0; win_type_ = 0; extra_type_ = NULL; over_time_ = 0; master_uin_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } PerPlayRecord::~PerPlayRecord() { SharedDtor(); } void PerPlayRecord::SharedDtor() { if (roundid_ != &::google::protobuf::internal::kEmptyString) { delete roundid_; } if (this != default_instance_) { delete extra_type_; } } void PerPlayRecord::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* PerPlayRecord::descriptor() { protobuf_AssignDescriptorsOnce(); return PerPlayRecord_descriptor_; } const PerPlayRecord& PerPlayRecord::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } PerPlayRecord* PerPlayRecord::default_instance_ = NULL; PerPlayRecord* PerPlayRecord::New() const { return new PerPlayRecord; } void PerPlayRecord::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_roundid()) { if (roundid_ != &::google::protobuf::internal::kEmptyString) { roundid_->clear(); } } deskid_ = 0; game_round_ = 0; desk_round_ = 0; type_ = 0; seat_limit_ = 0; } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { win_type_ = 0; if (has_extra_type()) { if (extra_type_ != NULL) extra_type_->::ExtraDeskTypeInfo::Clear(); } over_time_ = 0; master_uin_ = 0; } result_.Clear(); bird_card_.Clear(); winners_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool PerPlayRecord::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string roundid = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_roundid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->roundid().data(), this->roundid().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_result; break; } // repeated .RecordInfo result = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_result: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_result())); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_result; if (input->ExpectTag(24)) goto parse_deskid; break; } // optional int32 deskid = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_deskid: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &deskid_))); set_has_deskid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_game_round; break; } // optional int32 game_round = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_game_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &game_round_))); set_has_game_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(48)) goto parse_desk_round; break; } // optional int32 desk_round = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_desk_round: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &desk_round_))); set_has_desk_round(); } else { goto handle_uninterpreted; } if (input->ExpectTag(58)) goto parse_bird_card; break; } // repeated int32 bird_card = 7 [packed = true]; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_bird_card: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_bird_card()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 58, input, this->mutable_bird_card()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(64)) goto parse_type; break; } // optional int32 type = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &type_))); set_has_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(72)) goto parse_seat_limit; break; } // optional int32 seat_limit = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_seat_limit: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &seat_limit_))); set_has_seat_limit(); } else { goto handle_uninterpreted; } if (input->ExpectTag(80)) goto parse_win_type; break; } // optional int32 win_type = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_win_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &win_type_))); set_has_win_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(90)) goto parse_extra_type; break; } // optional .ExtraDeskTypeInfo extra_type = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_extra_type: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_extra_type())); } else { goto handle_uninterpreted; } if (input->ExpectTag(96)) goto parse_over_time; break; } // optional int32 over_time = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_over_time: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &over_time_))); set_has_over_time(); } else { goto handle_uninterpreted; } if (input->ExpectTag(104)) goto parse_master_uin; break; } // optional int32 master_uin = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_master_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &master_uin_))); set_has_master_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(114)) goto parse_winners; break; } // repeated int32 winners = 14 [packed = true]; case 14: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_winners: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_winners()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 114, input, this->mutable_winners()))); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void PerPlayRecord::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional string roundid = 1; if (has_roundid()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->roundid().data(), this->roundid().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 1, this->roundid(), output); } // repeated .RecordInfo result = 2; for (int i = 0; i < this->result_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2, this->result(i), output); } // optional int32 deskid = 3; if (has_deskid()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->deskid(), output); } // optional int32 game_round = 4; if (has_game_round()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->game_round(), output); } // optional int32 desk_round = 6; if (has_desk_round()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->desk_round(), output); } // repeated int32 bird_card = 7 [packed = true]; if (this->bird_card_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_bird_card_cached_byte_size_); } for (int i = 0; i < this->bird_card_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->bird_card(i), output); } // optional int32 type = 8; if (has_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->type(), output); } // optional int32 seat_limit = 9; if (has_seat_limit()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->seat_limit(), output); } // optional int32 win_type = 10; if (has_win_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(10, this->win_type(), output); } // optional .ExtraDeskTypeInfo extra_type = 11; if (has_extra_type()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 11, this->extra_type(), output); } // optional int32 over_time = 12; if (has_over_time()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->over_time(), output); } // optional int32 master_uin = 13; if (has_master_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(13, this->master_uin(), output); } // repeated int32 winners = 14 [packed = true]; if (this->winners_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(14, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_winners_cached_byte_size_); } for (int i = 0; i < this->winners_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->winners(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* PerPlayRecord::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional string roundid = 1; if (has_roundid()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->roundid().data(), this->roundid().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->roundid(), target); } // repeated .RecordInfo result = 2; for (int i = 0; i < this->result_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 2, this->result(i), target); } // optional int32 deskid = 3; if (has_deskid()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->deskid(), target); } // optional int32 game_round = 4; if (has_game_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->game_round(), target); } // optional int32 desk_round = 6; if (has_desk_round()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->desk_round(), target); } // repeated int32 bird_card = 7 [packed = true]; if (this->bird_card_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _bird_card_cached_byte_size_, target); } for (int i = 0; i < this->bird_card_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->bird_card(i), target); } // optional int32 type = 8; if (has_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->type(), target); } // optional int32 seat_limit = 9; if (has_seat_limit()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->seat_limit(), target); } // optional int32 win_type = 10; if (has_win_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(10, this->win_type(), target); } // optional .ExtraDeskTypeInfo extra_type = 11; if (has_extra_type()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 11, this->extra_type(), target); } // optional int32 over_time = 12; if (has_over_time()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->over_time(), target); } // optional int32 master_uin = 13; if (has_master_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(13, this->master_uin(), target); } // repeated int32 winners = 14 [packed = true]; if (this->winners_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 14, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _winners_cached_byte_size_, target); } for (int i = 0; i < this->winners_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->winners(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int PerPlayRecord::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string roundid = 1; if (has_roundid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->roundid()); } // optional int32 deskid = 3; if (has_deskid()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->deskid()); } // optional int32 game_round = 4; if (has_game_round()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->game_round()); } // optional int32 desk_round = 6; if (has_desk_round()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->desk_round()); } // optional int32 type = 8; if (has_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->type()); } // optional int32 seat_limit = 9; if (has_seat_limit()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->seat_limit()); } } if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { // optional int32 win_type = 10; if (has_win_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->win_type()); } // optional .ExtraDeskTypeInfo extra_type = 11; if (has_extra_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->extra_type()); } // optional int32 over_time = 12; if (has_over_time()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->over_time()); } // optional int32 master_uin = 13; if (has_master_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->master_uin()); } } // repeated .RecordInfo result = 2; total_size += 1 * this->result_size(); for (int i = 0; i < this->result_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->result(i)); } // repeated int32 bird_card = 7 [packed = true]; { int data_size = 0; for (int i = 0; i < this->bird_card_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->bird_card(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _bird_card_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated int32 winners = 14 [packed = true]; { int data_size = 0; for (int i = 0; i < this->winners_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->winners(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _winners_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 PerPlayRecord::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const PerPlayRecord* source = ::google::protobuf::internal::dynamic_cast_if_available<const PerPlayRecord*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void PerPlayRecord::MergeFrom(const PerPlayRecord& from) { GOOGLE_CHECK_NE(&from, this); result_.MergeFrom(from.result_); bird_card_.MergeFrom(from.bird_card_); winners_.MergeFrom(from.winners_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_roundid()) { set_roundid(from.roundid()); } if (from.has_deskid()) { set_deskid(from.deskid()); } if (from.has_game_round()) { set_game_round(from.game_round()); } if (from.has_desk_round()) { set_desk_round(from.desk_round()); } if (from.has_type()) { set_type(from.type()); } if (from.has_seat_limit()) { set_seat_limit(from.seat_limit()); } } if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { if (from.has_win_type()) { set_win_type(from.win_type()); } if (from.has_extra_type()) { mutable_extra_type()->::ExtraDeskTypeInfo::MergeFrom(from.extra_type()); } if (from.has_over_time()) { set_over_time(from.over_time()); } if (from.has_master_uin()) { set_master_uin(from.master_uin()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void PerPlayRecord::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void PerPlayRecord::CopyFrom(const PerPlayRecord& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool PerPlayRecord::IsInitialized() const { return true; } void PerPlayRecord::Swap(PerPlayRecord* other) { if (other != this) { std::swap(roundid_, other->roundid_); result_.Swap(&other->result_); std::swap(deskid_, other->deskid_); std::swap(game_round_, other->game_round_); std::swap(desk_round_, other->desk_round_); bird_card_.Swap(&other->bird_card_); std::swap(type_, other->type_); std::swap(seat_limit_, other->seat_limit_); std::swap(win_type_, other->win_type_); std::swap(extra_type_, other->extra_type_); std::swap(over_time_, other->over_time_); std::swap(master_uin_, other->master_uin_); winners_.Swap(&other->winners_); 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 PerPlayRecord::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = PerPlayRecord_descriptor_; metadata.reflection = PerPlayRecord_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER MyPlayRecordListReq::MyPlayRecordListReq() : ::google::protobuf::Message() { SharedCtor(); } void MyPlayRecordListReq::InitAsDefaultInstance() { } MyPlayRecordListReq::MyPlayRecordListReq(const MyPlayRecordListReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void MyPlayRecordListReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } MyPlayRecordListReq::~MyPlayRecordListReq() { SharedDtor(); } void MyPlayRecordListReq::SharedDtor() { if (this != default_instance_) { } } void MyPlayRecordListReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MyPlayRecordListReq::descriptor() { protobuf_AssignDescriptorsOnce(); return MyPlayRecordListReq_descriptor_; } const MyPlayRecordListReq& MyPlayRecordListReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } MyPlayRecordListReq* MyPlayRecordListReq::default_instance_ = NULL; MyPlayRecordListReq* MyPlayRecordListReq::New() const { return new MyPlayRecordListReq; } void MyPlayRecordListReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool MyPlayRecordListReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void MyPlayRecordListReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* MyPlayRecordListReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int MyPlayRecordListReq::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 MyPlayRecordListReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const MyPlayRecordListReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const MyPlayRecordListReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void MyPlayRecordListReq::MergeFrom(const MyPlayRecordListReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void MyPlayRecordListReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void MyPlayRecordListReq::CopyFrom(const MyPlayRecordListReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool MyPlayRecordListReq::IsInitialized() const { return true; } void MyPlayRecordListReq::Swap(MyPlayRecordListReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata MyPlayRecordListReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = MyPlayRecordListReq_descriptor_; metadata.reflection = MyPlayRecordListReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int MyPlayRecordListRsp::kRecordListFieldNumber; const int MyPlayRecordListRsp::kRetFieldNumber; #endif // !_MSC_VER MyPlayRecordListRsp::MyPlayRecordListRsp() : ::google::protobuf::Message() { SharedCtor(); } void MyPlayRecordListRsp::InitAsDefaultInstance() { } MyPlayRecordListRsp::MyPlayRecordListRsp(const MyPlayRecordListRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void MyPlayRecordListRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } MyPlayRecordListRsp::~MyPlayRecordListRsp() { SharedDtor(); } void MyPlayRecordListRsp::SharedDtor() { if (this != default_instance_) { } } void MyPlayRecordListRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* MyPlayRecordListRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return MyPlayRecordListRsp_descriptor_; } const MyPlayRecordListRsp& MyPlayRecordListRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } MyPlayRecordListRsp* MyPlayRecordListRsp::default_instance_ = NULL; MyPlayRecordListRsp* MyPlayRecordListRsp::New() const { return new MyPlayRecordListRsp; } void MyPlayRecordListRsp::Clear() { if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { ret_ = 0; } record_list_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool MyPlayRecordListRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .PerPlayRecord record_list = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_record_list: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_record_list())); } else { goto handle_uninterpreted; } if (input->ExpectTag(10)) goto parse_record_list; if (input->ExpectTag(16)) goto parse_ret; break; } // optional int32 ret = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_ret: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void MyPlayRecordListRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // repeated .PerPlayRecord record_list = 1; for (int i = 0; i < this->record_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1, this->record_list(i), output); } // optional int32 ret = 2; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* MyPlayRecordListRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // repeated .PerPlayRecord record_list = 1; for (int i = 0; i < this->record_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 1, this->record_list(i), target); } // optional int32 ret = 2; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int MyPlayRecordListRsp::ByteSize() const { int total_size = 0; if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { // optional int32 ret = 2; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } // repeated .PerPlayRecord record_list = 1; total_size += 1 * this->record_list_size(); for (int i = 0; i < this->record_list_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->record_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 MyPlayRecordListRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const MyPlayRecordListRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const MyPlayRecordListRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void MyPlayRecordListRsp::MergeFrom(const MyPlayRecordListRsp& from) { GOOGLE_CHECK_NE(&from, this); record_list_.MergeFrom(from.record_list_); if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void MyPlayRecordListRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void MyPlayRecordListRsp::CopyFrom(const MyPlayRecordListRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool MyPlayRecordListRsp::IsInitialized() const { return true; } void MyPlayRecordListRsp::Swap(MyPlayRecordListRsp* other) { if (other != this) { record_list_.Swap(&other->record_list_); std::swap(ret_, other->ret_); 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 MyPlayRecordListRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = MyPlayRecordListRsp_descriptor_; metadata.reflection = MyPlayRecordListRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int RoundPlayRecordsReq::kRoundIdFieldNumber; const int RoundPlayRecordsReq::kGameRoundIndexFieldNumber; #endif // !_MSC_VER RoundPlayRecordsReq::RoundPlayRecordsReq() : ::google::protobuf::Message() { SharedCtor(); } void RoundPlayRecordsReq::InitAsDefaultInstance() { } RoundPlayRecordsReq::RoundPlayRecordsReq(const RoundPlayRecordsReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void RoundPlayRecordsReq::SharedCtor() { _cached_size_ = 0; round_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); game_round_index_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } RoundPlayRecordsReq::~RoundPlayRecordsReq() { SharedDtor(); } void RoundPlayRecordsReq::SharedDtor() { if (round_id_ != &::google::protobuf::internal::kEmptyString) { delete round_id_; } if (this != default_instance_) { } } void RoundPlayRecordsReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* RoundPlayRecordsReq::descriptor() { protobuf_AssignDescriptorsOnce(); return RoundPlayRecordsReq_descriptor_; } const RoundPlayRecordsReq& RoundPlayRecordsReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } RoundPlayRecordsReq* RoundPlayRecordsReq::default_instance_ = NULL; RoundPlayRecordsReq* RoundPlayRecordsReq::New() const { return new RoundPlayRecordsReq; } void RoundPlayRecordsReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_round_id()) { if (round_id_ != &::google::protobuf::internal::kEmptyString) { round_id_->clear(); } } game_round_index_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool RoundPlayRecordsReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string round_id = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_round_id())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->round_id().data(), this->round_id().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_game_round_index; break; } // optional int32 game_round_index = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_game_round_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &game_round_index_))); set_has_game_round_index(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void RoundPlayRecordsReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional string round_id = 1; if (has_round_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->round_id().data(), this->round_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 1, this->round_id(), output); } // optional int32 game_round_index = 2; if (has_game_round_index()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->game_round_index(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* RoundPlayRecordsReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional string round_id = 1; if (has_round_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->round_id().data(), this->round_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->round_id(), target); } // optional int32 game_round_index = 2; if (has_game_round_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->game_round_index(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int RoundPlayRecordsReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string round_id = 1; if (has_round_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->round_id()); } // optional int32 game_round_index = 2; if (has_game_round_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->game_round_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 RoundPlayRecordsReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const RoundPlayRecordsReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const RoundPlayRecordsReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void RoundPlayRecordsReq::MergeFrom(const RoundPlayRecordsReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_round_id()) { set_round_id(from.round_id()); } if (from.has_game_round_index()) { set_game_round_index(from.game_round_index()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void RoundPlayRecordsReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void RoundPlayRecordsReq::CopyFrom(const RoundPlayRecordsReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool RoundPlayRecordsReq::IsInitialized() const { return true; } void RoundPlayRecordsReq::Swap(RoundPlayRecordsReq* other) { if (other != this) { std::swap(round_id_, other->round_id_); std::swap(game_round_index_, other->game_round_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 RoundPlayRecordsReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = RoundPlayRecordsReq_descriptor_; metadata.reflection = RoundPlayRecordsReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int RoundPlayRecordsRsp::kRecordListFieldNumber; const int RoundPlayRecordsRsp::kRetFieldNumber; #endif // !_MSC_VER RoundPlayRecordsRsp::RoundPlayRecordsRsp() : ::google::protobuf::Message() { SharedCtor(); } void RoundPlayRecordsRsp::InitAsDefaultInstance() { } RoundPlayRecordsRsp::RoundPlayRecordsRsp(const RoundPlayRecordsRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void RoundPlayRecordsRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } RoundPlayRecordsRsp::~RoundPlayRecordsRsp() { SharedDtor(); } void RoundPlayRecordsRsp::SharedDtor() { if (this != default_instance_) { } } void RoundPlayRecordsRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* RoundPlayRecordsRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return RoundPlayRecordsRsp_descriptor_; } const RoundPlayRecordsRsp& RoundPlayRecordsRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } RoundPlayRecordsRsp* RoundPlayRecordsRsp::default_instance_ = NULL; RoundPlayRecordsRsp* RoundPlayRecordsRsp::New() const { return new RoundPlayRecordsRsp; } void RoundPlayRecordsRsp::Clear() { if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { ret_ = 0; } record_list_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool RoundPlayRecordsRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .PerPlayRecord record_list = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_record_list: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_record_list())); } else { goto handle_uninterpreted; } if (input->ExpectTag(10)) goto parse_record_list; if (input->ExpectTag(16)) goto parse_ret; break; } // optional int32 ret = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_ret: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void RoundPlayRecordsRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // repeated .PerPlayRecord record_list = 1; for (int i = 0; i < this->record_list_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1, this->record_list(i), output); } // optional int32 ret = 2; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* RoundPlayRecordsRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // repeated .PerPlayRecord record_list = 1; for (int i = 0; i < this->record_list_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 1, this->record_list(i), target); } // optional int32 ret = 2; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int RoundPlayRecordsRsp::ByteSize() const { int total_size = 0; if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { // optional int32 ret = 2; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } // repeated .PerPlayRecord record_list = 1; total_size += 1 * this->record_list_size(); for (int i = 0; i < this->record_list_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->record_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 RoundPlayRecordsRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const RoundPlayRecordsRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const RoundPlayRecordsRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void RoundPlayRecordsRsp::MergeFrom(const RoundPlayRecordsRsp& from) { GOOGLE_CHECK_NE(&from, this); record_list_.MergeFrom(from.record_list_); if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void RoundPlayRecordsRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void RoundPlayRecordsRsp::CopyFrom(const RoundPlayRecordsRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool RoundPlayRecordsRsp::IsInitialized() const { return true; } void RoundPlayRecordsRsp::Swap(RoundPlayRecordsRsp* other) { if (other != this) { record_list_.Swap(&other->record_list_); std::swap(ret_, other->ret_); 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 RoundPlayRecordsRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = RoundPlayRecordsRsp_descriptor_; metadata.reflection = RoundPlayRecordsRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int DeskChatReq::kContentFieldNumber; const int DeskChatReq::kTypeFieldNumber; const int DeskChatReq::kIndexFieldNumber; #endif // !_MSC_VER DeskChatReq::DeskChatReq() : ::google::protobuf::Message() { SharedCtor(); } void DeskChatReq::InitAsDefaultInstance() { } DeskChatReq::DeskChatReq(const DeskChatReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void DeskChatReq::SharedCtor() { _cached_size_ = 0; content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); type_ = 0; index_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } DeskChatReq::~DeskChatReq() { SharedDtor(); } void DeskChatReq::SharedDtor() { if (content_ != &::google::protobuf::internal::kEmptyString) { delete content_; } if (this != default_instance_) { } } void DeskChatReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* DeskChatReq::descriptor() { protobuf_AssignDescriptorsOnce(); return DeskChatReq_descriptor_; } const DeskChatReq& DeskChatReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } DeskChatReq* DeskChatReq::default_instance_ = NULL; DeskChatReq* DeskChatReq::New() const { return new DeskChatReq; } void DeskChatReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (has_content()) { if (content_ != &::google::protobuf::internal::kEmptyString) { content_->clear(); } } type_ = 0; index_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool DeskChatReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string content = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_content())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_type; break; } // optional int32 type = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_type: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &type_))); set_has_type(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_index; break; } // optional int32 index = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &index_))); set_has_index(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void DeskChatReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional string content = 1; if (has_content()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 1, this->content(), output); } // optional int32 type = 2; if (has_type()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->type(), output); } // optional int32 index = 3; if (has_index()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->index(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* DeskChatReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional string content = 1; if (has_content()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 1, this->content(), target); } // optional int32 type = 2; if (has_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->type(), target); } // optional int32 index = 3; if (has_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->index(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int DeskChatReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional string content = 1; if (has_content()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->content()); } // optional int32 type = 2; if (has_type()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->type()); } // optional int32 index = 3; if (has_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->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 DeskChatReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const DeskChatReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const DeskChatReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void DeskChatReq::MergeFrom(const DeskChatReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_content()) { set_content(from.content()); } if (from.has_type()) { set_type(from.type()); } if (from.has_index()) { set_index(from.index()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void DeskChatReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void DeskChatReq::CopyFrom(const DeskChatReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool DeskChatReq::IsInitialized() const { return true; } void DeskChatReq::Swap(DeskChatReq* other) { if (other != this) { std::swap(content_, other->content_); std::swap(type_, other->type_); std::swap(index_, other->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 DeskChatReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = DeskChatReq_descriptor_; metadata.reflection = DeskChatReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int DeskChatEvt::kRetFieldNumber; const int DeskChatEvt::kOpUinFieldNumber; const int DeskChatEvt::kSexFieldNumber; const int DeskChatEvt::kIndexFieldNumber; const int DeskChatEvt::kContentFieldNumber; #endif // !_MSC_VER DeskChatEvt::DeskChatEvt() : ::google::protobuf::Message() { SharedCtor(); } void DeskChatEvt::InitAsDefaultInstance() { } DeskChatEvt::DeskChatEvt(const DeskChatEvt& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void DeskChatEvt::SharedCtor() { _cached_size_ = 0; ret_ = 0; op_uin_ = 0; sex_ = false; index_ = 0; content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } DeskChatEvt::~DeskChatEvt() { SharedDtor(); } void DeskChatEvt::SharedDtor() { if (content_ != &::google::protobuf::internal::kEmptyString) { delete content_; } if (this != default_instance_) { } } void DeskChatEvt::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* DeskChatEvt::descriptor() { protobuf_AssignDescriptorsOnce(); return DeskChatEvt_descriptor_; } const DeskChatEvt& DeskChatEvt::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } DeskChatEvt* DeskChatEvt::default_instance_ = NULL; DeskChatEvt* DeskChatEvt::New() const { return new DeskChatEvt; } void DeskChatEvt::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; op_uin_ = 0; sex_ = false; index_ = 0; if (has_content()) { if (content_ != &::google::protobuf::internal::kEmptyString) { content_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool DeskChatEvt::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_op_uin; break; } // optional int32 op_uin = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_op_uin: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &op_uin_))); set_has_op_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_sex; break; } // optional bool sex = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_sex: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &sex_))); set_has_sex(); } else { goto handle_uninterpreted; } if (input->ExpectTag(32)) goto parse_index; break; } // optional int32 index = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_index: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &index_))); set_has_index(); } else { goto handle_uninterpreted; } if (input->ExpectTag(42)) goto parse_content; break; } // optional string content = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_content: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_content())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void DeskChatEvt::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } // optional int32 op_uin = 2; if (has_op_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->op_uin(), output); } // optional bool sex = 3; if (has_sex()) { ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->sex(), output); } // optional int32 index = 4; if (has_index()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->index(), output); } // optional string content = 5; if (has_content()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 5, this->content(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* DeskChatEvt::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } // optional int32 op_uin = 2; if (has_op_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->op_uin(), target); } // optional bool sex = 3; if (has_sex()) { target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->sex(), target); } // optional int32 index = 4; if (has_index()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->index(), target); } // optional string content = 5; if (has_content()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 5, this->content(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int DeskChatEvt::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } // optional int32 op_uin = 2; if (has_op_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->op_uin()); } // optional bool sex = 3; if (has_sex()) { total_size += 1 + 1; } // optional int32 index = 4; if (has_index()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->index()); } // optional string content = 5; if (has_content()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->content()); } } 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 DeskChatEvt::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const DeskChatEvt* source = ::google::protobuf::internal::dynamic_cast_if_available<const DeskChatEvt*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void DeskChatEvt::MergeFrom(const DeskChatEvt& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } if (from.has_op_uin()) { set_op_uin(from.op_uin()); } if (from.has_sex()) { set_sex(from.sex()); } if (from.has_index()) { set_index(from.index()); } if (from.has_content()) { set_content(from.content()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void DeskChatEvt::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void DeskChatEvt::CopyFrom(const DeskChatEvt& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool DeskChatEvt::IsInitialized() const { return true; } void DeskChatEvt::Swap(DeskChatEvt* other) { if (other != this) { std::swap(ret_, other->ret_); std::swap(op_uin_, other->op_uin_); std::swap(sex_, other->sex_); std::swap(index_, other->index_); std::swap(content_, other->content_); 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 DeskChatEvt::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = DeskChatEvt_descriptor_; metadata.reflection = DeskChatEvt_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER LogOutReq::LogOutReq() : ::google::protobuf::Message() { SharedCtor(); } void LogOutReq::InitAsDefaultInstance() { } LogOutReq::LogOutReq(const LogOutReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void LogOutReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } LogOutReq::~LogOutReq() { SharedDtor(); } void LogOutReq::SharedDtor() { if (this != default_instance_) { } } void LogOutReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* LogOutReq::descriptor() { protobuf_AssignDescriptorsOnce(); return LogOutReq_descriptor_; } const LogOutReq& LogOutReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } LogOutReq* LogOutReq::default_instance_ = NULL; LogOutReq* LogOutReq::New() const { return new LogOutReq; } void LogOutReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool LogOutReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void LogOutReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* LogOutReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int LogOutReq::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 LogOutReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const LogOutReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const LogOutReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void LogOutReq::MergeFrom(const LogOutReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void LogOutReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void LogOutReq::CopyFrom(const LogOutReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool LogOutReq::IsInitialized() const { return true; } void LogOutReq::Swap(LogOutReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata LogOutReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = LogOutReq_descriptor_; metadata.reflection = LogOutReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER LogOutRsp::LogOutRsp() : ::google::protobuf::Message() { SharedCtor(); } void LogOutRsp::InitAsDefaultInstance() { } LogOutRsp::LogOutRsp(const LogOutRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void LogOutRsp::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } LogOutRsp::~LogOutRsp() { SharedDtor(); } void LogOutRsp::SharedDtor() { if (this != default_instance_) { } } void LogOutRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* LogOutRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return LogOutRsp_descriptor_; } const LogOutRsp& LogOutRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } LogOutRsp* LogOutRsp::default_instance_ = NULL; LogOutRsp* LogOutRsp::New() const { return new LogOutRsp; } void LogOutRsp::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool LogOutRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void LogOutRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* LogOutRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int LogOutRsp::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 LogOutRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const LogOutRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const LogOutRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void LogOutRsp::MergeFrom(const LogOutRsp& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void LogOutRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void LogOutRsp::CopyFrom(const LogOutRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool LogOutRsp::IsInitialized() const { return true; } void LogOutRsp::Swap(LogOutRsp* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata LogOutRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = LogOutRsp_descriptor_; metadata.reflection = LogOutRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int EvtBroadCast::kUinFieldNumber; const int EvtBroadCast::kContentFieldNumber; const int EvtBroadCast::kNickFieldNumber; #endif // !_MSC_VER EvtBroadCast::EvtBroadCast() : ::google::protobuf::Message() { SharedCtor(); } void EvtBroadCast::InitAsDefaultInstance() { } EvtBroadCast::EvtBroadCast(const EvtBroadCast& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void EvtBroadCast::SharedCtor() { _cached_size_ = 0; uin_ = 0; content_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); nick_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } EvtBroadCast::~EvtBroadCast() { SharedDtor(); } void EvtBroadCast::SharedDtor() { if (content_ != &::google::protobuf::internal::kEmptyString) { delete content_; } if (nick_ != &::google::protobuf::internal::kEmptyString) { delete nick_; } if (this != default_instance_) { } } void EvtBroadCast::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* EvtBroadCast::descriptor() { protobuf_AssignDescriptorsOnce(); return EvtBroadCast_descriptor_; } const EvtBroadCast& EvtBroadCast::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } EvtBroadCast* EvtBroadCast::default_instance_ = NULL; EvtBroadCast* EvtBroadCast::New() const { return new EvtBroadCast; } void EvtBroadCast::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; if (has_content()) { if (content_ != &::google::protobuf::internal::kEmptyString) { content_->clear(); } } if (has_nick()) { if (nick_ != &::google::protobuf::internal::kEmptyString) { nick_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool EvtBroadCast::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_content; break; } // optional string content = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_content: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_content())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(26)) goto parse_nick; break; } // optional string nick = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_nick: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_nick())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void EvtBroadCast::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional string content = 2; if (has_content()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 2, this->content(), output); } // optional string nick = 3; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->nick(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* EvtBroadCast::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional string content = 2; if (has_content()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->content().data(), this->content().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->content(), target); } // optional string nick = 3; if (has_nick()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->nick().data(), this->nick().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->nick(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int EvtBroadCast::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional string content = 2; if (has_content()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->content()); } // optional string nick = 3; if (has_nick()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->nick()); } } 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 EvtBroadCast::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const EvtBroadCast* source = ::google::protobuf::internal::dynamic_cast_if_available<const EvtBroadCast*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void EvtBroadCast::MergeFrom(const EvtBroadCast& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_content()) { set_content(from.content()); } if (from.has_nick()) { set_nick(from.nick()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void EvtBroadCast::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void EvtBroadCast::CopyFrom(const EvtBroadCast& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool EvtBroadCast::IsInitialized() const { return true; } void EvtBroadCast::Swap(EvtBroadCast* other) { if (other != this) { std::swap(uin_, other->uin_); std::swap(content_, other->content_); std::swap(nick_, other->nick_); 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 EvtBroadCast::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = EvtBroadCast_descriptor_; metadata.reflection = EvtBroadCast_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int UserCreatePreBill::kUinFieldNumber; const int UserCreatePreBill::kNameFieldNumber; const int UserCreatePreBill::kItemIdFieldNumber; #endif // !_MSC_VER UserCreatePreBill::UserCreatePreBill() : ::google::protobuf::Message() { SharedCtor(); } void UserCreatePreBill::InitAsDefaultInstance() { } UserCreatePreBill::UserCreatePreBill(const UserCreatePreBill& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void UserCreatePreBill::SharedCtor() { _cached_size_ = 0; uin_ = 0; name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); item_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } UserCreatePreBill::~UserCreatePreBill() { SharedDtor(); } void UserCreatePreBill::SharedDtor() { if (name_ != &::google::protobuf::internal::kEmptyString) { delete name_; } if (item_id_ != &::google::protobuf::internal::kEmptyString) { delete item_id_; } if (this != default_instance_) { } } void UserCreatePreBill::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* UserCreatePreBill::descriptor() { protobuf_AssignDescriptorsOnce(); return UserCreatePreBill_descriptor_; } const UserCreatePreBill& UserCreatePreBill::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } UserCreatePreBill* UserCreatePreBill::default_instance_ = NULL; UserCreatePreBill* UserCreatePreBill::New() const { return new UserCreatePreBill; } void UserCreatePreBill::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; if (has_name()) { if (name_ != &::google::protobuf::internal::kEmptyString) { name_->clear(); } } if (has_item_id()) { if (item_id_ != &::google::protobuf::internal::kEmptyString) { item_id_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool UserCreatePreBill::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_name; break; } // optional string name = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_name: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(26)) goto parse_item_id; break; } // optional string item_id = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_item_id: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_item_id())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->item_id().data(), this->item_id().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void UserCreatePreBill::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional string name = 2; if (has_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 2, this->name(), output); } // optional string item_id = 3; if (has_item_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->item_id().data(), this->item_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->item_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* UserCreatePreBill::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional string name = 2; if (has_name()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->name(), target); } // optional string item_id = 3; if (has_item_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->item_id().data(), this->item_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->item_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int UserCreatePreBill::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional string name = 2; if (has_name()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->name()); } // optional string item_id = 3; if (has_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( 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 UserCreatePreBill::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const UserCreatePreBill* source = ::google::protobuf::internal::dynamic_cast_if_available<const UserCreatePreBill*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void UserCreatePreBill::MergeFrom(const UserCreatePreBill& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_name()) { set_name(from.name()); } if (from.has_item_id()) { set_item_id(from.item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void UserCreatePreBill::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void UserCreatePreBill::CopyFrom(const UserCreatePreBill& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool UserCreatePreBill::IsInitialized() const { return true; } void UserCreatePreBill::Swap(UserCreatePreBill* other) { if (other != this) { std::swap(uin_, other->uin_); std::swap(name_, other->name_); 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 UserCreatePreBill::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = UserCreatePreBill_descriptor_; metadata.reflection = UserCreatePreBill_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int CreateFormalBill::kUinFieldNumber; const int CreateFormalBill::kItemIdFieldNumber; #endif // !_MSC_VER CreateFormalBill::CreateFormalBill() : ::google::protobuf::Message() { SharedCtor(); } void CreateFormalBill::InitAsDefaultInstance() { } CreateFormalBill::CreateFormalBill(const CreateFormalBill& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void CreateFormalBill::SharedCtor() { _cached_size_ = 0; uin_ = 0; item_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } CreateFormalBill::~CreateFormalBill() { SharedDtor(); } void CreateFormalBill::SharedDtor() { if (item_id_ != &::google::protobuf::internal::kEmptyString) { delete item_id_; } if (this != default_instance_) { } } void CreateFormalBill::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* CreateFormalBill::descriptor() { protobuf_AssignDescriptorsOnce(); return CreateFormalBill_descriptor_; } const CreateFormalBill& CreateFormalBill::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } CreateFormalBill* CreateFormalBill::default_instance_ = NULL; CreateFormalBill* CreateFormalBill::New() const { return new CreateFormalBill; } void CreateFormalBill::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; if (has_item_id()) { if (item_id_ != &::google::protobuf::internal::kEmptyString) { item_id_->clear(); } } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool CreateFormalBill::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_item_id; break; } // optional string item_id = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_item_id: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_item_id())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->item_id().data(), this->item_id().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void CreateFormalBill::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } // optional string item_id = 2; if (has_item_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->item_id().data(), this->item_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 2, this->item_id(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* CreateFormalBill::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } // optional string item_id = 2; if (has_item_id()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->item_id().data(), this->item_id().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 2, this->item_id(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int CreateFormalBill::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } // optional string item_id = 2; if (has_item_id()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( 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 CreateFormalBill::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const CreateFormalBill* source = ::google::protobuf::internal::dynamic_cast_if_available<const CreateFormalBill*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void CreateFormalBill::MergeFrom(const CreateFormalBill& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } if (from.has_item_id()) { set_item_id(from.item_id()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void CreateFormalBill::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void CreateFormalBill::CopyFrom(const CreateFormalBill& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool CreateFormalBill::IsInitialized() const { return true; } void CreateFormalBill::Swap(CreateFormalBill* other) { if (other != this) { std::swap(uin_, other->uin_); 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 CreateFormalBill::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = CreateFormalBill_descriptor_; metadata.reflection = CreateFormalBill_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int SetInviteUserReq::kUinFieldNumber; #endif // !_MSC_VER SetInviteUserReq::SetInviteUserReq() : ::google::protobuf::Message() { SharedCtor(); } void SetInviteUserReq::InitAsDefaultInstance() { } SetInviteUserReq::SetInviteUserReq(const SetInviteUserReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void SetInviteUserReq::SharedCtor() { _cached_size_ = 0; uin_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } SetInviteUserReq::~SetInviteUserReq() { SharedDtor(); } void SetInviteUserReq::SharedDtor() { if (this != default_instance_) { } } void SetInviteUserReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SetInviteUserReq::descriptor() { protobuf_AssignDescriptorsOnce(); return SetInviteUserReq_descriptor_; } const SetInviteUserReq& SetInviteUserReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } SetInviteUserReq* SetInviteUserReq::default_instance_ = NULL; SetInviteUserReq* SetInviteUserReq::New() const { return new SetInviteUserReq; } void SetInviteUserReq::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { uin_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool SetInviteUserReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 uin = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &uin_))); set_has_uin(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void SetInviteUserReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 uin = 1; if (has_uin()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->uin(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* SetInviteUserReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 uin = 1; if (has_uin()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->uin(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int SetInviteUserReq::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 uin = 1; if (has_uin()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->uin()); } } 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 SetInviteUserReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const SetInviteUserReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const SetInviteUserReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void SetInviteUserReq::MergeFrom(const SetInviteUserReq& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_uin()) { set_uin(from.uin()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void SetInviteUserReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void SetInviteUserReq::CopyFrom(const SetInviteUserReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool SetInviteUserReq::IsInitialized() const { return true; } void SetInviteUserReq::Swap(SetInviteUserReq* other) { if (other != this) { std::swap(uin_, other->uin_); 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 SetInviteUserReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = SetInviteUserReq_descriptor_; metadata.reflection = SetInviteUserReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int SetInviteUserRsp::kRetFieldNumber; #endif // !_MSC_VER SetInviteUserRsp::SetInviteUserRsp() : ::google::protobuf::Message() { SharedCtor(); } void SetInviteUserRsp::InitAsDefaultInstance() { } SetInviteUserRsp::SetInviteUserRsp(const SetInviteUserRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void SetInviteUserRsp::SharedCtor() { _cached_size_ = 0; ret_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } SetInviteUserRsp::~SetInviteUserRsp() { SharedDtor(); } void SetInviteUserRsp::SharedDtor() { if (this != default_instance_) { } } void SetInviteUserRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* SetInviteUserRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return SetInviteUserRsp_descriptor_; } const SetInviteUserRsp& SetInviteUserRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } SetInviteUserRsp* SetInviteUserRsp::default_instance_ = NULL; SetInviteUserRsp* SetInviteUserRsp::New() const { return new SetInviteUserRsp; } void SetInviteUserRsp::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ret_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool SetInviteUserRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ret_))); set_has_ret(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void SetInviteUserRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ret = 1; if (has_ret()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ret(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* SetInviteUserRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ret = 1; if (has_ret()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ret(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int SetInviteUserRsp::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ret = 1; if (has_ret()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ret()); } } 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 SetInviteUserRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const SetInviteUserRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const SetInviteUserRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void SetInviteUserRsp::MergeFrom(const SetInviteUserRsp& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ret()) { set_ret(from.ret()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void SetInviteUserRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void SetInviteUserRsp::CopyFrom(const SetInviteUserRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool SetInviteUserRsp::IsInitialized() const { return true; } void SetInviteUserRsp::Swap(SetInviteUserRsp* other) { if (other != this) { std::swap(ret_, other->ret_); 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 SetInviteUserRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = SetInviteUserRsp_descriptor_; metadata.reflection = SetInviteUserRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER HeartBeatReq::HeartBeatReq() : ::google::protobuf::Message() { SharedCtor(); } void HeartBeatReq::InitAsDefaultInstance() { } HeartBeatReq::HeartBeatReq(const HeartBeatReq& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void HeartBeatReq::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } HeartBeatReq::~HeartBeatReq() { SharedDtor(); } void HeartBeatReq::SharedDtor() { if (this != default_instance_) { } } void HeartBeatReq::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* HeartBeatReq::descriptor() { protobuf_AssignDescriptorsOnce(); return HeartBeatReq_descriptor_; } const HeartBeatReq& HeartBeatReq::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } HeartBeatReq* HeartBeatReq::default_instance_ = NULL; HeartBeatReq* HeartBeatReq::New() const { return new HeartBeatReq; } void HeartBeatReq::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool HeartBeatReq::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void HeartBeatReq::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* HeartBeatReq::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int HeartBeatReq::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 HeartBeatReq::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const HeartBeatReq* source = ::google::protobuf::internal::dynamic_cast_if_available<const HeartBeatReq*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void HeartBeatReq::MergeFrom(const HeartBeatReq& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void HeartBeatReq::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void HeartBeatReq::CopyFrom(const HeartBeatReq& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool HeartBeatReq::IsInitialized() const { return true; } void HeartBeatReq::Swap(HeartBeatReq* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata HeartBeatReq::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = HeartBeatReq_descriptor_; metadata.reflection = HeartBeatReq_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER #endif // !_MSC_VER HeartBeatRsp::HeartBeatRsp() : ::google::protobuf::Message() { SharedCtor(); } void HeartBeatRsp::InitAsDefaultInstance() { } HeartBeatRsp::HeartBeatRsp(const HeartBeatRsp& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void HeartBeatRsp::SharedCtor() { _cached_size_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } HeartBeatRsp::~HeartBeatRsp() { SharedDtor(); } void HeartBeatRsp::SharedDtor() { if (this != default_instance_) { } } void HeartBeatRsp::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* HeartBeatRsp::descriptor() { protobuf_AssignDescriptorsOnce(); return HeartBeatRsp_descriptor_; } const HeartBeatRsp& HeartBeatRsp::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } HeartBeatRsp* HeartBeatRsp::default_instance_ = NULL; HeartBeatRsp* HeartBeatRsp::New() const { return new HeartBeatRsp; } void HeartBeatRsp::Clear() { ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool HeartBeatRsp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ } void HeartBeatRsp::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* HeartBeatRsp::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int HeartBeatRsp::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 HeartBeatRsp::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const HeartBeatRsp* source = ::google::protobuf::internal::dynamic_cast_if_available<const HeartBeatRsp*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void HeartBeatRsp::MergeFrom(const HeartBeatRsp& from) { GOOGLE_CHECK_NE(&from, this); mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void HeartBeatRsp::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void HeartBeatRsp::CopyFrom(const HeartBeatRsp& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool HeartBeatRsp::IsInitialized() const { return true; } void HeartBeatRsp::Swap(HeartBeatRsp* other) { if (other != this) { _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); } } ::google::protobuf::Metadata HeartBeatRsp::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = HeartBeatRsp_descriptor_; metadata.reflection = HeartBeatRsp_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int ws_msg::kMsOpIntFieldNumber; #endif // !_MSC_VER ws_msg::ws_msg() : ::google::protobuf::Message() { SharedCtor(); } void ws_msg::InitAsDefaultInstance() { } ws_msg::ws_msg(const ws_msg& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void ws_msg::SharedCtor() { _cached_size_ = 0; ms_op_int_ = 0; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } ws_msg::~ws_msg() { SharedDtor(); } void ws_msg::SharedDtor() { if (this != default_instance_) { } } void ws_msg::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* ws_msg::descriptor() { protobuf_AssignDescriptorsOnce(); return ws_msg_descriptor_; } const ws_msg& ws_msg::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } ws_msg* ws_msg::default_instance_ = NULL; ws_msg* ws_msg::New() const { return new ws_msg; } void ws_msg::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { ms_op_int_ = 0; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool ws_msg::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ms_op_int = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &ms_op_int_))); set_has_ms_op_int(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void ws_msg::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 ms_op_int = 1; if (has_ms_op_int()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->ms_op_int(), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* ws_msg::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 ms_op_int = 1; if (has_ms_op_int()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->ms_op_int(), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int ws_msg::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 ms_op_int = 1; if (has_ms_op_int()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->ms_op_int()); } } 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 ws_msg::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const ws_msg* source = ::google::protobuf::internal::dynamic_cast_if_available<const ws_msg*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void ws_msg::MergeFrom(const ws_msg& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_ms_op_int()) { set_ms_op_int(from.ms_op_int()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void ws_msg::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void ws_msg::CopyFrom(const ws_msg& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool ws_msg::IsInitialized() const { return true; } void ws_msg::Swap(ws_msg* other) { if (other != this) { std::swap(ms_op_int_, other->ms_op_int_); 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 ws_msg::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = ws_msg_descriptor_; metadata.reflection = ws_msg_reflection_; return metadata; } // =================================================================== #ifndef _MSC_VER const int WsProtoTest::kOpIntFieldNumber; const int WsProtoTest::kReIntFieldNumber; const int WsProtoTest::kOpStrFieldNumber; const int WsProtoTest::kOpMsgFieldNumber; const int WsProtoTest::kReMsgFieldNumber; #endif // !_MSC_VER WsProtoTest::WsProtoTest() : ::google::protobuf::Message() { SharedCtor(); } void WsProtoTest::InitAsDefaultInstance() { op_msg_ = const_cast< ::ws_msg*>(&::ws_msg::default_instance()); } WsProtoTest::WsProtoTest(const WsProtoTest& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } void WsProtoTest::SharedCtor() { _cached_size_ = 0; op_int_ = 0; op_str_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); op_msg_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } WsProtoTest::~WsProtoTest() { SharedDtor(); } void WsProtoTest::SharedDtor() { if (op_str_ != &::google::protobuf::internal::kEmptyString) { delete op_str_; } if (this != default_instance_) { delete op_msg_; } } void WsProtoTest::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ::google::protobuf::Descriptor* WsProtoTest::descriptor() { protobuf_AssignDescriptorsOnce(); return WsProtoTest_descriptor_; } const WsProtoTest& WsProtoTest::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_mahjong_2eproto(); return *default_instance_; } WsProtoTest* WsProtoTest::default_instance_ = NULL; WsProtoTest* WsProtoTest::New() const { return new WsProtoTest; } void WsProtoTest::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { op_int_ = 0; if (has_op_str()) { if (op_str_ != &::google::protobuf::internal::kEmptyString) { op_str_->clear(); } } if (has_op_msg()) { if (op_msg_ != NULL) op_msg_->::ws_msg::Clear(); } } re_int_.Clear(); re_msg_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } bool WsProtoTest::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 op_int = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &op_int_))); set_has_op_int(); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_re_int; break; } // repeated int32 re_int = 2 [packed = true]; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_re_int: DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, this->mutable_re_int()))); } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite:: WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1, 18, input, this->mutable_re_int()))); } else { goto handle_uninterpreted; } if (input->ExpectTag(26)) goto parse_op_str; break; } // optional string op_str = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_op_str: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_op_str())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->op_str().data(), this->op_str().length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(34)) goto parse_op_msg; break; } // optional .ws_msg op_msg = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_op_msg: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_op_msg())); } else { goto handle_uninterpreted; } if (input->ExpectTag(42)) goto parse_re_msg; break; } // repeated .ws_msg re_msg = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_re_msg: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_re_msg())); } else { goto handle_uninterpreted; } if (input->ExpectTag(42)) goto parse_re_msg; if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ } void WsProtoTest::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // optional int32 op_int = 1; if (has_op_int()) { ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->op_int(), output); } // repeated int32 re_int = 2 [packed = true]; if (this->re_int_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); output->WriteVarint32(_re_int_cached_byte_size_); } for (int i = 0; i < this->re_int_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( this->re_int(i), output); } // optional string op_str = 3; if (has_op_str()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->op_str().data(), this->op_str().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); ::google::protobuf::internal::WireFormatLite::WriteString( 3, this->op_str(), output); } // optional .ws_msg op_msg = 4; if (has_op_msg()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 4, this->op_msg(), output); } // repeated .ws_msg re_msg = 5; for (int i = 0; i < this->re_msg_size(); i++) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 5, this->re_msg(i), output); } if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); } } ::google::protobuf::uint8* WsProtoTest::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { // optional int32 op_int = 1; if (has_op_int()) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->op_int(), target); } // repeated int32 re_int = 2 [packed = true]; if (this->re_int_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, target); target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _re_int_cached_byte_size_, target); } for (int i = 0; i < this->re_int_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteInt32NoTagToArray(this->re_int(i), target); } // optional string op_str = 3; if (has_op_str()) { ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->op_str().data(), this->op_str().length(), ::google::protobuf::internal::WireFormat::SERIALIZE); target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 3, this->op_str(), target); } // optional .ws_msg op_msg = 4; if (has_op_msg()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 4, this->op_msg(), target); } // repeated .ws_msg re_msg = 5; for (int i = 0; i < this->re_msg_size(); i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( 5, this->re_msg(i), target); } if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); } return target; } int WsProtoTest::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { // optional int32 op_int = 1; if (has_op_int()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( this->op_int()); } // optional string op_str = 3; if (has_op_str()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this->op_str()); } // optional .ws_msg op_msg = 4; if (has_op_msg()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->op_msg()); } } // repeated int32 re_int = 2 [packed = true]; { int data_size = 0; for (int i = 0; i < this->re_int_size(); i++) { data_size += ::google::protobuf::internal::WireFormatLite:: Int32Size(this->re_int(i)); } if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); } GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _re_int_cached_byte_size_ = data_size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); total_size += data_size; } // repeated .ws_msg re_msg = 5; total_size += 1 * this->re_msg_size(); for (int i = 0; i < this->re_msg_size(); i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->re_msg(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 WsProtoTest::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); const WsProtoTest* source = ::google::protobuf::internal::dynamic_cast_if_available<const WsProtoTest*>( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { MergeFrom(*source); } } void WsProtoTest::MergeFrom(const WsProtoTest& from) { GOOGLE_CHECK_NE(&from, this); re_int_.MergeFrom(from.re_int_); re_msg_.MergeFrom(from.re_msg_); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { if (from.has_op_int()) { set_op_int(from.op_int()); } if (from.has_op_str()) { set_op_str(from.op_str()); } if (from.has_op_msg()) { mutable_op_msg()->::ws_msg::MergeFrom(from.op_msg()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } void WsProtoTest::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } void WsProtoTest::CopyFrom(const WsProtoTest& from) { if (&from == this) return; Clear(); MergeFrom(from); } bool WsProtoTest::IsInitialized() const { return true; } void WsProtoTest::Swap(WsProtoTest* other) { if (other != this) { std::swap(op_int_, other->op_int_); re_int_.Swap(&other->re_int_); std::swap(op_str_, other->op_str_); std::swap(op_msg_, other->op_msg_); re_msg_.Swap(&other->re_msg_); 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 WsProtoTest::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; metadata.descriptor = WsProtoTest_descriptor_; metadata.reflection = WsProtoTest_reflection_; return metadata; } // @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(global_scope)
[ "gerry" ]
gerry
aafc5882a1c52410105f435ecd0fb1010240570f
3964a952f3f37885415861614215f898b7582bc4
/lrn-sycl/main.cpp
188a990b67bfed62f7743ee4898e98e749fc0eda
[ "BSD-3-Clause" ]
permissive
ChiaCheng-Tsai/oneAPI-DirectProgramming
4b713dcf1f69f613b0678925df0bbeda0b09b21d
7d01c299ee4b8b424f7738cff549bf39e9fc1240
refs/heads/master
2023-03-18T06:07:27.312185
2023-03-02T00:32:31
2023-03-02T00:32:31
317,786,545
0
0
null
null
null
null
UTF-8
C++
false
false
4,879
cpp
#include <chrono> #include <cstdio> #include <iostream> #include <vector> #include "common.h" #include "kernels.h" using namespace std::chrono; void Forward(queue &q, int repeat) { int64_t ndims = 5; int64_t size = 5; float alpha = 0.000122; float beta = 0.750000; float k = 1.000000; int64_t N = 6; int64_t C = 150; int64_t D = 100; int64_t H = 160; int64_t W = 160; int64_t stride_mb = C*D*H*W; int64_t wk_size = N*C*D*H*W; std::vector<float> src(wk_size, 0); std::vector<float> dst(wk_size, 0); srand(123); for (int64_t i = 0; i < wk_size; i++) { src[i] = rand() / (float)RAND_MAX; } size_t bytes_to_copy_s = wk_size * sizeof(float); float *src_mem = malloc_device<float>(wk_size, q); q.memcpy(src_mem, src.data(), bytes_to_copy_s); size_t bytes_to_copy_d = wk_size * sizeof(float); float *dst_mem = malloc_device<float>(wk_size, q); q.memcpy(dst_mem, dst.data(), bytes_to_copy_d); printf("Sweep the work-group sizes from 64 to 512\n"); for (int wg_size = 64; wg_size <= 512; wg_size = wg_size * 2) { int64_t wg_cnt = (wk_size + wg_size - 1) / wg_size; range<1> gws (wg_size * wg_cnt); range<1> lws (wg_size); q.wait(); auto start = high_resolution_clock::now(); for (int i = 0; i < repeat; i++) { q.submit([&] (handler &cgh) { cgh.parallel_for<class fwd>(nd_range<1>(gws, lws), [=] (nd_item<1> item) { lrn_fwd_kernel(item, src_mem, dst_mem, N, C, D, H, W, stride_mb, ndims, wk_size, size, alpha, beta, k); }); }); } q.wait(); auto stop = high_resolution_clock::now(); auto time = (duration_cast<microseconds>(stop - start)).count()/1e6f; printf("Average execution time of lrn_fwd_kernel: %.6f sec \n", time / repeat); auto data_inGB = (2 * wk_size * sizeof(float)) / 1e9f; auto bandwidth = data_inGB * repeat / time; printf("Kernel bandwidth: %.6f GB/s \n", bandwidth); } q.memcpy(dst.data(), dst_mem, bytes_to_copy_d).wait(); double checksum = 0; for (int64_t i = 0; i < wk_size; i++) { checksum += dst[i]; } printf("Checksum: %lf\n", checksum / wk_size); free(src_mem, q); free(dst_mem, q); } void Backward(queue &q, int repeat) { int64_t ndims = 5; int64_t size = 5; float alpha = 0.000122; float beta = 0.750000; float k = 1.000000; int64_t N = 5; int64_t C = 150; int64_t D = 100; int64_t H = 160; int64_t W = 160; int64_t stride_mb = C*D*H*W; int64_t wk_size = N*C*D*H*W; std::vector<float> src(wk_size, 0); std::vector<float> dst(wk_size, 0); std::vector<float> diff_src(wk_size, 0); srand(123); for (int64_t i = 0; i < wk_size; i++) { diff_src[i] = src[i] = rand() / (float)RAND_MAX; } size_t bytes_to_copy_s = wk_size * sizeof(float); float *src_mem = malloc_device<float>(wk_size, q); q.memcpy(src_mem, src.data(), bytes_to_copy_s); size_t bytes_to_copy_diff = wk_size * sizeof(float); float *diff_src_mem = malloc_device<float>(wk_size, q); q.memcpy(diff_src_mem, diff_src.data(), bytes_to_copy_diff); size_t bytes_to_copy_d = wk_size * sizeof(float); float *dst_mem = malloc_device<float>(wk_size, q); q.memcpy(dst_mem, src.data(), bytes_to_copy_d); printf("Sweep the work-group sizes from 64 to 512\n"); for (int wg_size = 64; wg_size <= 512; wg_size = wg_size * 2) { int64_t wg_cnt = (wk_size + wg_size - 1) / wg_size; range<1> gws (wg_size * wg_cnt); range<1> lws (wg_size); q.wait(); auto start = high_resolution_clock::now(); for (int i = 0; i < repeat; i++) { q.submit([&] (handler &cgh) { cgh.parallel_for(nd_range<1>(gws, lws), [=](nd_item<1> item) { lrn_bwd_kernel(item, src_mem, dst_mem, diff_src_mem, N, C, D, H, W, stride_mb, ndims, wk_size, size, alpha, beta, k); }); }); } q.wait(); auto stop = high_resolution_clock::now(); auto time = (duration_cast<microseconds>(stop - start)).count()/1e6f; printf("Average execution time of lrn_bwd_kernel: %.6f sec \n", time / repeat); auto data_inGB = (3 * wk_size * sizeof(float)) / 1e9f; auto bandwidth = data_inGB * repeat / time; printf("Kernel bandwidth: %.6f GB/s \n", bandwidth); } q.memcpy(dst.data(), dst_mem, bytes_to_copy_d).wait(); double checksum = 0; for (int64_t i = 0; i < wk_size; i++) { checksum += dst[i]; } printf("Checksum: %lf\n", checksum / wk_size); free(src_mem, q); free(diff_src_mem, q); free(dst_mem, q); } int main(int argc, char* argv[]) { if (argc != 2) { printf("Usage: %s <repeat>\n", argv[0]); return 1; } const int repeat = atoi(argv[1]); #ifdef USE_GPU gpu_selector dev_sel; #else cpu_selector dev_sel; #endif queue q(dev_sel); Forward(q, repeat); Backward(q, repeat); return 0; }
[ "5zj@equinox.ftpn.ornl.gov" ]
5zj@equinox.ftpn.ornl.gov
4e51bf301c50b64622ceed4907c153ded00c118f
5476bce4a326c9adf16a34ba488615cdc0725a1f
/AppWindow.h
1c5731174b6b655462a8091ed539f3355a506ee1
[ "MIT" ]
permissive
ahitech/Skeleton
e03fa0383b3efb96825fcd80b9c1113a03fa78e8
b76cff1b6b8516b50e3940a4864a2680aef3e07b
refs/heads/main
2023-01-22T04:46:22.697852
2020-11-28T22:03:37
2020-11-28T22:03:37
316,829,460
0
0
null
null
null
null
UTF-8
C++
false
false
510
h
/* * Copyright 2020, Alex Hitech <ahitech@gmail.com> * All rights reserved. Distributed under the terms of the MIT license. */ #ifndef APP_WINDOW_H #define APP_WINODW_H #include <View.h> #include <Rect.h> #include <Window.h> #include <SupportDefs.h> #include "MainView.h" class AppWindow : public BWindow { public: AppWindow(); ~AppWindow(); void WindowActivated(bool); void MessageReceived (BMessage* in); bool QuitRequested(); private: MainView* mainView; }; #endif // APP_WINODW_H
[ "ahitech@gmail.com" ]
ahitech@gmail.com
ce601da5f4f1c177a886b25f67a5c19d2df9a3a0
549526b112480aab8d7d1c2a9f930fd37d080254
/Test/Test.cpp
90e1ba2bc88645fd3437496d4ec1677d611b2249
[]
no_license
topkoong/NoSqlDb
c53de06f70fad22db117e967f6356121733b2759
55e3b675eab322a2bfc2e49a65405bebcecd5ff4
refs/heads/master
2021-04-06T09:57:46.510656
2018-03-11T01:30:09
2018-03-11T01:30:09
124,710,460
1
0
null
null
null
null
UTF-8
C++
false
false
2,402
cpp
#include "Test.h" //#include "../DbCore/DbCore.h" #include "../Utilities/StringUtilities/StringUtilities.h" #include "../Utilities/TestUtilities/TestUtilities.h" #include <iostream> using namespace Utilities; int main() { Utilities::Title("Testing DbCore - He said, she said database"); putLine(); //TestDB testDb;; TestExecutive ex; // define test structures with test function and message TestExecutive::TestStr ts1{ testR1, "Use C++11" }; TestExecutive::TestStr ts2{ testR2, "Use streams and new and delete" }; TestExecutive::TestStr ts3a{ testR3a, "Creating DbElement" }; TestExecutive::TestStr ts3b{ testR3b, "Creating DbCore and adding element with key" }; TestExecutive::TestStr ts4b{ testR4b, "Deletion of key/value pairs" }; TestExecutive::TestStr ts5a{ testR5a, "Addition of relationships" }; TestExecutive::TestStr ts5b{ testR5b, "Deletion of relationships" }; TestExecutive::TestStr ts5c{ testR5c, "Editing text metadata and replacing an existing value's instance with a new instance" }; TestExecutive::TestStr ts6{ testR6, "Testing queries mechanism" }; TestExecutive::TestStr ts6b{ testQuery, "Testing queries mechanism" }; TestExecutive::TestStr ts6c{ testSpecializedSelectors, "Testing specialized selectors for common queries" }; TestExecutive::TestStr ts7a{ testXml, "Testing persisting a colllection of database contents, defined by a collection of keys, to an XML file" }; TestExecutive::TestStr ts7b{ testCreateNewDbFromXmlFile, "Testing the database can be restored or augmented from an existing XML file as well as write its contents out to one or more XML files" }; TestExecutive::TestStr ts11{ testCreateProjectPackageStructure, "Testing an XML file, that describe my project's package structure and dependency relationships that can be loaded when my project is graded." }; // register test structures with TestExecutive instance, ex ex.registerTest(ts1); ex.registerTest(ts2); ex.registerTest(ts3a); ex.registerTest(ts3b); ex.registerTest(ts4b); ex.registerTest(ts5a); ex.registerTest(ts5b); ex.registerTest(ts5c); ex.registerTest(ts6); ex.registerTest(ts6b); ex.registerTest(ts6c); ex.registerTest(ts7a); ex.registerTest(ts7b); ex.registerTest(ts11); // run tests bool result = ex.doTests(); if (result == true) std::cout << "\n\n all tests passed"; else std::cout << "\n\n at least one test failed"; putLine(5); return 0; }
[ "engineer_top@msn.com" ]
engineer_top@msn.com
aa874a3312fd34d48b0d7273b64ee00694f8e6ac
36aab89d53d4e373b9b7e6e9bc61d7622afb4902
/hackerearth/practo/2.cpp
05183349ab38fadf6708473e767f63540855aa41
[]
no_license
vikram-rathore1/competitive_programming
052518f36053eab24a2b0343cd6965549a919b42
598cbcb3dfde75751ee9a820fb52ebe3b4d64d44
refs/heads/master
2022-04-12T11:14:44.968592
2020-04-03T21:10:12
2020-04-03T21:10:12
65,635,969
0
0
null
null
null
null
UTF-8
C++
false
false
1,526
cpp
#include <bits/stdc++.h> using namespace std; string str; int s[100001], e[100001], max_len; void precomp() { for (int i = 0; i < 100001; i++) { s[i] = e[i] = -1; } int f = -1; for (int i = 0; i < str.length(); i++) { if (str[i] == '1') { if (f == -1) { f = i; s[i] = i; } } else { if (f != -1) { s[i - 1] = f; e[i - 1] = i - 1; e[f] = i - 1; max_len = max(max_len, i - f); f = -1; } } } if (f != -1) { s[str.length() - 1] = f; e[str.length() - 1] = str.length() - 1; e[f] = str.length() - 1; max_len = max(max_len, (int)str.length() - f); } } void mark(int pos) { if (str[pos] != '1') { str[pos] = '1'; if (pos != 0 && pos != str.length() - 1 && str[pos - 1] == '1' && str[pos + 1] == '1') { e[s[pos - 1]] = e[pos + 1]; s[e[pos + 1]] = s[pos - 1]; max_len = max(max_len, e[pos + 1] - s[pos - 1] + 1); } else if (pos != 0 && str[pos - 1] == '1') { e[s[pos - 1]] = pos; s[pos] = s[pos - 1]; e[pos] = pos; max_len = max(max_len, pos - s[pos] + 1); } else if (pos != str.length() && str[pos + 1] == '1') { e[pos] = e[pos + 1]; s[pos] = pos; s[e[pos]] = pos; max_len = max(max_len, e[pos] - pos + 1); } else { s[pos] = e[pos] = pos; max_len = max(max_len, 1); } } } int main() { int n, k, q1, q2; max_len = 0; cin >> n >> k >> str; precomp(); for (int i = 0; i < k; i++) { cin >> q1; if (q1 == 1) { cout << max_len << "\n"; } else { cin >> q2; mark(q2 - 1); } } return 0; }
[ "rathore.vikram624@gmail.com" ]
rathore.vikram624@gmail.com
57720e29996f1774c5a43e239b2b06939b167375
e6954f48532a61ba1f55bf93e4e2854c53ef28d1
/SiSiMEX/UCP.cpp
8bfd24f7cd8c076b2350a9b26fe02a00ae0261de
[]
no_license
mlluch/SiSiMEX-1
b7863423e93ee11f0cf15d8f0b9afab2b3b9a667
b64c039ed430339b3931ca8fdb9598e737949f64
refs/heads/master
2021-08-20T05:27:59.719140
2017-11-24T03:51:11
2017-11-24T03:51:11
112,304,386
0
0
null
2017-11-28T07:58:39
2017-11-28T07:58:39
null
UTF-8
C++
false
false
2,885
cpp
#include "UCP.h" #include "MCP.h" #include "AgentContainer.h" enum State { ST_INIT, ST_REQUESTING_ITEM, ST_RESOLVING_CONSTRAINT, ST_NEGOTIATION_FINISHED, }; UCP::UCP(Node *node, uint16_t requestedItemId, const AgentLocation &uccLocation) : Agent(node), _requestedItemId(requestedItemId), _uccLocation(uccLocation), _negotiationAgreement(false) { setState(ST_INIT); } UCP::~UCP() { } void UCP::update() { switch (state()) { case ST_INIT: requestItem(); setState(ST_REQUESTING_ITEM); break; case ST_RESOLVING_CONSTRAINT: if (_mcp->negotiationFinished()) { sendConstraint(_mcp->requestedItemId()); _negotiationAgreement = _mcp->negotiationAgreement(); setState(ST_NEGOTIATION_FINISHED); destroyChildMCP(); } break; default:; } } void UCP::finalize() { destroyChildMCP(); finish(); } void UCP::OnPacketReceived(TCPSocketPtr socket, const PacketHeader &packetHeader, InputMemoryStream &stream) { PacketType packetType = packetHeader.packetType; if (state() == ST_REQUESTING_ITEM && packetType == PacketType::RequestItemResponse) { PacketRequestItemResponse packetData; packetData.Read(stream); if (packetData.constraintItemId != NULL_ITEM_ID) { createChildMCP(packetData.constraintItemId); setState(ST_RESOLVING_CONSTRAINT); } else { _negotiationAgreement = true; setState(ST_NEGOTIATION_FINISHED); } } } bool UCP::negotiationFinished() const { return state() == ST_NEGOTIATION_FINISHED; } bool UCP::negotiationAgreement() const { return _negotiationAgreement; } void UCP::requestItem() { // Send PacketType::RequestItem to agent PacketHeader oPacketHead; oPacketHead.packetType = PacketType::RequestItem; oPacketHead.srcAgentId = id(); oPacketHead.dstAgentId = _uccLocation.agentId; PacketRequestItem oPacketData; oPacketData.requestedItemId = _requestedItemId; OutputMemoryStream ostream; oPacketHead.Write(ostream); oPacketData.Write(ostream); const std::string &ip = _uccLocation.hostIP; const uint16_t port = _uccLocation.hostPort; sendPacketToHost(ip, port, ostream); } void UCP::sendConstraint(uint16_t constraintItemId) { // Send PacketType::RequestItem to agent PacketHeader oPacketHead; oPacketHead.packetType = PacketType::SendConstraint; oPacketHead.srcAgentId = id(); oPacketHead.dstAgentId = _uccLocation.agentId; PacketSendConstraint oPacketData; oPacketData.constraintItemId = constraintItemId; OutputMemoryStream ostream; oPacketHead.Write(ostream); oPacketData.Write(ostream); const std::string &ip = _uccLocation.hostIP; const uint16_t port = _uccLocation.hostPort; sendPacketToHost(ip, port, ostream); } void UCP::createChildMCP(uint16_t constraintItemId) { destroyChildMCP(); _mcp.reset(new MCP(node(), constraintItemId)); g_AgentContainer->addAgent(_mcp); } void UCP::destroyChildMCP() { if (_mcp.get()) { _mcp->finalize(); _mcp.reset(); } }
[ "jesusdz@gmail.com" ]
jesusdz@gmail.com
869ce27b66cd039d3374e08699b145d46b2c24c7
55d560fe6678a3edc9232ef14de8fafd7b7ece12
/libs/log/src/unique_ptr.hpp
602618de17c0a4cde641e2d82a6638efd072e78b
[ "BSL-1.0" ]
permissive
stardog-union/boost
ec3abeeef1b45389228df031bf25b470d3d123c5
caa4a540db892caa92e5346e0094c63dea51cbfb
refs/heads/stardog/develop
2021-06-25T02:15:10.697006
2020-11-17T19:50:35
2020-11-17T19:50:35
148,681,713
0
0
BSL-1.0
2020-11-17T19:50:36
2018-09-13T18:38:54
C++
UTF-8
C++
false
false
1,263
hpp
/* * Copyright Andrey Semashev 2007 - 2015. * 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) */ /*! * \file unique_ptr.hpp * \author Andrey Semashev * \date 18.07.2015 * * \brief This header is the Boost.Log library implementation, see the library documentation * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. */ #ifndef BOOST_LOG_UNIQUE_PTR_HPP_INCLUDED_ #define BOOST_LOG_UNIQUE_PTR_HPP_INCLUDED_ #include <boost/log/detail/config.hpp> #if !defined(BOOST_NO_CXX11_SMART_PTR) #include <memory> namespace boost { BOOST_LOG_OPEN_NAMESPACE namespace aux { using std::unique_ptr; } // namespace aux BOOST_LOG_CLOSE_NAMESPACE // namespace log } // namespace boost #else // !defined(BOOST_NO_CXX11_SMART_PTR) #include <boost/move/unique_ptr.hpp> namespace boost { BOOST_LOG_OPEN_NAMESPACE namespace aux { using boost::movelib::unique_ptr; } // namespace aux BOOST_LOG_CLOSE_NAMESPACE // namespace log } // namespace boost #endif // !defined(BOOST_NO_CXX11_SMART_PTR) #endif // BOOST_LOG_UNIQUE_PTR_HPP_INCLUDED_
[ "james.pack@stardog.com" ]
james.pack@stardog.com
9bd103cb7d5352ea1cdf8b4a76a7d42da276ad6a
562d69fbf4aae6c3835f3bd7403403ff1c0f1f61
/build-03_SignalAndSlot-Desktop_Qt_5_6_1_MinGW_32bit-Debug/debug/moc_mainwidget.cpp
34b95b7b356c51d6745fe113addb8042180baab1
[]
no_license
wilson2Hong/QT-day01
cc5adb40e84c1cac9413533edf626f6b901eabc2
ca4d28775f3efd5b66189a53c342a09ab0cf67f4
refs/heads/master
2022-12-23T11:34:21.043713
2020-09-21T06:58:18
2020-09-21T06:58:18
297,254,389
0
0
null
null
null
null
UTF-8
C++
false
false
2,634
cpp
/**************************************************************************** ** Meta object code from reading C++ file 'mainwidget.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.6.1) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../../03_SignalAndSlot/mainwidget.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'mainwidget.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.6.1. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE struct qt_meta_stringdata_MainWidget_t { QByteArrayData data[1]; char stringdata0[11]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ qptrdiff(offsetof(qt_meta_stringdata_MainWidget_t, stringdata0) + ofs \ - idx * sizeof(QByteArrayData)) \ ) static const qt_meta_stringdata_MainWidget_t qt_meta_stringdata_MainWidget = { { QT_MOC_LITERAL(0, 0, 10) // "MainWidget" }, "MainWidget" }; #undef QT_MOC_LITERAL static const uint qt_meta_data_MainWidget[] = { // content: 7, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount 0 // eod }; void MainWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); Q_UNUSED(_a); } const QMetaObject MainWidget::staticMetaObject = { { &QWidget::staticMetaObject, qt_meta_stringdata_MainWidget.data, qt_meta_data_MainWidget, qt_static_metacall, Q_NULLPTR, Q_NULLPTR} }; const QMetaObject *MainWidget::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *MainWidget::qt_metacast(const char *_clname) { if (!_clname) return Q_NULLPTR; if (!strcmp(_clname, qt_meta_stringdata_MainWidget.stringdata0)) return static_cast<void*>(const_cast< MainWidget*>(this)); return QWidget::qt_metacast(_clname); } int MainWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; return _id; } QT_END_MOC_NAMESPACE
[ "20181218010@nuist.edu.cn" ]
20181218010@nuist.edu.cn
0c769533ae6d9dbe2ecfd040623eb7a2b5a2698f
9f2b07eb0e9467e17448de413162a14f8207e5d0
/tests/libtests/meshio/TestDataWriterHDF5ExtMesh.cc
5f4ecf9727a59e511269502573a296070b7bec56
[ "MIT" ]
permissive
fjiaqi/pylith
2aa3f7fdbd18f1205a5023f8c6c4182ff533c195
67bfe2e75e0a20bb55c93eb98bef7a9b3694523a
refs/heads/main
2023-09-04T19:24:51.783273
2021-10-19T17:01:41
2021-10-19T17:01:41
373,739,198
0
0
MIT
2021-06-04T06:12:08
2021-06-04T06:12:07
null
UTF-8
C++
false
false
7,346
cc
// -*- C++ -*- // // ---------------------------------------------------------------------- // // Brad T. Aagaard, U.S. Geological Survey // Charles A. Williams, GNS Science // Matthew G. Knepley, University at Buffalo // // This code was developed as part of the Computational Infrastructure // for Geodynamics (http://geodynamics.org). // // Copyright (c) 2010-2021 University of California, Davis // // See LICENSE.md for license information. // // ---------------------------------------------------------------------- // #include <portinfo> #include "TestDataWriterHDF5ExtMesh.hh" // Implementation of class methods #include "pylith/utils/types.hh" // HASA PylithScalar #include "pylith/topology/Mesh.hh" // USES Mesh #include "pylith/topology/Field.hh" // USES Field #include "pylith/meshio/DataWriterHDF5Ext.hh" // USES DataWriterHDF5Ext #include "pylith/meshio/OutputSubfield.hh" // USES OutputSubfield #include "pylith/utils/error.hh" // USES PYLITH_METHOD* // ------------------------------------------------------------------------------------------------ // Setup testing data. void pylith::meshio::TestDataWriterHDF5ExtMesh::setUp(void) { PYLITH_METHOD_BEGIN; TestDataWriterMesh::setUp(); _data = NULL; PYLITH_METHOD_END; } // setUp // ------------------------------------------------------------------------------------------------ // Tear down testing data. void pylith::meshio::TestDataWriterHDF5ExtMesh::tearDown(void) { PYLITH_METHOD_BEGIN; TestDataWriterMesh::tearDown(); delete _data;_data = NULL; PYLITH_METHOD_END; } // tearDown // ------------------------------------------------------------------------------------------------ // Test constructor void pylith::meshio::TestDataWriterHDF5ExtMesh::testConstructor(void) { PYLITH_METHOD_BEGIN; DataWriterHDF5Ext writer; CPPUNIT_ASSERT(writer._h5); PYLITH_METHOD_END; } // testConstructor // ------------------------------------------------------------------------------------------------ // Test filename() void pylith::meshio::TestDataWriterHDF5ExtMesh::testFilename(void) { PYLITH_METHOD_BEGIN; DataWriterHDF5Ext writer; const char* filename = "data.h5"; writer.filename(filename); CPPUNIT_ASSERT_EQUAL(std::string(filename), writer._filename); PYLITH_METHOD_END; } // testFilename // ------------------------------------------------------------------------------------------------ // Test open() and close() void pylith::meshio::TestDataWriterHDF5ExtMesh::testOpenClose(void) { PYLITH_METHOD_BEGIN; CPPUNIT_ASSERT(_mesh); CPPUNIT_ASSERT(_data); DataWriterHDF5Ext writer; writer.filename(_data->opencloseFilename); const bool isInfo = false; writer.open(*_mesh, isInfo); writer.close(); checkFile(_data->opencloseFilename); PYLITH_METHOD_END; } // testOpenClose // ------------------------------------------------------------------------------------------------ // Test writeVertexField. void pylith::meshio::TestDataWriterHDF5ExtMesh::testWriteVertexField(void) { PYLITH_METHOD_BEGIN; CPPUNIT_ASSERT(_mesh); CPPUNIT_ASSERT(_data); DataWriterHDF5Ext writer; topology::Field vertexField(*_mesh); _createVertexField(&vertexField); writer.filename(_data->vertexFilename); const PylithScalar timeScale = 4.0; writer.setTimeScale(timeScale); const PylithScalar t = _data->time / timeScale; const bool isInfo = false; writer.open(*_mesh, isInfo); writer.openTimeStep(t, *_mesh); const pylith::string_vector& subfieldNames = vertexField.getSubfieldNames(); const size_t numFields = subfieldNames.size(); for (size_t i = 0; i < numFields; ++i) { OutputSubfield* subfield = OutputSubfield::create(vertexField, *_mesh, subfieldNames[i].c_str(), 1); CPPUNIT_ASSERT(subfield); subfield->project(vertexField.getOutputVector()); writer.writeVertexField(t, *subfield); delete subfield;subfield = NULL; } // for writer.closeTimeStep(); writer.close(); checkFile(_data->vertexFilename); PYLITH_METHOD_END; } // testWriteVertexField // ------------------------------------------------------------------------------------------------ // Test writeCellField. void pylith::meshio::TestDataWriterHDF5ExtMesh::testWriteCellField(void) { PYLITH_METHOD_BEGIN; CPPUNIT_ASSERT(_mesh); CPPUNIT_ASSERT(_data); DataWriterHDF5Ext writer; topology::Field cellField(*_mesh); _createCellField(&cellField); writer.filename(_data->cellFilename); const PylithScalar timeScale = 4.0; writer.setTimeScale(timeScale); const PylithScalar t = _data->time / timeScale; const bool isInfo = false; writer.open(*_mesh, isInfo); writer.openTimeStep(t, *_mesh); const pylith::string_vector& subfieldNames = cellField.getSubfieldNames(); const size_t numFields = subfieldNames.size(); for (size_t i = 0; i < numFields; ++i) { OutputSubfield* subfield = OutputSubfield::create(cellField, *_mesh, subfieldNames[i].c_str(), 0); CPPUNIT_ASSERT(subfield); subfield->project(cellField.getOutputVector()); writer.writeCellField(t, *subfield); delete subfield;subfield = NULL; } // for writer.closeTimeStep(); writer.close(); checkFile(_data->cellFilename); PYLITH_METHOD_END; } // testWriteCellField // ------------------------------------------------------------------------------------------------ // Test hdf5Filename(). void pylith::meshio::TestDataWriterHDF5ExtMesh::testHdf5Filename(void) { PYLITH_METHOD_BEGIN; DataWriterHDF5Ext writer; // Append info to filename if number of time steps is 0. writer._isInfo = true; writer._filename = "output.h5"; CPPUNIT_ASSERT_EQUAL(std::string("output_info.h5"), writer.hdf5Filename()); writer._isInfo = false; writer._filename = "output_abc.h5"; CPPUNIT_ASSERT_EQUAL(std::string("output_abc.h5"), writer.hdf5Filename()); writer._isInfo = false; writer._filename = "output_abcd.h5"; CPPUNIT_ASSERT_EQUAL(std::string("output_abcd.h5"), writer.hdf5Filename()); PYLITH_METHOD_END; } // testHdf5Filename // ------------------------------------------------------------------------------------------------ // Test _datasetFilename(). void pylith::meshio::TestDataWriterHDF5ExtMesh::testDatasetFilename(void) { PYLITH_METHOD_BEGIN; DataWriterHDF5Ext writer; // Append info to filename if info. writer._isInfo = true; writer._filename = "output.h5"; CPPUNIT_ASSERT_EQUAL(std::string("output_info_ABCD.dat"), writer._datasetFilename("ABCD")); writer._isInfo = false; writer._filename = "output_abc.h5"; CPPUNIT_ASSERT_EQUAL(std::string("output_abc_field1.dat"), writer._datasetFilename("field1")); writer._isInfo = false; writer._filename = "output_abcd.h5"; CPPUNIT_ASSERT_EQUAL(std::string("output_abcd_field2.dat"), writer._datasetFilename("field2")); PYLITH_METHOD_END; } // testDatasetFilename // ------------------------------------------------------------------------------------------------ // Get test data. pylith::meshio::TestDataWriter_Data* pylith::meshio::TestDataWriterHDF5ExtMesh::_getData(void) { return _data; } // _getData // End of file
[ "baagaard@usgs.gov" ]
baagaard@usgs.gov
cf3dae24d92e870c874bf75c46d42caf0091be12
cb7f4e9e4be108167ba6403e30ebb15c540677f8
/backend_t/backends/umesimd/plugins/avx2/int/UMESimdVecInt32_32.h
e92eb78a237ea320c24e52ad1a75ffdfd0670177
[]
no_license
nicholasferguson/Portable_SIMD
9aee993d97668985533625b5dce8c9b41af6167c
2d2ec5bf89890a618759dabb59fbd9b2a989f839
refs/heads/master
2021-01-12T17:24:51.220527
2017-10-18T23:35:43
2017-10-18T23:35:43
68,247,847
1
0
null
null
null
null
UTF-8
C++
false
false
13,903
h
// The MIT License (MIT) // // Copyright (c) 2015 CERN // // Author: Przemyslaw Karpinski // // 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. // // // This piece of code was developed as part of ICE-DIP project at CERN. // "ICE-DIP is a European Industrial Doctorate project funded by the European Community's // 7th Framework programme Marie Curie Actions under grant PITN-GA-2012-316596". // #ifndef UME_SIMD_VEC_INT32_32_H_ #define UME_SIMD_VEC_INT32_32_H_ #include <type_traits> #include "../../../UMESimdInterface.h" #include <immintrin.h> #define BLEND(a_256i, b_256i, mask_256i) _mm256_castps_si256( \ _mm256_blendv_ps( \ _mm256_castsi256_ps(a_256i), \ _mm256_castsi256_ps(b_256i), \ _mm256_castsi256_ps(mask_256i))) namespace UME { namespace SIMD { template<> class SIMDVec_i<int32_t, 32> : public SIMDVecSignedInterface< SIMDVec_i<int32_t, 32>, SIMDVec_u<uint32_t, 32>, int32_t, 32, uint32_t, SIMDVecMask<32>, SIMDSwizzle<32>> , public SIMDVecPackableInterface< SIMDVec_i<int32_t, 32>, SIMDVec_i<int32_t, 16>> { friend class SIMDVec_u<uint32_t, 32>; friend class SIMDVec_f<float, 32>; friend class SIMDVec_f<double, 32>; private: __m256i mVec[4]; inline explicit SIMDVec_i(__m256i & x0, __m256i & x1, __m256i & x2, __m256i & x3) { mVec[0] = x0; mVec[1] = x1; mVec[2] = x2; mVec[3] = x3; } public: // ZERO-CONSTR inline SIMDVec_i() {}; // SET-CONSTR inline SIMDVec_i(int32_t i) { mVec[0] = _mm256_set1_epi32(i); mVec[1] = _mm256_set1_epi32(i); mVec[2] = _mm256_set1_epi32(i); mVec[3] = _mm256_set1_epi32(i); } // This constructor is used to force types other than SCALAR_TYPES // to be promoted to SCALAR_TYPE instead of SCALAR_TYPE*. This prevents // ambiguity between SET-CONSTR and LOAD-CONSTR. template<typename T> inline SIMDVec_i( T i, typename std::enable_if< std::is_same<T, int>::value && !std::is_same<T, int32_t>::value, void*>::type = nullptr) : SIMDVec_i(static_cast<int32_t>(i)) {} // LOAD-CONSTR inline explicit SIMDVec_i(int32_t const * p) { mVec[0] = _mm256_loadu_si256((__m256i *)p); mVec[1] = _mm256_loadu_si256((__m256i *)(p + 8)); mVec[2] = _mm256_loadu_si256((__m256i *)(p + 16)); mVec[3] = _mm256_loadu_si256((__m256i *)(p + 24)); } inline SIMDVec_i(int32_t i0, int32_t i1, int32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6, int32_t i7, int32_t i8, int32_t i9, int32_t i10, int32_t i11, int32_t i12, int32_t i13, int32_t i14, int32_t i15, int32_t i16, int32_t i17, int32_t i18, int32_t i19, int32_t i20, int32_t i21, int32_t i22, int32_t i23, int32_t i24, int32_t i25, int32_t i26, int32_t i27, int32_t i28, int32_t i29, int32_t i30, int32_t i31) { mVec[0] = _mm256_setr_epi32(i0, i1, i2, i3, i4, i5, i6, i7); mVec[1] = _mm256_setr_epi32(i8, i9, i10, i11, i12, i13, i14, i15); mVec[2] = _mm256_setr_epi32(i16, i17, i18, i19, i20, i21, i22, i23); mVec[3] = _mm256_setr_epi32(i24, i25, i26, i27, i28, i29, i30, i31); } // EXTRACT inline int32_t extract(uint32_t index) const { //UME_PERFORMANCE_UNOPTIMAL_WARNING(); //return _mm256_extract_epi32(mVec, index); // TODO: this can be implemented in ICC alignas(32) int32_t raw[8]; int32_t value; if (index < 8) { _mm256_store_si256((__m256i *)raw, mVec[0]); value = raw[index]; } else if(index < 16) { _mm256_store_si256((__m256i *)raw, mVec[1]); value = raw[index - 8]; } else if (index < 24) { _mm256_store_si256((__m256i *)raw, mVec[2]); value = raw[index - 16]; } else { _mm256_store_si256((__m256i *)raw, mVec[3]); value = raw[index - 24]; } return value; } inline int32_t operator[] (uint32_t index) const { return extract(index); } // INSERT inline SIMDVec_i & insert(uint32_t index, int32_t value) { //UME_PERFORMANCE_UNOPTIMAL_WARNING() alignas(32) int32_t raw[8]; if (index < 8) { _mm256_store_si256((__m256i *) raw, mVec[0]); raw[index] = value; mVec[0] = _mm256_load_si256((__m256i *)raw); } else if (index < 16) { _mm256_store_si256((__m256i *) raw, mVec[1]); raw[index - 8] = value; mVec[1] = _mm256_load_si256((__m256i *) raw); } else if (index < 24) { _mm256_store_si256((__m256i *) raw, mVec[2]); raw[index - 16] = value; mVec[2] = _mm256_load_si256((__m256i *) raw); } else { _mm256_store_si256((__m256i *) raw, mVec[3]); raw[index - 24] = value; mVec[3] = _mm256_load_si256((__m256i *) raw); } return *this; } inline IntermediateIndex<SIMDVec_i, int32_t> operator[] (uint32_t index) { return IntermediateIndex<SIMDVec_i, int32_t>(index, static_cast<SIMDVec_i &>(*this)); } // Override Mask Access operators #if defined(USE_PARENTHESES_IN_MASK_ASSIGNMENT) inline IntermediateMask<SIMDVec_i, int32_t, SIMDVecMask<32>> operator() (SIMDVecMask<32> const & mask) { return IntermediateMask<SIMDVec_i, int32_t, SIMDVecMask<32>>(mask, static_cast<SIMDVec_i &>(*this)); } #else inline IntermediateMask<SIMDVec_i, int32_t, SIMDVecMask<32>> operator[] (SIMDVecMask<32> const & mask) { return IntermediateMask<SIMDVec_i, int32_t, SIMDVecMask<32>>(mask, static_cast<SIMDVec_i &>(*this)); } #endif // ASSIGNV inline SIMDVec_i & assign(SIMDVec_i const & b) { mVec[0] = b.mVec[0]; mVec[1] = b.mVec[1]; mVec[2] = b.mVec[2]; mVec[3] = b.mVec[3]; return *this; } inline SIMDVec_i & operator= (SIMDVec_i const & b) { return assign(b); } // MASSIGNV inline SIMDVec_i & assign(SIMDVecMask<32> const & mask, SIMDVec_i const & b) { mVec[0] = _mm256_blendv_epi8(mVec[0], b.mVec[0], mask.mMask[0]); mVec[1] = _mm256_blendv_epi8(mVec[1], b.mVec[1], mask.mMask[1]); mVec[2] = _mm256_blendv_epi8(mVec[2], b.mVec[2], mask.mMask[2]); mVec[3] = _mm256_blendv_epi8(mVec[3], b.mVec[3], mask.mMask[3]); return *this; } // ASSIGNS inline SIMDVec_i & assign(int32_t b) { mVec[0] = _mm256_set1_epi32(b); mVec[1] = _mm256_set1_epi32(b); mVec[2] = _mm256_set1_epi32(b); mVec[3] = _mm256_set1_epi32(b); return *this; } inline SIMDVec_i & operator= (int32_t b) { return assign(b); } // MASSIGNS inline SIMDVec_i & assign(SIMDVecMask<32> const & mask, int32_t b) { __m256i t0 = _mm256_set1_epi32(b); mVec[0] = _mm256_blendv_epi8(mVec[0], t0, mask.mMask[0]); mVec[1] = _mm256_blendv_epi8(mVec[1], t0, mask.mMask[1]); mVec[2] = _mm256_blendv_epi8(mVec[2], t0, mask.mMask[2]); mVec[3] = _mm256_blendv_epi8(mVec[3], t0, mask.mMask[3]); return *this; } // LOAD inline SIMDVec_i & load(int32_t const * p) { mVec[0] = _mm256_loadu_si256((__m256i*)p); mVec[1] = _mm256_loadu_si256((__m256i*)(p + 8)); mVec[2] = _mm256_loadu_si256((__m256i*)(p + 16)); mVec[3] = _mm256_loadu_si256((__m256i*)(p + 24)); return *this; } // MLOAD inline SIMDVec_i & load(SIMDVecMask<32> const & mask, int32_t const * p) { __m256i t0 = _mm256_loadu_si256((__m256i*)p); __m256i t1 = _mm256_loadu_si256((__m256i*)(p + 8)); __m256i t2 = _mm256_loadu_si256((__m256i*)(p + 16)); __m256i t3 = _mm256_loadu_si256((__m256i*)(p + 24)); mVec[0] = _mm256_blendv_epi8(mVec[0], t0, mask.mMask[0]); mVec[1] = _mm256_blendv_epi8(mVec[1], t1, mask.mMask[1]); mVec[2] = _mm256_blendv_epi8(mVec[2], t2, mask.mMask[2]); mVec[3] = _mm256_blendv_epi8(mVec[3], t3, mask.mMask[3]); return *this; } // LOADA inline SIMDVec_i & loada(int32_t const * p) { mVec[0] = _mm256_load_si256((__m256i *)p); mVec[1] = _mm256_load_si256((__m256i *)(p + 8)); mVec[2] = _mm256_load_si256((__m256i *)(p + 16)); mVec[3] = _mm256_load_si256((__m256i *)(p + 24)); return *this; } // MLOADA inline SIMDVec_i & loada(SIMDVecMask<32> const & mask, int32_t const * p) { __m256i t0 = _mm256_load_si256((__m256i*)p); __m256i t1 = _mm256_load_si256((__m256i*)(p + 8)); __m256i t2 = _mm256_load_si256((__m256i*)(p + 16)); __m256i t3 = _mm256_load_si256((__m256i*)(p + 24)); mVec[0] = _mm256_blendv_epi8(mVec[0], t0, mask.mMask[0]); mVec[1] = _mm256_blendv_epi8(mVec[1], t1, mask.mMask[1]); mVec[2] = _mm256_blendv_epi8(mVec[2], t2, mask.mMask[2]); mVec[3] = _mm256_blendv_epi8(mVec[3], t3, mask.mMask[3]); return *this; } // STORE inline int32_t * store(int32_t * p) const { _mm256_storeu_si256((__m256i*)p, mVec[0]); _mm256_storeu_si256((__m256i*)(p + 8), mVec[1]); _mm256_storeu_si256((__m256i*)(p + 16), mVec[2]); _mm256_storeu_si256((__m256i*)(p + 24), mVec[3]); return p; } // MSTORE inline int32_t * store(SIMDVecMask<32> const & mask, int32_t * p) const { __m256i t0 = _mm256_loadu_si256((__m256i*)p); __m256i t1 = BLEND(t0, mVec[0], mask.mMask[0]); _mm256_storeu_si256((__m256i*)p, t1); __m256i t2 = _mm256_loadu_si256((__m256i*)(p + 8)); __m256i t3 = BLEND(t2, mVec[1], mask.mMask[1]); _mm256_storeu_si256((__m256i*)(p + 8), t3); __m256i t4 = _mm256_loadu_si256((__m256i*)(p + 16)); __m256i t5 = BLEND(t4, mVec[2], mask.mMask[2]); _mm256_storeu_si256((__m256i*)(p + 16), t5); __m256i t6 = _mm256_loadu_si256((__m256i*)(p + 24)); __m256i t7 = BLEND(t6, mVec[3], mask.mMask[3]); _mm256_storeu_si256((__m256i*)(p + 24), t7); return p; } // STOREA inline int32_t * storea(int32_t * p) const { _mm256_store_si256((__m256i*)p, mVec[0]); _mm256_store_si256((__m256i*)(p + 8), mVec[1]); _mm256_store_si256((__m256i*)(p + 16), mVec[2]); _mm256_store_si256((__m256i*)(p + 24), mVec[3]); return p; } // MSTORE inline int32_t * storea(SIMDVecMask<32> const & mask, int32_t * p) const { __m256i t0 = _mm256_load_si256((__m256i*)p); __m256i t1 = BLEND(t0, mVec[0], mask.mMask[0]); _mm256_store_si256((__m256i*)p, t1); __m256i t2 = _mm256_load_si256((__m256i*)(p + 8)); __m256i t3 = BLEND(t2, mVec[1], mask.mMask[1]); _mm256_store_si256((__m256i*)(p + 8), t3); __m256i t4 = _mm256_load_si256((__m256i*)(p + 16)); __m256i t5 = BLEND(t4, mVec[2], mask.mMask[2]); _mm256_store_si256((__m256i*)(p + 16), t5); __m256i t6 = _mm256_load_si256((__m256i*)(p + 24)); __m256i t7 = BLEND(t6, mVec[3], mask.mMask[3]); _mm256_store_si256((__m256i*)(p + 24), t7); return p; } // ABS // MABS // PROMOTE // - // DEGRADE inline operator SIMDVec_i<int16_t, 32>() const; // ITOU inline operator SIMDVec_u<uint32_t, 32> () const; // ITOF inline operator SIMDVec_f<float, 32> () const; }; } } #undef BLEND #endif
[ "nicholasferguson@wingarch.com" ]
nicholasferguson@wingarch.com
50061dfdfc4afe7c04ea3008534387ca6ce85df0
53798d960a6022813e35c55e9049226a315ff9e3
/src/qt/test/rpcnestedtests.h
c91f67c16b64c29fa50d6ad31b0d20b03c976e7b
[ "MIT" ]
permissive
ACB201887/acbx
8c6cfe1a5ef5da5d5da8c69a88d70784dc376597
26933485d6d9cab9580942e8bbd461e76065064f
refs/heads/master
2020-03-25T10:35:06.857735
2018-08-06T08:30:07
2018-08-06T08:30:07
143,697,575
0
0
null
null
null
null
UTF-8
C++
false
false
548
h
// Copyright (c) 2016 The ACB coin bt developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_TEST_RPC_NESTED_TESTS_H #define BITCOIN_QT_TEST_RPC_NESTED_TESTS_H #include <QObject> #include <QTest> #include "txdb.h" #include "txmempool.h" class RPCNestedTests : public QObject { Q_OBJECT private Q_SLOTS: void rpcNestedTests(); private: CCoinsViewDB *pcoinsdbview; }; #endif // BITCOIN_QT_TEST_RPC_NESTED_TESTS_H
[ "test@gmail.com" ]
test@gmail.com
61ed519575f8c91b49612263b1907400334f4d5f
ec68c973b7cd3821dd70ed6787497a0f808e18e1
/Cpp/SDK/Mod_SongOfSwords_functions.cpp
127c023b05fb6a7c32aebb7dd7fd13f21b1998d9
[]
no_license
Hengle/zRemnant-SDK
05be5801567a8cf67e8b03c50010f590d4e2599d
be2d99fb54f44a09ca52abc5f898e665964a24cb
refs/heads/main
2023-07-16T04:44:43.113226
2021-08-27T14:26:40
2021-08-27T14:26:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,972
cpp
// Name: Remnant, Version: 1.0 #include "../pch.h" /*!!DEFINE!!*/ /*!!HELPER_DEF!!*/ /*!!HELPER_INC!!*/ #ifdef _MSC_VER #pragma pack(push, 0x01) #endif namespace CG { //--------------------------------------------------------------------------- // Functions //--------------------------------------------------------------------------- // Function Mod_SongOfSwords.Mod_SongOfSwords_C.GetMinionDamageModScalar // () void AMod_SongOfSwords_C::GetMinionDamageModScalar() { static auto fn = UObject::FindObject<UFunction>("Function Mod_SongOfSwords.Mod_SongOfSwords_C.GetMinionDamageModScalar"); AMod_SongOfSwords_C_GetMinionDamageModScalar_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function Mod_SongOfSwords.Mod_SongOfSwords_C.GetDamageModScalar // () void AMod_SongOfSwords_C::GetDamageModScalar() { static auto fn = UObject::FindObject<UFunction>("Function Mod_SongOfSwords.Mod_SongOfSwords_C.GetDamageModScalar"); AMod_SongOfSwords_C_GetDamageModScalar_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function Mod_SongOfSwords.Mod_SongOfSwords_C.DoAction // () void AMod_SongOfSwords_C::DoAction() { static auto fn = UObject::FindObject<UFunction>("Function Mod_SongOfSwords.Mod_SongOfSwords_C.DoAction"); AMod_SongOfSwords_C_DoAction_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function Mod_SongOfSwords.Mod_SongOfSwords_C.ModifyInspectInfo // () void AMod_SongOfSwords_C::ModifyInspectInfo() { static auto fn = UObject::FindObject<UFunction>("Function Mod_SongOfSwords.Mod_SongOfSwords_C.ModifyInspectInfo"); AMod_SongOfSwords_C_ModifyInspectInfo_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "zp2kshield@gmail.com" ]
zp2kshield@gmail.com
ff72e764c4f2b40196b95b2fbbc5c3290ed87737
ecb78d552c2c13e177293bd26785459d21bc310d
/widget.cpp
8f434fb11cf06de1b44cf553804685e00478a057
[]
no_license
porrizxx/Cube
03ccbfb33e93a2aae441cec272badcb2ba30d38f
1314d4e0618bd965d478be8e050fb4868f36b54c
refs/heads/master
2023-08-10T09:54:23.844406
2017-12-04T01:27:51
2017-12-04T01:27:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,548
cpp
#include "widget.h" #include <QGridLayout> #include <QHBoxLayout> #include <QMessageBox> #include <QDebug> #include <iostream> #include <Qtsql/QSqlDatabase> #include <Qtsql/QSqlQuery> #include <QtSql/QSql> #include <QDebug> Widget::Widget(QWidget *parent) : QWidget(parent) { setWindowTitle(tr("登录界面")); userNameLabel = new QLabel(tr("用户名:")); passWordLabel = new QLabel(tr("密码:")); userNameLineEdit = new QLineEdit; passWordLineEdit = new QLineEdit; passWordLineEdit->setEchoMode(QLineEdit::Password); login = new QPushButton(tr("登录")); QGridLayout *mainLayout = new QGridLayout(this); mainLayout->addWidget(userNameLabel,0,0); mainLayout->addWidget(passWordLabel,1,0); mainLayout->addWidget(userNameLineEdit,0,1); mainLayout->addWidget(passWordLineEdit,1,1); QHBoxLayout *hBoxLayout = new QHBoxLayout; mainLayout->addLayout(hBoxLayout,2,0,1,2); hBoxLayout->addStretch(); hBoxLayout->addWidget(login); connect(login,SIGNAL(clicked()),this,SLOT(slotLogin())); connect(passWordLineEdit,SIGNAL(returnPressed()),this,SLOT(slotLogin())); } Widget::~Widget() { } void Widget::slotLogin(){ /* qDebug() << "输入用户名:"<< userNameLineEdit->text(); qDebug() << "输入密码:" << passWordLineEdit->text(); */ QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); db.setHostName("localhost"); db.setDatabaseName("Cube"); db.setUserName("root"); db.setPassword(""); QString username; QString password; if(db.open()) { QSqlQuery query; query.exec("select * from user"); int flag=0; while(query.next()) { username = query.value(5).toString(); password = query.value(6).toString(); //qDebug() << username << "|" << password; if (userNameLineEdit->text() == username && passWordLineEdit->text() == password) { qDebug() << "登录成功!"; QMessageBox::information(this,tr("登录提示"),tr("登录成功")); flag=1; break; } } if(flag==0) { qDebug() << "用户名或密码错误!"; QMessageBox::information(this,tr("登录提示"),tr("用户名或密码错误!")); } db.close(); } else { qDebug() << "opened error"; } }
[ "1119864054@qq.com" ]
1119864054@qq.com
678031c6b5388194bdd79d3439a08850fb04a637
61f27012e7029abe7026d50d64083d1d18616f01
/back/w_rpt_report_frame_member.cpp
a06214d528e7bc5abd364a4941e55fe41285aa9e
[]
no_license
sulwan/fastfdmain
504806817b46147bef5fef87e0f067dd04e94f0c
8ab6af657697300e030dbac1f8032d67e4da2459
refs/heads/master
2020-08-08T23:53:15.896897
2019-06-14T01:18:31
2019-06-14T01:18:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
44,835
cpp
#include "w_rpt_report_frame_member.h" #include "ui_w_rpt_report_frame_member.h" #include "ui_w_rpt_report_frame.h" #include "n_func.h" #include "backheader.h" #include <QtDebug> #include "lds_model_sqltablemodel_delegate_com.h" #include <QTableWidget> #include <QScrollBar> #include "w_m_member.h" #include "w_m_member_list_select.h" #include "ui_w_m_member_report_detail_dialog.h" #include "lds_pushbuttonlock.h" #include "lds_model_sqltablemodel_delegate_com.h" #include "w_m_member_report_detail_dialog.h" #include "fexpandmain_model_sqltablemodel_data.h" #include "fexpandmain_delegate_vch_printmemo.h" //num_dish_total //num_dish_real_total //num_price_add //num_total w_rpt_report_frame_member::w_rpt_report_frame_member(QWidget *parent) : w_rpt_report_frame( QStringList() << QObject::tr("会员充值付款汇总") << QObject::tr("会员充值付款明细") << QObject::tr("会员余额积分情况") << QObject::tr("会员商品消费汇总") << QObject::tr("会员商品消费明细") << QObject::tr("会员保本金额") << QObject::tr("会员卡量统计") << QObject::tr("会员挂账"), parent) { // ui_help = new Ui::w_rpt_report_frame_member; ui_help->setupUi(ui->frame_other); ui->widget->setup(QStringList() << QObject::tr("查询")<< QObject::tr("导出")<< QObject::tr("打印")<< QObject::tr("退出")); resize(lds::MAIN_WINDOW_SIZE); /// int idx = 0; //0会员充值付款汇总 ui->pushButton_step->insert_map_widget_visiable(idx, ui->label, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->label_2, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit_2, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_state, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_state, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->lineEdit_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->pushButton_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_dish_type, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_dish_type, 0); //1会员充值付款明细 idx++; ui->pushButton_step->insert_map_widget_visiable(idx, ui->label, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->label_2, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit_2, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->lineEdit_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->pushButton_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_vch_operid, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_vch_operid, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_dish_type, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_dish_type, 0); //2会员余额积分情况 idx++; ui->pushButton_step->insert_map_widget_visiable(idx, ui->label, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->label_2, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit_2, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_state, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_state, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_typeno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_typeno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->lineEdit_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->pushButton_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_dish_type, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_dish_type, 0); //3会员商品消费汇总 idx++; ui->pushButton_step->insert_map_widget_visiable(idx, ui->label, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->label_2, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit_2, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->lineEdit_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->pushButton_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_dish_type, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_dish_type, 1); //4会员商品消费明细 idx++; ui->pushButton_step->insert_map_widget_visiable(idx, ui->label, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->label_2, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit_2, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->lineEdit_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->pushButton_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_dish_type, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_dish_type, 0); //5会员保本金额 idx++; ui->pushButton_step->insert_map_widget_visiable(idx, ui->label, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->label_2, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit_2, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_state, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_state, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_typeno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_typeno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->lineEdit_vch_memberno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->pushButton_vch_memberno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_dish_type, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_dish_type, 0); //6会员卡量统计 idx++; ui->pushButton_step->insert_map_widget_visiable(idx, ui->label, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->label_2, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit_2, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_typeno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_typeno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->lineEdit_vch_memberno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->pushButton_vch_memberno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_dish_type, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_dish_type, 0); //7会员挂账 idx++; ui->pushButton_step->insert_map_widget_visiable(idx, ui->label, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->label_2, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui->dateTimeEdit_2, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_state, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_typeno, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->lineEdit_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->pushButton_vch_memberno, 1); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_vch_operid, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->label_ch_dish_type, 0); ui->pushButton_step->insert_map_widget_visiable(idx, ui_help->comboBox_ch_dish_type, 0); ui->pushButton_step->update_map_widget_visiable(0); ///~ ui_help->comboBox_ch_state->addItem(QObject::tr("全部"), "%"); ui_help->comboBox_ch_state->addItemsByMap(w_m_member::get_VIP_MODEL_STATE()); ui_help->comboBox_ch_typeno->addItem(QObject::tr("全部"), "%"); ui_help->comboBox_ch_typeno->addItemsBySql("select ch_typeno, vch_typename from t_m_member_type "); ui_help->comboBox_ch_dish_type->addItem(QObject::tr("全部"), "%"); ui_help->comboBox_ch_dish_type->addItemsBySql("SELECT ch_dish_typeno, vch_dish_typename FROM cey_bt_dish_type; "); ui_help->comboBox_vch_operid->addItemsBySql(backheader::SELECT_OPERID_NAME); // connect(ui_help->pushButton_vch_memberno, SIGNAL(clicked()),this,SLOT(toget_m())); connect(ui->widget->index_widget(QObject::tr("查询")), SIGNAL(clicked()),this,SLOT(toselect())); connect(ui->widget->index_widget(QObject::tr("退出")), SIGNAL(clicked()),this,SLOT(toexit())); connect(ui->widget->index_widget(QObject::tr("导出")), SIGNAL(clicked()),this,SLOT(toexport())); connect(ui->widget->index_widget(QObject::tr("打印")), SIGNAL(clicked()),this,SLOT(toprint())); } w_rpt_report_frame_member::~w_rpt_report_frame_member() { delete ui_help; } void w_rpt_report_frame_member::toget_m() { w_m_member_list_select dialog(this); if(QDialog::Accepted == transparentCenterDialog(&dialog).exec()) { ui_help->lineEdit_vch_memberno->setText(dialog.ret_m); } } void w_rpt_report_frame_member::toselect() { lds_pushbuttonlock b(ui->widget->index_widget(QObject::tr("查询"))); b.toLock(); lds_query_hddpos query; int index = ui->stackedWidget->currentIndex(); QTableView *tableview = static_cast<QTableView *>(ui->stackedWidget->widget(index)); report_querymodel *model = static_cast<report_querymodel *>(tableview->model()); // static int onepagestep = -1; if(onepagestep == -1) { QTableWidget t; t.setColumnCount(1); onepagestep = ( tableview->height() - tableview->horizontalScrollBar()->height()- t.horizontalHeader()->height() ) / tableview->verticalHeader()->defaultSectionSize(); } // ui->pushButton_step->init(index); switch(index) { case 0:///会员充值付款汇总报表 { // QString sql_where = " FROM " " t_m_member, " " t_m_member_type " " WHERE " " (t_m_member.ch_typeno = t_m_member_type.ch_typeno) " " and (t_m_member_type.ch_attribute = '2') " " AND (t_m_member.vch_memberno like '%3%' " " or t_m_member.vch_member like '%3%') " " and t_m_member.ch_state like '%4' " ; query.execSelect(QString("select count(0) "+sql_where) //开始时间、结束时间、会员3、卡状态4 .arg(ui_help->lineEdit_vch_memberno->text()) .arg(ui_help->comboBox_ch_state->itemData(ui_help->comboBox_ch_state->currentIndex()).toString()) ); query.next(); int rowcount = query.recordValue(0).toInt(); ui->pushButton_step->init(index, rowcount, onepagestep, QString(" SELECT " " t_m_member.vch_memberno, " " t_m_member.vch_member, " " t_m_member_type.vch_typename as m_typename, " " t_m_member.ch_state, " " (select " " ifnull(sum(case " " when t_m_deposit.ch_deposit_mode = '4' then 0 " " else t_m_deposit.num_deposit " " end), " " 0) " " from " " t_m_deposit " " where " " t_m_deposit.vch_memberno = t_m_member.vch_memberno " " and t_m_deposit.dt_operdate between '%1' and '%2') as m_deposit, " " (select " " ifnull(sum(t_m_deposit.num_realamount), 0) " " from " " t_m_deposit " " where " " t_m_deposit.vch_memberno = t_m_member.vch_memberno " " and t_m_deposit.dt_operdate between '%1' and '%2') as m_deposit_real, " " (select " " sum(case when " " ifnull(case " " when t_m_deposit.ch_deposit_mode = '4' then 0 " " else t_m_deposit.num_deposit " " end, " " 0) - ifnull(t_m_deposit.num_realamount, 0) > 0 " " then " " ifnull(case " " when t_m_deposit.ch_deposit_mode = '4' then 0 " " else t_m_deposit.num_deposit " " end, " " 0) - ifnull(t_m_deposit.num_realamount, 0) " " else 0 " " end) " " from " " t_m_deposit " " where " " t_m_deposit.vch_memberno = t_m_member.vch_memberno " " and t_m_deposit.dt_operdate between '%1' and '%2') as m_deposit_discount, " " (select " " ifnull(sum(num_pay), 0) " " from " " t_m_pay " " where " " t_m_pay.vch_memberno = t_m_member.vch_memberno " " and t_m_pay.dt_operdate between '%1' and '%2') as num_pay " + sql_where ) //开始时间、结束时间、会员、卡状态 .arg(ui->dateTimeEdit->dateTimeStr()) .arg(ui->dateTimeEdit_2->dateTimeStr()) .arg(ui_help->lineEdit_vch_memberno->text()) .arg(ui_help->comboBox_ch_state->itemData(ui_help->comboBox_ch_state->currentIndex()).toString()) ); // toselect_page(); if(tableview->itemDelegateForColumn(model->fieldIndex("ch_state")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_state"), new lds_model_sqltablemodel_delegate_com(this, &w_m_member::get_VIP_MODEL_STATE())); } // ui->pushButton_step->sum_clear(index); ui->pushButton_step->sum_append(index, "m_deposit"); ui->pushButton_step->sum_append(index, "m_deposit_real"); ui->pushButton_step->sum_append(index, "m_deposit_discount"); ui->pushButton_step->sum_append(index, "num_pay"); ui->pushButton_step->sum_genrate(index); } break;///~会员充值付款汇总报表 case 1:///1会员充值付款明细 { QString sqlarg = " select " " b.vch_memberno," " b.vch_member," " a.dt_operdate," " a.ch_deposit_mode as ch_type," " a.ch_pay_mode, " " 0 as num_pay," " a.num_deposit, " " a.num_realamount, " " a.num_deposit - a.num_realamount as num_free," " a.vch_operid, " " a.vch_memo " " From" " t_m_deposit a, t_m_member b" " Where" " a.vch_memberno = b.vch_memberno" " and a.vch_memberno like '%1%'" " and a.dt_operdate >= '%2'" " and a.dt_operdate <= '%3'" " and a.vch_operID = '%4' " " union all " " select " " b.vch_memberno," " b.vch_member," " a.dt_operdate as dt_operdate," " '9' as ch_type," " '0' as ch_pay_mode," " a.num_pay as num_pay," " 0 as num_deposit," " 0 as num_realamount," " 0 as num_free," " a.vch_operid as vch_operid," " '' as vch_memo" " From" " t_m_pay a, t_m_member b" " Where" " a.vch_memberno = b.vch_memberno" " and a.vch_memberno like '%1%' " " and a.dt_operdate >= '%2'" " and a.dt_operdate <= '%3'" " and a.vch_operID = '%4' " ; sqlarg = sqlarg .arg(ui_help->lineEdit_vch_memberno->text()) .arg(ui->dateTimeEdit->dateTimeStr()) .arg(ui->dateTimeEdit_2->dateTimeStr()) .arg(ui_help->comboBox_vch_operid->itemData(ui_help->comboBox_vch_operid->currentIndex()).toString()) ; model->setQuery(sqlarg); if(tableview->itemDelegateForColumn(model->fieldIndex("ch_type")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_type"), new lds_model_sqltablemodel_delegate_com( tableview, &w_m_member::get_RECHARGE_MODEL_CH_DEPOSIT_MODE())); } if(tableview->itemDelegateForColumn(model->fieldIndex("ch_pay_mode")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_pay_mode"), new lds_model_sqltablemodel_delegate_com( tableview, &w_m_member::get_RECHARGE_MODEL_PAYMODE())); } if(tableview->itemDelegateForColumn(model->fieldIndex("vch_operID")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("vch_operID"), new lds_model_sqltablemodel_delegate_com( tableview, ui_help->comboBox_vch_operid)); } ui->pushButton_step->init(index, 0, onepagestep, sqlarg); // ui->pushButton_step->sum_clear(index); ui->pushButton_step->sum_append(index, "num_pay"); ui->pushButton_step->sum_append(index, "num_deposit"); ui->pushButton_step->sum_append(index, "num_realamount"); ui->pushButton_step->sum_append(index, "num_free"); ui->pushButton_step->sum_genrate(index); } break;///~1会员充值付款明细 case 2:///会员余额积分情况 { // QString sql_where = " From " " t_m_member a, " " t_m_member_type b, " " t_m_curamount c " " Where " " a.ch_typeno = b.ch_typeno " " and a.vch_memberno = c.vch_memberno " " and a.ch_typeno like '%1' " " and a.vch_memberno like '%2%' " " and a.ch_state like '%3' " ; query.execSelect(QString("select count(0) "+sql_where) //卡类型、卡号、卡状态 .arg(ui_help->comboBox_ch_typeno->itemData(ui_help->comboBox_ch_typeno->currentIndex()).toString()) .arg(ui_help->lineEdit_vch_memberno->text()) .arg(ui_help->comboBox_ch_state->itemData(ui_help->comboBox_ch_state->currentIndex()).toString()) ); query.next(); int rowcount = query.recordValue(0).toInt(); ui->pushButton_step->init(index, rowcount, onepagestep, QString( " Select " " a.vch_memberno, " " a.vch_member, " " b.vch_typename as m_typename, " " a.ch_state, " " ifnull(c.num_amount, 0) as num_remain, " " ifnull(c.num_point, 0) as num_point, " " c.dt_operdate, " " vch_handtel, " " b.ch_attribute " + sql_where ) //卡类型、卡号、卡状态 .arg(ui_help->comboBox_ch_typeno->itemData(ui_help->comboBox_ch_typeno->currentIndex()).toString()) .arg(ui_help->lineEdit_vch_memberno->text()) .arg(ui_help->comboBox_ch_state->itemData(ui_help->comboBox_ch_state->currentIndex()).toString()) ); // toselect_page(); if(tableview->itemDelegateForColumn(model->fieldIndex("ch_state")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_state"), new lds_model_sqltablemodel_delegate_com(this, &w_m_member::get_VIP_MODEL_STATE())); } if(tableview->itemDelegateForColumn(model->fieldIndex("ch_attribute")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_attribute"), new lds_model_sqltablemodel_delegate_com(this, &w_m_member::get_VIP_MODEL_ATTRI())); } // ui->pushButton_step->sum_clear(index); ui->pushButton_step->sum_append(index, "num_remain"); ui->pushButton_step->sum_append(index, "num_point"); ui->pushButton_step->sum_genrate(index); } break;///~会员余额积分情况 case 3:///会员商品消费汇总 { // QString sql_where = " FROM " " cey_u_orderdish a, " " cey_u_checkout_master b, " " cey_bt_dish c, " " t_m_member_type t, " " t_m_member m " " WHERE " " (a.ch_payno = b.ch_payno) " " and (b.ch_state = 'Y') " " and (a.ch_dishno = c.ch_dishno) " " and (a.num_num - a.num_back <> 0) " " and m.vch_memberno = b.vch_memberno " " and m.ch_typeno = t.ch_typeno " " and b.dt_operdate >= '%1' " " and b.dt_operdate <= '%2' " " and (m.vch_memberno like '%3%' " " or m.vch_member like '%3%') " " and c.ch_dish_typeno like '%4' " " Group by a.ch_dishno " ; sql_where = sql_where //开始时间、结束时间、卡号 .arg(ui->dateTimeEdit->dateTimeStr()) .arg(ui->dateTimeEdit_2->dateTimeStr()) .arg(ui_help->lineEdit_vch_memberno->text()) .arg(ui_help->comboBox_ch_dish_type->curusrdata().toString()); query.execSelect(sql_count_arg1.arg(sql_where)); query.next(); int rowcount = query.recordValue(0).toInt(); ui->pushButton_step->init(index, rowcount, onepagestep, QString( " SELECT " " a.ch_dishno, " " c.vch_dishname, " " c.ch_unitno, " " c.ch_dish_typeno, " " sum(a.num_num - a.num_back) as num_dish, " " sum( ((a.num_num - a.num_back) * a.num_price) ) as num_total, " " sum( if(a.ch_presentflag = 'Y', (a.num_num-a.num_back)*a.num_price, 0)) as num_present, " " sum( (a.num_num-a.num_back)*a.num_price * (1 - a.int_discount * 0.01 ) ) as num_discount, " " sum( if(a.ch_presentflag = 'Y', 0, (a.num_num-a.num_back)*a.num_price * (a.int_discount * 0.01 ) )) as num_total2, " " sum( num_price_add ) as num_price_add, " " sum( if(a.ch_presentflag = 'Y', 0, (a.num_num-a.num_back)*a.num_price * (a.int_discount * 0.01 )+num_price_add )) as num_total3 " + sql_where ) ); // toselect_page(); if(tableview->itemDelegateForColumn(model->fieldIndex("ch_unitno")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_unitno"), new lds_model_sqltablemodel_delegate_com(this, "cey_bt_unit", "ch_unitno", "vch_unitname")); } if(tableview->itemDelegateForColumn(model->fieldIndex("ch_dish_typeno")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_dish_typeno"), new lds_model_sqltablemodel_delegate_com(this, "cey_bt_dish_type", "ch_dish_typeno", "vch_dish_typename")); } // ui->pushButton_step->sum_clear(index); ui->pushButton_step->sum_append(index, "num_dish"); ui->pushButton_step->sum_append(index, "num_total"); ui->pushButton_step->sum_append(index, "num_present"); ui->pushButton_step->sum_append(index, "num_discount"); ui->pushButton_step->sum_append(index, "num_total2"); ui->pushButton_step->sum_append(index, "num_price_add"); ui->pushButton_step->sum_append(index, "num_total3"); ui->pushButton_step->sum_genrate(index); } break;///~会员商品消费汇总 case 4:///会员商品消费明细 { // QString sql_where = " FROM " " cey_u_orderdish a, " " cey_u_checkout_master b, " " cey_bt_dish c, " " t_m_member_type t, " " t_m_member m " " WHERE " " (a.ch_payno = b.ch_payno) " " and (b.ch_state = 'Y') " " and (a.ch_dishno = c.ch_dishno) " " and (a.num_num - a.num_back <> 0) " " and m.vch_memberno = b.vch_memberno " " and m.ch_typeno = t.ch_typeno " " and b.dt_operdate >= '%1' " " and b.dt_operdate <= '%2' " " and (m.vch_memberno like '%3%' " " or m.vch_member like '%3%') " ; sql_where = sql_where //开始时间、结束时间、卡号 .arg(ui->dateTimeEdit->dateTimeStr()) .arg(ui->dateTimeEdit_2->dateTimeStr()) .arg(ui_help->lineEdit_vch_memberno->text()) ; query.execSelect(sql_count_arg1.arg(sql_where)); query.next(); int rowcount = query.recordValue(0).toInt(); ui->pushButton_step->init(index, rowcount, onepagestep, QString( " Select " " t.vch_typename as m_typename, " " b.vch_memberno, " " a.ch_dishno, " " c.vch_dishname, " " (a.num_num - a.num_back) as num_dish, " " a.num_price, " " ( ((a.num_num - a.num_back) * a.num_price) ) as num_total, " " ( if(a.ch_presentflag = 'Y', (a.num_num-a.num_back)*a.num_price, 0)) as num_present, " " ( (a.num_num-a.num_back)*a.num_price * (1 - a.int_discount * 0.01 ) ) as num_discount, " " ( if(a.ch_presentflag = 'Y', 0, (a.num_num-a.num_back)*a.num_price * (a.int_discount * 0.01 ) )) as num_total2, " " a.vch_print_memo , " " a.num_price_add, " " ( a.num_price_add + if(a.ch_presentflag = 'Y', 0, (a.num_num-a.num_back)*a.num_price * (a.int_discount * 0.01 ) )) num_total3, " " a.dt_operdate, " " a.ch_payno " + sql_where ) ); // toselect_page(); if(tableview->itemDelegateForColumn(model->fieldIndex("vch_print_memo")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("vch_print_memo"), new fexpandmain_delegate_vch_printmemo(this)); } // ui->pushButton_step->sum_clear(index); ui->pushButton_step->sum_append(index, "num_dish"); ui->pushButton_step->sum_append(index, "num_total"); ui->pushButton_step->sum_append(index, "num_discount"); ui->pushButton_step->sum_append(index, "num_present"); ui->pushButton_step->sum_append(index, "num_total2"); ui->pushButton_step->sum_append(index, "num_price_add"); ui->pushButton_step->sum_append(index, "num_total3"); ui->pushButton_step->sum_genrate(index); } break;///~会员商品消费明细 case 5:///会员保本金额 { // QString sql_where = " From " " t_m_member a, " " t_m_member_type b " " Where " " a.ch_typeno = b.ch_typeno " " and b.ch_attribute <> '1' " " and a.ch_typeno like '%1' " " and a.ch_state like '%2' " ; sql_where = sql_where //开始时间、结束时间、卡号 .arg(ui_help->comboBox_ch_typeno->itemData(ui_help->comboBox_ch_typeno->currentIndex()).toString()) .arg(ui_help->comboBox_ch_state->itemData(ui_help->comboBox_ch_state->currentIndex()).toString()) ; query.execSelect(sql_count_arg1.arg(sql_where)); query.next(); int rowcount = query.recordValue(0).toInt(); ui->pushButton_step->init(index, rowcount, onepagestep, QString( " Select " " a.vch_memberno, " " a.vch_member, " " b.vch_typename as m_typename, " " b.ch_attribute, " " vch_handtel, " " a.ch_state, " " a.ch_cardflag, " " a.int_basedata " + sql_where ) ); // toselect_page(); if(tableview->itemDelegateForColumn(model->fieldIndex("ch_state")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_state"), new lds_model_sqltablemodel_delegate_com(this, &w_m_member::get_VIP_MODEL_STATE())); } if(tableview->itemDelegateForColumn(model->fieldIndex("ch_attribute")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_attribute"), new lds_model_sqltablemodel_delegate_com(this, &w_m_member::get_VIP_MODEL_ATTRI())); } if(tableview->itemDelegateForColumn(model->fieldIndex("ch_cardflag")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("ch_cardflag"), new lds_model_sqltablemodel_delegate_com(this, &w_m_member::get_VIP_MODEL_FLAG())); } // ui->pushButton_step->sum_clear(index); ui->pushButton_step->sum_append(index, "int_basedata"); ui->pushButton_step->sum_genrate(index); } break;///~会员保本金额 case 6:///会员卡量统计 { // QString sql_where = " FROM " " t_m_member " " where " " ch_typeno like '%1' " " GROUP by ch_typeno "; //卡类型 sql_where = sql_where .arg(ui_help->comboBox_ch_typeno->itemData(ui_help->comboBox_ch_typeno->currentIndex()).toString()) ; query.execSelect(sql_count_arg1.arg(sql_where)); query.next(); int rowcount = query.recordValue(0).toInt(); ui->pushButton_step->init(index, rowcount, onepagestep, QString( " SELECT " " ch_typeno as m_typename, " " count(vch_memberno) as m_cardcount, " " sum(case ch_state " " when " " '1' " " then " " case " " when ch_cardflag = 'N' then 1 " " else 0 " " end " " else 0 " " end) as m_unsendcardcount, " " sum(case ch_state " " when " " '1' " " then " " case " " when ch_cardflag = 'Y' then 1 " " else 0 " " end " " else 0 " " end) as m_sendcardcount, " " sum(case ch_state " " when '2' then 1 " " else 0 " " end) as m_stopcardcount, " " sum(case ch_state " " when '3' then 1 " " else 0 " " end) as m_hangcardcount, " " sum(case ch_state " " when '4' then 1 " " else 0 " " end) as m_badcardcount" + sql_where ) ); // toselect_page(); if(tableview->itemDelegateForColumn(model->fieldIndex("m_typename")) == 0) { tableview->setItemDelegateForColumn(model->fieldIndex("m_typename"), new lds_model_sqltablemodel_delegate_com(this, "t_m_member_type", "ch_typeno", "vch_typename")); } } break;///~会员卡量统计 case 7:///会员挂账 { // QString sql_where = " from " " t_m_hang_balance a " " LEFT JOIN " " t_m_member b ON a.vch_memberno = b.vch_memberno " " where " " b.vch_memberno like '%1%' "; sql_where = sql_where //卡号 .arg(ui_help->lineEdit_vch_memberno->text()) ; query.execSelect(sql_count_arg1.arg(sql_where)); query.next(); int rowcount = query.recordValue(0).toInt(); ui->pushButton_step->init(index, rowcount, onepagestep, QString( " select " " a.vch_memberno, " " b.vch_member, " " b.vch_handtel, " " a.num_remain, " " a.num_pay, " " a.vch_operID, " " a.dt_operdate, " " a.vch_memo, " " a.ch_state, " " a.ch_balanceno " + sql_where ) ); // toselect_page(); // ui->pushButton_step->sum_clear(index); ui->pushButton_step->sum_append(index, "num_remain"); ui->pushButton_step->sum_genrate(index); } break;///~会员挂账 } sum_filldata(ui->pushButton_step->get_sum_list_total_data(index)); resize_column_to_content_t(); } void w_rpt_report_frame_member::todetail() { int index = ui->stackedWidget->currentIndex(); QTableView *tableview = static_cast<QTableView *>(ui->stackedWidget->widget(index)); QStandardItemModel *model = static_cast<QStandardItemModel *>(tableview->model()); // int row = tableview->currentIndex().row(); if(row < 0) { lds_messagebox::warning(this, MESSAGE_TITLE_VOID, QObject::tr("没有行被选中")); return; } // w_m_member_report_detail_Dialog dialog(model->data(model->index(row, 0)).toString(), ui->dateTimeEdit->dateTime(), ui->dateTimeEdit_2->dateTime() ); transparentCenterDialog(&dialog).exec(); } void w_rpt_report_frame_member::toprint() { QPushButton *b = qobject_cast<QPushButton *>(this->sender()); int index = ui->stackedWidget->currentIndex(); lds_tableView *tableview = static_cast<lds_tableView *>(ui->stackedWidget->widget(index)); w_rpt_report_printFormat *dialog = new w_rpt_report_printFormat(w_rpt_report_printFormat::show_model_quick, this->windowTitle(), lds::gs_operid, n_func::f_get_sysdatetime_str(), QString("%1_%2").arg(this->metaObject()->className()).arg(index), ui->dateTimeEdit->dateTimeStr(), ui->dateTimeEdit_2->dateTimeStr(), tableview, ui->pushButton_step->get_limit_sql(index), ui->tableView_sum, 0); dialog->pop(b, this); }
[ "279892744@qq.com" ]
279892744@qq.com
c40849b53ec9c866a5a7b2b5d85fd9ea3139ba17
bf09b499edc5bf2e47a43c7c2dd4cd4bcc53255b
/App/Admin/RefDataSettingDlg.cpp
c8916e6bd61ab4dbf11659033ba0050932c90416
[]
no_license
15831944/SmartISO
95ab3319f1005daf9aa3fc1e38a3f010118a8d20
5040e76891190b2146f171e03445343dc005d3be
refs/heads/main
2023-04-12T19:06:21.472281
2021-05-03T04:12:59
2021-05-03T04:12:59
null
0
0
null
null
null
null
UHC
C++
false
false
17,905
cpp
// RefDataSettingDlg.cpp : implementation file // #include "stdafx.h" #include <ProjectData.h> #include "admin.h" #include "RefDataSettingDlg.h" #include "AdminDocData.h" #include "StandardNoteTableFile.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CRefDataSettingDlg dialog CRefDataSettingDlg::CRefDataSettingDlg(CWnd* pParent /*=NULL*/) : CDialog(CRefDataSettingDlg::IDD, pParent) { //{{AFX_DATA_INIT(CRefDataSettingDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CRefDataSettingDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CRefDataSettingDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CRefDataSettingDlg, CDialog) //{{AFX_MSG_MAP(CRefDataSettingDlg) // NOTE: the ClassWizard will add message map macros here //}}AFX_MSG_MAP ON_WM_SIZE() ON_WM_HELPINFO() END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CRefDataSettingDlg message handlers /** @brief 내용을 저장한다. @author humkyung **/ void CRefDataSettingDlg::Save() { static const STRING_T rApp("Iso Edit Setting"); CAdminDocData* pDocData = CAdminDocData::GetInstance(); CString rIniFilePath = pDocData->GetIniFilePath(); map<STRING_T,STRING_T>* pDrawingSetup = CProjectData::GetInstance()->GetDrawingSetup(); CString rString; map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("Spec File Folder")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); (*pDrawingSetup)[_T("Spec File Folder")] = rString.operator LPCTSTR(); where = m_oGridPropertyMap.find(_T("Standard Note File")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); (*pDrawingSetup)[_T("Standard Note File")] = rString.operator LPCTSTR(); where = m_oGridPropertyMap.find(_T("UNIT")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); (*pDrawingSetup)[_T("Unit")] = rString.operator LPCTSTR(); where = m_oGridPropertyMap.find(_T("Drawing Type")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); CStandardNoteTableFile& stdnote = CStandardNoteTableFile::GetInstance(); CStandardNoteTableFile::CStandardNoteType* pNoteType = stdnote.GetStandardNoteType(2000); if(pNoteType) { const int nItemCount = pNoteType->GetItemCount(); for(int i = 0;i < nItemCount;++i) { if(rString == CString(pNoteType->GetItemAt(i)->rNumString.c_str())) { rString.Format(_T("%d") , pNoteType->GetItemAt(i)->nNum); (*pDrawingSetup)[_T("Drawing Type")] = rString.operator LPCTSTR(); } } } /// 2009.03.11에 추가. CProjectData* pProjectData = CProjectData::GetInstance(); if(NULL != pProjectData) { map<CString,CString>::iterator where1 = pProjectData->m_pProjectSettingMap->find(_T("WORKING_UNIT")); if(where1 != pProjectData->m_pProjectSettingMap->end()) { where = m_oGridPropertyMap.find(_T("Working Unit")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); where1->second = rString; } where1 = pProjectData->m_pProjectSettingMap->find(_T("dvcs_e")); if(where1 != pProjectData->m_pProjectSettingMap->end()) { where = m_oGridPropertyMap.find(_T("E")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); where1->second = rString; } where1 = pProjectData->m_pProjectSettingMap->find(_T("dvcs_n")); if(where1 != pProjectData->m_pProjectSettingMap->end()) { where = m_oGridPropertyMap.find(_T("N")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); where1->second = rString; } where1 = pProjectData->m_pProjectSettingMap->find(_T("dvcs_el")); if(where1 != pProjectData->m_pProjectSettingMap->end()) { where = m_oGridPropertyMap.find(_T("EL")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); where1->second = rString; } /// 2011.09.21 - added by humkyung where1 = pProjectData->m_pProjectSettingMap->find(_T("get_plan_dwg")); if(where1 != pProjectData->m_pProjectSettingMap->end()) { rString = _T("OFF"); where = m_oGridPropertyMap.find(_T("Get Plan Dwg")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); where1->second = rString; } /// up to here /// 2013.06.03 - added by humkyung where1 = pProjectData->m_pProjectSettingMap->find(_T("use_plan_dwg_by")); if(where1 != pProjectData->m_pProjectSettingMap->end()) { rString = _T("DRAWING_NO"); where = m_oGridPropertyMap.find(_T("Use Plan Dwg By")); rString = (m_oGridPropertyMap.end() != where) ? where->second->GetValue() : _T(""); where1->second = rString; } /// up to here } } /** @brief 현재 설정된 내용을 화면에 표시한다. @author humkyung **/ void CRefDataSettingDlg::UpdateContents() { static bool initialized = false; static const STRING_T rApp( _T("Iso Edit Setting") ); if(false == initialized) { CAdminDocData* pDocData = CAdminDocData::GetInstance(); CString rIniFilePath = pDocData->GetIniFilePath(); CMFCPropertyGridProperty* pGridProperty = NULL; map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("Spec File Folder")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; TCHAR szBuf[MAX_PATH + 1] = {'0',}; map<STRING_T,STRING_T>* pDrawingSetup = CProjectData::GetInstance()->GetDrawingSetup(); map<STRING_T,STRING_T>::const_iterator ctr = pDrawingSetup->find(_T("Spec File Folder")); if(ctr != pDrawingSetup->end()) { if((NULL != pGridProperty)) pGridProperty->SetValue(ctr->second.c_str()); } ctr = pDrawingSetup->find(_T("Standard Note File")); if(ctr != pDrawingSetup->end()) { map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("Standard Note File")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue(ctr->second.c_str()); CStandardNoteTableFile& stdnote = CStandardNoteTableFile::GetInstance(); stdnote.Read(szBuf); } ctr = pDrawingSetup->find(_T("Unit")); if(ctr != pDrawingSetup->end()) { map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("UNIT")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue(ctr->second.c_str()); } else { map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("UNIT")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue(_T("INCH")); } { map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("Drawing Type")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if(NULL != pGridProperty) pGridProperty->RemoveAllOptions(); CStandardNoteTableFile& stdnote = CStandardNoteTableFile::GetInstance(); CStandardNoteTableFile::CStandardNoteType* pNoteType = stdnote.GetStandardNoteType(2000); if(pNoteType) { vector<STRING_T> oNoteTypeList; const int nItemCount = pNoteType->GetItemCount(); for(int i = 0;i < nItemCount;++i) { oNoteTypeList.push_back( pNoteType->GetItemAt(i)->rNumString.c_str() ); } ::stable_sort(oNoteTypeList.begin() , oNoteTypeList.end()); for(vector<STRING_T>::iterator itr = oNoteTypeList.begin();itr != oNoteTypeList.end();++itr) { if(NULL != pGridProperty) pGridProperty->AddOption( itr->c_str() ); } ctr = pDrawingSetup->find(_T("Drawing Type")); if(ctr != pDrawingSetup->end()) { int i = 0; for(i = 0;i < nItemCount;++i) { if(ATOI_T(ctr->second.c_str()) == pNoteType->GetItemAt(i)->nNum) { if(NULL != pGridProperty) { pGridProperty->SetValue(pNoteType->GetItemAt(i)->rNumString.c_str()); break; } } } } } } /// 2009.03.11에 추가. CProjectData* pProjectData = CProjectData::GetInstance(); if(NULL != pProjectData) { CString rValue; rValue = (*(pProjectData->m_pProjectSettingMap))[_T("working_unit")]; map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("Working Unit")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue( rValue ); rValue = (*(pProjectData->m_pProjectSettingMap))[_T("dvcs_e")]; where = m_oGridPropertyMap.find(_T("E")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue( rValue ); rValue = (*(pProjectData->m_pProjectSettingMap))[_T("dvcs_n")]; where = m_oGridPropertyMap.find(_T("N")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue( rValue ); rValue = (*(pProjectData->m_pProjectSettingMap))[_T("dvcs_el")]; where = m_oGridPropertyMap.find(_T("EL")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue( rValue ); /// 2011.09.21 - added by HumKyung rValue = (*(pProjectData->m_pProjectSettingMap))[_T("get_plan_dwg")]; if(0 == rValue.CompareNoCase(_T("ON"))) { map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("Get Plan Dwg")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue( _T("ON") ); } else { map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("Get Plan Dwg")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue( _T("OFF") ); } /// up to here /// 2013.06.03 - added by HumKyung if((pProjectData->m_pProjectSettingMap)->end() != (pProjectData->m_pProjectSettingMap)->find(_T("use_plan_dwg_by"))) { rValue = (*(pProjectData->m_pProjectSettingMap))[_T("use_plan_dwg_by")]; map<STRING_T , CMFCPropertyGridProperty*>::iterator where = m_oGridPropertyMap.find(_T("Use Plan Dwg By")); pGridProperty = (m_oGridPropertyMap.end() != where) ? where->second : NULL; if((NULL != pGridProperty)) pGridProperty->SetValue( rValue ); } /// up to here } initialized = true; } } /** @brief ENTER KEY나 ESCAPE KEY를 방지한다. @author humkyung **/ BOOL CRefDataSettingDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if( pMsg->message == WM_KEYDOWN ) // Enter Key Prevent.. so good.. ^^ { if(pMsg->wParam == VK_RETURN) { ::TranslateMessage(pMsg); ::DispatchMessage(pMsg); return TRUE; // DO NOT process further } else if(pMsg->wParam == VK_ESCAPE) { ::TranslateMessage(pMsg); ::DispatchMessage(pMsg); return TRUE; } } return CDialog::PreTranslateMessage(pMsg); } /****************************************************************************** @author humkyung @date 2012-05-05 @function OnInitDialog @return BOOL @brief ******************************************************************************/ BOOL CRefDataSettingDlg::OnInitDialog() { CDialog::OnInitDialog(); CRect rectDummy; rectDummy.SetRectEmpty(); if (!m_wndPropList.Create(WS_VISIBLE | WS_CHILD | WS_BORDER, rectDummy, this, 2)) { TRACE0("Failed to create Properties Grid \n"); return -1; // fail to create } this->InitPropList(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } /****************************************************************************** @author humkyung @date 2012-05-05 @function SetPropListFont @return void @brief ******************************************************************************/ void CRefDataSettingDlg::SetPropListFont() { ::DeleteObject(m_fntPropList.Detach()); LOGFONT lf; afxGlobalData.fontRegular.GetLogFont(&lf); NONCLIENTMETRICS info; info.cbSize = sizeof(info); afxGlobalData.GetNonClientMetrics(info); lf.lfHeight = info.lfMenuFont.lfHeight; lf.lfWeight = info.lfMenuFont.lfWeight; lf.lfItalic = info.lfMenuFont.lfItalic; m_fntPropList.CreateFontIndirect(&lf); m_wndPropList.SetFont(&m_fntPropList); } /****************************************************************************** @author humkyung @date 2012-05-05 @function InitPropList @return void @brief ******************************************************************************/ void CRefDataSettingDlg::InitPropList() { SetPropListFont(); m_wndPropList.EnableHeaderCtrl(FALSE); m_wndPropList.EnableDescriptionArea(); m_wndPropList.SetVSDotNetLook(); m_wndPropList.MarkModifiedProperties(); m_oGridPropertyMap.clear(); CMFCPropertyGridProperty* pGroupProperty = new CMFCPropertyGridProperty(_T("PCD Spec File Folder")); m_wndPropList.AddProperty(pGroupProperty); { CMFCPropertyGridProperty* pSubItem = new CMFCPropertyGridProperty(_T("Spec File Folder") , (_variant_t) _T("") , _T("(Ex) \\server01\\train\\spec\\")); pGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("Spec File Folder") , pSubItem)); } pGroupProperty = new CMFCPropertyGridProperty(_T("Standard Note File")); m_wndPropList.AddProperty(pGroupProperty); { CMFCPropertyGridProperty* pSubItem = new CMFCPropertyGridProperty(_T("Standard Note File") , (_variant_t) _T("") , _T("(Ex) \\server01\\project\\stnotelib.rpt")); pGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("Standard Note File") , pSubItem)); } pGroupProperty = new CMFCPropertyGridProperty(_T("Unit")); m_wndPropList.AddProperty(pGroupProperty); { CMFCPropertyGridProperty* pSubItem = new CMFCPropertyGridProperty(_T("Unit") , (_variant_t) _T("") , _T("Select unit")); pSubItem->AddOption(_T("INCH")); pSubItem->AddOption(_T("MM")); pSubItem->AllowEdit(FALSE); pGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("UNIT") , pSubItem)); } pGroupProperty = new CMFCPropertyGridProperty(_T("Get Plan Dwg")); m_wndPropList.AddProperty(pGroupProperty); { CMFCPropertyGridProperty* pSubItem = new CMFCPropertyGridProperty(_T("Get Plan Dwg") , (_variant_t) _T("") , _T("Get Plan Dwg On/Off")); pSubItem->AddOption(_T("ON")); pSubItem->AddOption(_T("OFF")); pSubItem->AllowEdit(FALSE); pGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("Get Plan Dwg") , pSubItem)); /// 2013.06.03 added by humkyung pSubItem = new CMFCPropertyGridProperty(_T("Use Plan Dwg By") , (_variant_t) _T("") , _T("Use Plan Dwg By")); pSubItem->AddOption(_T("DRAWING_NO")); pSubItem->AddOption(_T("DRAWING_TITLE")); pSubItem->AllowEdit(FALSE); pGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("Use Plan Dwg By") , pSubItem)); /// up to here pSubItem = new CMFCPropertyGridProperty(_T("Drawing Type") , (_variant_t) _T("") , _T("Select Drawing Type")); pGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("Drawing Type") , pSubItem)); pSubItem = new CMFCPropertyGridProperty(_T("Working Unit") , (_variant_t) _T("") , _T("Working Unit")); pGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("Working Unit") , pSubItem)); CMFCPropertyGridProperty* pSubGroupProperty = new CMFCPropertyGridProperty(_T("DVCS")); pGroupProperty->AddSubItem( pSubGroupProperty ); { pSubItem = new CMFCPropertyGridProperty(_T("E") , (_variant_t) _T("") , _T("East")); pSubGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("E") , pSubItem)); pSubItem = new CMFCPropertyGridProperty(_T("N") , (_variant_t) _T("") , _T("North")); pSubGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("N") , pSubItem)); pSubItem = new CMFCPropertyGridProperty(_T("EL") , (_variant_t) _T("") , _T("Elevation")); pSubGroupProperty->AddSubItem( pSubItem ); m_oGridPropertyMap.insert(make_pair(_T("EL") , pSubItem)); } } } /****************************************************************************** @author humkyung @date 2012-05-05 @function OnSize @return void @param UINT nType @param int cx @param int cy @brief ******************************************************************************/ void CRefDataSettingDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); if(m_wndPropList.GetSafeHwnd()) { m_wndPropList.SetWindowPos(NULL , 0 , 0 , cx , cy , SWP_NOZORDER); } } /****************************************************************************** @author humkyung @date 2012-06-05 @class CRefDataSettingDlg @function OnHelpInfo @return BOOL @brief ******************************************************************************/ BOOL CRefDataSettingDlg::OnHelpInfo(HELPINFO* pHelpInfo) { HWND hHtml = ::HtmlHelp(this->m_hWnd , CAdminDocData::GetExecPath() + _T("\\Help\\SmartISO.chm::/Ref Data Setting.htm") , HH_DISPLAY_TOPIC , 0); return TRUE;///CDialog::OnHelpInfo(pHelpInfo); }
[ "humkyung@atools.co.kr" ]
humkyung@atools.co.kr
88af9dbced7b4c133935df680a09e85edc1ae86e
3af7ea325c4fe72680aa650df5d43a308c67d793
/geometry/StarMesh.h
0bd2a13225658730fc48feddbf52da9b0557b69b
[ "MIT" ]
permissive
sunglab/StarEngine
232d579b705fcacef000c11a9d18615a0bf01b95
6767536b9aafd5dacc1cb4d7751f860e9b16c743
refs/heads/master
2023-08-04T13:44:27.501075
2023-07-24T05:27:04
2023-07-24T06:00:10
6,444,927
37
12
null
2023-07-24T06:00:11
2012-10-29T17:53:00
C++
UTF-8
C++
false
false
4,159
h
// // StarGeo.h // // Created by Sungwoo Choi on 7/30/15. // Copyright (c) 2015 SungLab. All rights reserved. // #ifndef STARMESH_H #define STARMESH_H #include "../StarMain.h" //#inlcude "../star class StarMesh { private: protected: Vec3* grid_position; Vec3* grid_destination; Vec3* grid_power; Vec3* pos_vert; Vec2* tex_vert; Vec3* norm_vert; Color4* color_vert; public: virtual void generatePV()=0; virtual void generateTV()=0; virtual void generateNV()=0; virtual void generateCV()=0; virtual void generateWire(Vec3*)=0; }; class StarGrid:public StarMesh { private: Vec2 screen; Vec2 grid; int width; int height; public: int total_vert_tri; int total_vert_point; int total_wire_rect; StarGrid(Vec2 _grid, Vec2 _screen):grid(_grid), screen(_screen) { width = (int)grid.x; height = (int)grid.y; int total = width * height * 6;//two triangles // int total_grid = (width+1) * (height+1); int total_grid = width*height; total_vert_tri = total; total_vert_point = total_grid; total_wire_rect = height*(width+1)+width*(height+1); grid_position = new Vec3[total_grid]; grid_destination= new Vec3[total_grid]; grid_power= new Vec3[total_grid]; pos_vert = new Vec3[total]; tex_vert = new Vec2[total]; norm_vert = new Vec3[total]; color_vert = new Color4[total]; for(int i=0;i<total;i++) { pos_vert[i].zero(); tex_vert[i].zero(); norm_vert[i].zero(); color_vert[i].zero(); } for(int i=0;i<total_grid;i++) { grid_position[i].zero(); // grid_destination[i].zero(); grid_destination[i] = Vec3(0.5,0.5,0.0); grid_power[i].zero(); } float stepX = 2.0/width; float stepY = 2.0/height; unsigned int idx = 0; for(int i=0; i<height; i++) { for(int j=0; j<width; j++) { int idx = i*width+j; grid_position[(idx)] = Vec3(stepX*j, stepY*i,rand()%10000*0.01); grid_destination[(idx)] = Vec3(stepX*j, stepY*i,0.0); // grid_position[(idx)*6+1] = Vec3(-1. + stepX*(0+1), -1. + stepY*0,0.0); // grid[(idx)*6+2] = Vec3(-1. + stepX*0, -1. + stepY*(0+1),0.0); // pos_vert[(idx)*6+3] = Vec3(-1. + stepX*0, -1. + stepY*(0+1),0.0); // pos_vert[(idx)*6+4] = Vec3(-1. + stepX*(0+1), -1. + stepY*0,0.0); // pos_vert[(idx)*6+5] = Vec3(-1. + stepX*(0+1), -1. + stepY*(0+1),0.0); } } // float stepX = 2.0/width; // float stepY = 2.0/height; // // for(int i=0; i<height; i++) // { // for(int j=0; j<width; j++) // { // int idx = i*width+j; // // grid_destination[(idx)] = Vec3(stepX*(j), stepY*i,0.0); //// pos_vert[(idx)*6+0] = Vec3(-1. + stepX*j, -1.+ stepY*i,0.0); //// pos_vert[(idx)*6+1] = Vec3(-1. + stepX*(j+1), -1. + stepY*i,0.0); //// pos_vert[(idx)*6+2] = Vec3(-1. + stepX*j, -1. + stepY*(i+1),0.0); //// //// pos_vert[(idx)*6+3] = Vec3(-1. + stepX*j, -1. + stepY*(i+1),0.0); //// pos_vert[(idx)*6+4] = Vec3(-1. + stepX*(j+1), -1. + stepY*i,0.0); //// pos_vert[(idx)*6+5] = Vec3(-1. + stepX*(j+1), -1. + stepY*(i+1),0.0); // } // } } void update(); void generatePV(); void generateTV(); void generateNV(); void generateCV(); void generateWire(Vec3*); void swap(int,int); Vec3* getPV() { return pos_vert; } Vec2* getTV() { return tex_vert; } Vec3* getNV() { return norm_vert; } Color4* getCV() { return color_vert; } }; #endif
[ "sunglab@gmail.com" ]
sunglab@gmail.com
4cabba77536ed5666a54d1a892175f73324d40c2
4fbd844113ec9d8c526d5f186274b40ad5502aa3
/algorithms/cpp/number_of_lines_to_write_string.cpp
02b13e74e6efbc5ac744b30d01c450d0b2f0d10f
[]
no_license
capric8416/leetcode
51f9bdc3fa26b010e8a1e8203a7e1bcd70ace9e1
503b2e303b10a455be9596c31975ee7973819a3c
refs/heads/master
2022-07-16T21:41:07.492706
2020-04-22T06:18:16
2020-04-22T06:18:16
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,697
cpp
/* We are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed 100 units, it is written on the next line. We are given an array widths, an array where widths[0] is the width of 'a', widths[1] is the width of 'b', ..., and widths[25] is the width of 'z'. Now answer two questions: how many lines have at least one character from S, and what is the width used by the last such line? Return your answer as an integer list of length 2.   Example : Input: widths = [10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10] S = "abcdefghijklmnopqrstuvwxyz" Output: [3, 60] Explanation: All letters have the same length of 10. To write all 26 letters, we need two full lines and one line with 60 units. Example : Input: widths = [4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10] S = "bbbcccdddaaa" Output: [2, 4] Explanation: All letters except 'a' have the same length of 10, and "bbbcccdddaa" will cover 9 * 10 + 2 * 4 = 98 units. For the last 'a', it is written on the second line because there is only 2 units left in the first line. So the answer is 2 lines, plus 4 units in the second line.   Note: The length of S will be in the range [1, 1000]. S will only contain lowercase letters. widths is an array of length 26. widths[i] will be in the range of [2, 10]. */ /* ==================== body ==================== */ class Solution { public: vector<int> numberOfLines(vector<int>& widths, string S) { } }; /* ==================== body ==================== */
[ "capric8416@gmail.com" ]
capric8416@gmail.com
cb6701748fd6016c055eaf0392870318dcb59d1e
a9c12a1da0794eaf9a1d1f37ab5c404e3b95e4ec
/pbserializer/PBUserInfoSerializer.h
801d7a1ac15d5fc155e6a64c15340406c5cfafb5
[]
no_license
shzdtech/FutureXPlatform
37d395511d603a9e92191f55b8f8a6d60e4095d6
734cfc3c3d2026d60361874001fc20f00e8bb038
refs/heads/master
2021-03-30T17:49:22.010954
2018-06-19T13:21:53
2018-06-19T13:21:53
56,828,437
1
0
null
null
null
null
UTF-8
C++
false
false
793
h
/*********************************************************************** * Module: PBUserInfoSerializer.h * Author: milk * Modified: 2015年8月23日 23:23:10 * Purpose: Declaration of the class PBUserInfoSerializer ***********************************************************************/ #if !defined(__pbserializer_PBUserInfoSerializer_h) #define __pbserializer_PBUserInfoSerializer_h #include "../dataserializer/IDataSerializer.h" #include "../utility/singleton_templ.h" #include "pbserializer_exp.h" class PBSERIALIZER_CLASS_EXPORTS PBUserInfoSerializer : public IDataSerializer, public singleton_ptr<PBUserInfoSerializer> { public: data_buffer Serialize(const dataobj_ptr& abstractDO); dataobj_ptr Deserialize(const data_buffer& rawdata); protected: private: }; #endif
[ "rainmilk@gmail.com" ]
rainmilk@gmail.com
59870f7e8322bfc5e1ef3d99d8fe81307ef6f3bc
e2c5b733f7b0e3cca1f71db439a9318bb61ba8f3
/Routing_Vector_Protocols/include/file_handler.h
2a424d036bd3de85756de87c81eb7290aa4acdc6
[]
no_license
nishantravi92/Networks
bf1e97021dd5d7b18d40b9b1cb6c73a95704ce1c
90e1ddcc6fecace31afaadec82d21a5cf164d7b5
refs/heads/master
2021-01-09T05:36:05.501205
2017-02-03T07:07:29
2017-02-03T07:07:29
80,798,085
0
0
null
null
null
null
UTF-8
C++
false
false
828
h
#ifndef FILE_HANDLER_H #define FILE_HANDLER_H #define N_1024 1024 #define N_12 12 #include <vector> #include "router.h" struct File_handler { uint8_t transfer_id; std::vector<int> sequence_numbers; uint16_t sequence_number; int packets_to_send; uint8_t time_to_live; int fd; char file_name[512]; char dest_ip_addr[INET_ADDRSTRLEN]; FILE *fp; bool file_to_send; }; void send_file(Router *router,std::vector<Neighbour> & neighbour_list, char *buffer, char *send_buffer); void handle_data_received(Router *router, std::vector<Neighbour> &neighbour_list, char *buffer, int nbytes); int create_stats(char *, uint8_t); int create_last_data_packet(char *); int create_penultimate_data_packet(char *); int get_total_bytes_to_send(uint8_t transfer_id); bool data_is_to_be_sent(); void send_remaining_packets(); #endif
[ "nishantravi92@gmail.com" ]
nishantravi92@gmail.com
6b78b23c4eec88ba3c5d1741b8975a6bd144b4e0
2d24e08d4511a5c4900b6a05797f5e2350f12498
/Tetris/Tetris/TBrick.h
ae4e148c4d6367649008aca89c3f09a1a9477130
[]
no_license
Niceug/learngit
7a5eb2da68f6d9bd81c6b4b0178ca72413c7e4b3
b9f78cc741a9872aec9953db18aa09367af48982
refs/heads/master
2021-01-02T22:52:39.857138
2018-05-04T03:59:20
2018-05-04T03:59:20
99,409,724
1
1
null
null
null
null
UTF-8
C++
false
false
345
h
#pragma once #include "Bin.h" #include "Brick.h" class CTBrick : public CBrick { public: int shiftLeft(CBin* bin); int shiftRight(CBin* bin); int shiftDown(CBin* bin); int rotateClockwise(CBin* bin); int checkCollision(CBin* bin); void operator>>(unsigned char** binImage); void putAtTop(unsigned int newOrient, unsigned int newPosX); };
[ "2235422344@qq.com" ]
2235422344@qq.com
e9cd1e284f5906b9205716fad53e3c0fa4ed662e
c322776b39fd9a7cd993f483a5384b700b0c520e
/soloud.mod/soloud/ext/libopenmpt/common/mptString.cpp
e07e6e6b61d0e4ab3c402844b771fc5a9b7ac811
[ "Zlib", "WTFPL", "LicenseRef-scancode-public-domain", "Unlicense", "BSD-3-Clause" ]
permissive
maxmods/bah.mod
c1af2b009c9f0c41150000aeae3263952787c889
6b7b7cb2565820c287eaff049071dba8588b70f7
refs/heads/master
2023-04-13T10:12:43.196598
2023-04-04T20:54:11
2023-04-04T20:54:11
14,444,179
28
26
null
2021-11-01T06:50:06
2013-11-16T08:29:27
C++
UTF-8
C++
false
false
53,046
cpp
/* * mptString.cpp * ------------- * Purpose: Small string-related utilities, number and message formatting. * Notes : Currently none. * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ #include "stdafx.h" #include "mptString.h" #if defined(MPT_CHARSET_CODECVTUTF8) #include <codecvt> #endif #if defined(MPT_CHARSET_INTERNAL) || defined(MPT_CHARSET_WIN32) #include <cstdlib> #endif #include <locale> #include <string> #include <stdexcept> #include <vector> #if MPT_COMPILER_GCC || MPT_COMPILER_CLANG #include <strings.h> // for strncasecmp #endif #if MPT_OS_WINDOWS #include <windows.h> #endif #if defined(MPT_CHARSET_ICONV) #include <errno.h> #include <iconv.h> #endif OPENMPT_NAMESPACE_BEGIN /* Quick guide to the OpenMPT string type jungle ============================================= This quick guide is only meant as a hint. There may be valid reasons to not honor the recommendations found here. Staying consistent with surrounding and/or related code sections may also be important. List of string types -------------------- * std::string (OpenMPT, libopenmpt) C++ string of unspedicifed 8bit encoding. Try to always document the encoding if not clear from context. Do not use unless there is an obvious reason to do so. * std::wstring (OpenMPT) UTF16 (on windows) or UTF32 (otherwise). Do not use unless there is an obvious reason to do so. * char* (OpenMPT, libopenmpt) C string of unspecified encoding. Use only for static literals or in performance critical inner loops where full control and avoidance of memory allocations is required. * wchar_t* (OpenMPT) C wide string. Use only if Unicode is required for static literals or in performance critical inner loops where full control and avoidance of memory allocation is required. * CString (OpenMPT) MFC string type, either encoded in locale/CP_ACP (if !UNICODE) or UTF16 (if UNICODE). Specify literals with _T(""). Use in MFC gui code. * CStringA (OpenMPT) MFC ANSI string type. The encoding is always CP_ACP. Do not use unless there is an obvious reason to do so. * CStringW (OpenMPT) MFC Unicode string type. Use in MFC gui code when explicit Unicode support is required. * mpt::PathString (OpenMPT, libopenmpt) String type representing paths and filenames. Always use for these in order to avoid potentially lossy conversions. Use MPT_PATHSTRING("") macro for literals. * mpt::ustring (OpenMPT, libopenmpt) The default unicode string type. Can be encoded in UTF8 or UTF16 or UTF32, depending on MPT_USTRING_MODE_* and sizeof(wchar_t). Literals can written as MPT_USTRING(""). Use as your default string type if no other string type is a measurably better fit. * MPT_UTF8 (OpenMPT, libopenmpt) Macro that generates a mpt::ustring from string literals containing non-ascii characters. In order to keep the source code in ascii encoding, always express non-ascii characters using explicit \x23 escaping. Note that depending on the underlying type of mpt::ustring, MPT_UTF8 *requires* a runtime conversion. Only use for string literals containing non-ascii characters (use MPT_USTRING otherwise). * mpt::RawPathString (OpenMPT, libopenmpt) Internal representation of mpt::PathString. Only use for parsing path fragments. * mpt::u8string (OpenMPT, libopenmpt) Internal representation of mpt::ustring. Do not use directly. Ever. * std::basic_string<char> (OpenMPT) Same as std::string. Do not use std::basic_string in the templated form. * std::basic_string<wchar_t> (OpenMPT) Same as std::wstring. Do not use std::basic_string in the templated form. The following string types are available in order to avoid the need to overload functions on a huge variety of string types. Use only ever as function argument types. Note that the locale charset is not available on all libopenmpt builds (in which case the option is ignored or a sensible fallback is used; these types are always available). All these types publicly inherit from mpt::ustring and do not contain any additional state. This means that they work the same way as mpt::ustring does and do support type-slicing for both, read and write accesses. These types only add conversion constructors for all string types that have a defined encoding and for all 8bit string types using the specified encoding heuristic. * AnyUnicodeString (OpenMPT, libopenmpt) Is constructible from any Unicode string. * AnyString (OpenMPT, libopenmpt) Tries to do the smartest auto-magic we can do. * AnyLocaleString (OpenMPT, libopenmpt) char-based strings are assumed to be in locale encoding. * AnyStringUTF8orLocale (OpenMPT, libopenmpt) char-based strings are tried in UTF8 first, if this fails, locale is used. * AnyStringUTF8 (OpenMPT, libopenmpt) char-based strings are assumed to be in UTF8. Encoding of 8bit strings ------------------------ 8bit strings have an unspecified encoding. When the string is contained within a CSoundFile object, the encoding is most likely CSoundFile::GetCharset(), otherwise, try to gather the most probable encoding from surrounding or related code sections. Decision tree to help deciding which string type to use ------------------------------------------------------- if in libopenmpt if in libopenmpt c++ interface T = std::string, the encoding is utf8 elif in libopenmpt c interface T = char*, the encoding is utf8 elif performance critical inner loop T = char*, document the encoding if not clear from context elif string literal containing non-ascii characters T = MPT_UTF8 elif path or file if parsing path fragments T = mpt::RawPathString template your function on the concrete underlying string type (std::string and std::wstring) or use preprocessor MPT_OS_WINDOWS else T = mpt::PathString fi else T = mpt::ustring fi else if performance critical inner loop if needs unicode support T = wchar_t* else T = char*, document the encoding if not clear from context fi elif string literal containing non-ascii characters T = MPT_UTF8 elif path or file if parsing path fragments T = mpt::RawPathString template your function on the concrete underlying string type (std::string and std::wstring) or use preprocessor MPT_OS_WINDOWS else T = mpt::PathString fi elif mfc/gui code if directly interface with wide winapi T = CStringW elif needs unicode support T = CStringW else T = CString fi else if directly interfacing with wide winapi T = std::wstring else T = mpt::ustring fi fi fi This boils down to: Prefer mpt::PathString and mpt::ustring, and only use any other string type if there is an obvious reason to do so. Character set conversions ------------------------- Character set conversions in OpenMPT are always fuzzy. Behaviour in case of an invalid source encoding and behaviour in case of an unrepresentable destination encoding can be any of the following: * The character is replaced by some replacement character ('?' or L'\ufffd' in most cases). * The character is replaced by a similar character (either semantically similiar or visually similar). * The character is transcribed with some ASCII text. * The character is discarded. * Conversion stops at this very character. Additionally. conversion may stop or continue on \0 characters in the middle of the string. Behaviour can vary from one conversion tuple to any other. If you need to ensure lossless conversion, do a roundtrip conversion and check for equality. Unicode handling ---------------- OpenMPT is generally not aware of and does not handle different Unicode normalization forms. You should be aware of the following possibilities: * Conversion between UTF8, UTF16, UTF32 may or may not change between NFC and NFD. * Conversion from any non-Unicode 8bit encoding can result in both, NFC or NFD forms. * Conversion to any non-Unicode 8bit encoding may or may not involve conversion to NFC, NFD, NFKC or NFKD during the conversion. This in particular means that conversion of decomposed german umlauts to ISO8859-1 may fail. * Changing the normalization form of path strings may render the file inaccessible. Unicode BOM may or may not be preserved and/or discarded during conversion. Invalid Unicode code points may be treated as invalid or as valid characters when converting between different Unicode encodings. Interfacing with WinAPI ----------------------- When in MFC code, use CString or CStringW as appropriate. When in non MFC code, either use std::wstring when directly interfacing with the Unicode API, or use the TCHAR helper functions: ToTcharBuf, FromTcharBuf, ToTcharStr, FromTcharStr. */ namespace mpt { #ifdef MODPLUG_TRACKER // We cannot use the C runtime version in libopenmpt as it depends on the // global C locale. // We provide a plain ASCII version as mpt::CompareNoCaseAscci(). int strnicmp(const char *a, const char *b, size_t count) //------------------------------------------------------ { #if MPT_COMPILER_MSVC return _strnicmp(a, b, count); #else return strncasecmp(a, b, count); #endif } #endif // MODPLUG_TRACKER } // namespace mpt namespace mpt { namespace String { /* default 1:1 mapping static const uint32 CharsetTableISO8859_1[256] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, 0x0040,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,0x005b,0x005c,0x005d,0x005e,0x005f, 0x0060,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,0x007b,0x007c,0x007d,0x007e,0x007f, 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,0x0089,0x008a,0x008b,0x008c,0x008d,0x008e,0x008f, 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009a,0x009b,0x009c,0x009d,0x009e,0x009f, 0x00a0,0x00a1,0x00a2,0x00a3,0x00a4,0x00a5,0x00a6,0x00a7,0x00a8,0x00a9,0x00aa,0x00ab,0x00ac,0x00ad,0x00ae,0x00af, 0x00b0,0x00b1,0x00b2,0x00b3,0x00b4,0x00b5,0x00b6,0x00b7,0x00b8,0x00b9,0x00ba,0x00bb,0x00bc,0x00bd,0x00be,0x00bf, 0x00c0,0x00c1,0x00c2,0x00c3,0x00c4,0x00c5,0x00c6,0x00c7,0x00c8,0x00c9,0x00ca,0x00cb,0x00cc,0x00cd,0x00ce,0x00cf, 0x00d0,0x00d1,0x00d2,0x00d3,0x00d4,0x00d5,0x00d6,0x00d7,0x00d8,0x00d9,0x00da,0x00db,0x00dc,0x00dd,0x00de,0x00df, 0x00e0,0x00e1,0x00e2,0x00e3,0x00e4,0x00e5,0x00e6,0x00e7,0x00e8,0x00e9,0x00ea,0x00eb,0x00ec,0x00ed,0x00ee,0x00ef, 0x00f0,0x00f1,0x00f2,0x00f3,0x00f4,0x00f5,0x00f6,0x00f7,0x00f8,0x00f9,0x00fa,0x00fb,0x00fc,0x00fd,0x00fe,0x00ff }; */ #if defined(MPT_CHARSET_CODECVTUTF8) || defined(MPT_CHARSET_INTERNAL) || defined(MPT_CHARSET_WIN32) static const uint32 CharsetTableISO8859_15[256] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, 0x0040,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,0x005b,0x005c,0x005d,0x005e,0x005f, 0x0060,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,0x007b,0x007c,0x007d,0x007e,0x007f, 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,0x0088,0x0089,0x008a,0x008b,0x008c,0x008d,0x008e,0x008f, 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,0x0098,0x0099,0x009a,0x009b,0x009c,0x009d,0x009e,0x009f, 0x00a0,0x00a1,0x00a2,0x00a3,0x20ac,0x00a5,0x0160,0x00a7,0x0161,0x00a9,0x00aa,0x00ab,0x00ac,0x00ad,0x00ae,0x00af, 0x00b0,0x00b1,0x00b2,0x00b3,0x017d,0x00b5,0x00b6,0x00b7,0x017e,0x00b9,0x00ba,0x00bb,0x0152,0x0153,0x0178,0x00bf, 0x00c0,0x00c1,0x00c2,0x00c3,0x00c4,0x00c5,0x00c6,0x00c7,0x00c8,0x00c9,0x00ca,0x00cb,0x00cc,0x00cd,0x00ce,0x00cf, 0x00d0,0x00d1,0x00d2,0x00d3,0x00d4,0x00d5,0x00d6,0x00d7,0x00d8,0x00d9,0x00da,0x00db,0x00dc,0x00dd,0x00de,0x00df, 0x00e0,0x00e1,0x00e2,0x00e3,0x00e4,0x00e5,0x00e6,0x00e7,0x00e8,0x00e9,0x00ea,0x00eb,0x00ec,0x00ed,0x00ee,0x00ef, 0x00f0,0x00f1,0x00f2,0x00f3,0x00f4,0x00f5,0x00f6,0x00f7,0x00f8,0x00f9,0x00fa,0x00fb,0x00fc,0x00fd,0x00fe,0x00ff }; static const uint32 CharsetTableWindows1252[256] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, 0x0040,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,0x005b,0x005c,0x005d,0x005e,0x005f, 0x0060,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,0x007b,0x007c,0x007d,0x007e,0x007f, 0x20ac,0x0081,0x201a,0x0192,0x201e,0x2026,0x2020,0x2021,0x02c6,0x2030,0x0160,0x2039,0x0152,0x008d,0x017d,0x008f, 0x0090,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014,0x02dc,0x2122,0x0161,0x203a,0x0153,0x009d,0x017e,0x0178, 0x00a0,0x00a1,0x00a2,0x00a3,0x00a4,0x00a5,0x00a6,0x00a7,0x00a8,0x00a9,0x00aa,0x00ab,0x00ac,0x00ad,0x00ae,0x00af, 0x00b0,0x00b1,0x00b2,0x00b3,0x00b4,0x00b5,0x00b6,0x00b7,0x00b8,0x00b9,0x00ba,0x00bb,0x00bc,0x00bd,0x00be,0x00bf, 0x00c0,0x00c1,0x00c2,0x00c3,0x00c4,0x00c5,0x00c6,0x00c7,0x00c8,0x00c9,0x00ca,0x00cb,0x00cc,0x00cd,0x00ce,0x00cf, 0x00d0,0x00d1,0x00d2,0x00d3,0x00d4,0x00d5,0x00d6,0x00d7,0x00d8,0x00d9,0x00da,0x00db,0x00dc,0x00dd,0x00de,0x00df, 0x00e0,0x00e1,0x00e2,0x00e3,0x00e4,0x00e5,0x00e6,0x00e7,0x00e8,0x00e9,0x00ea,0x00eb,0x00ec,0x00ed,0x00ee,0x00ef, 0x00f0,0x00f1,0x00f2,0x00f3,0x00f4,0x00f5,0x00f6,0x00f7,0x00f8,0x00f9,0x00fa,0x00fb,0x00fc,0x00fd,0x00fe,0x00ff }; static const uint32 CharsetTableCP437[256] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, 0x0040,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,0x005b,0x005c,0x005d,0x005e,0x005f, 0x0060,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,0x007b,0x007c,0x007d,0x007e,0x2302, 0x00c7,0x00fc,0x00e9,0x00e2,0x00e4,0x00e0,0x00e5,0x00e7,0x00ea,0x00eb,0x00e8,0x00ef,0x00ee,0x00ec,0x00c4,0x00c5, 0x00c9,0x00e6,0x00c6,0x00f4,0x00f6,0x00f2,0x00fb,0x00f9,0x00ff,0x00d6,0x00dc,0x00a2,0x00a3,0x00a5,0x20a7,0x0192, 0x00e1,0x00ed,0x00f3,0x00fa,0x00f1,0x00d1,0x00aa,0x00ba,0x00bf,0x2310,0x00ac,0x00bd,0x00bc,0x00a1,0x00ab,0x00bb, 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,0x2555,0x2563,0x2551,0x2557,0x255d,0x255c,0x255b,0x2510, 0x2514,0x2534,0x252c,0x251c,0x2500,0x253c,0x255e,0x255f,0x255a,0x2554,0x2569,0x2566,0x2560,0x2550,0x256c,0x2567, 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256b,0x256a,0x2518,0x250c,0x2588,0x2584,0x258c,0x2590,0x2580, 0x03b1,0x00df,0x0393,0x03c0,0x03a3,0x03c3,0x00b5,0x03c4,0x03a6,0x0398,0x03a9,0x03b4,0x221e,0x03c6,0x03b5,0x2229, 0x2261,0x00b1,0x2265,0x2264,0x2320,0x2321,0x00f7,0x2248,0x00b0,0x2219,0x00b7,0x221a,0x207f,0x00b2,0x25a0,0x00a0 }; #endif // MPT_CHARSET_CODECVTUTF8 || MPT_CHARSET_INTERNAL || MPT_CHARSET_WIN32 #define C(x) (static_cast<uint8>((x))) // AMS1 actually only supports ASCII plus the modified control characters and no high chars at all. // Just default to CP437 for those to keep things simple. static const uint32 CharsetTableCP437AMS[256] = { C(' '),0x0001,0x0002,0x0003,0x00e4,0x0005,0x00e5,0x0007,0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x00c4,0x00c5, // differs from CP437 0x0010,0x0011,0x0012,0x0013,0x00f6,0x0015,0x0016,0x0017,0x0018,0x00d6,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, // differs from CP437 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, 0x0040,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,0x005b,0x005c,0x005d,0x005e,0x005f, 0x0060,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,0x007b,0x007c,0x007d,0x007e,0x2302, 0x00c7,0x00fc,0x00e9,0x00e2,0x00e4,0x00e0,0x00e5,0x00e7,0x00ea,0x00eb,0x00e8,0x00ef,0x00ee,0x00ec,0x00c4,0x00c5, 0x00c9,0x00e6,0x00c6,0x00f4,0x00f6,0x00f2,0x00fb,0x00f9,0x00ff,0x00d6,0x00dc,0x00a2,0x00a3,0x00a5,0x20a7,0x0192, 0x00e1,0x00ed,0x00f3,0x00fa,0x00f1,0x00d1,0x00aa,0x00ba,0x00bf,0x2310,0x00ac,0x00bd,0x00bc,0x00a1,0x00ab,0x00bb, 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,0x2555,0x2563,0x2551,0x2557,0x255d,0x255c,0x255b,0x2510, 0x2514,0x2534,0x252c,0x251c,0x2500,0x253c,0x255e,0x255f,0x255a,0x2554,0x2569,0x2566,0x2560,0x2550,0x256c,0x2567, 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256b,0x256a,0x2518,0x250c,0x2588,0x2584,0x258c,0x2590,0x2580, 0x03b1,0x00df,0x0393,0x03c0,0x03a3,0x03c3,0x00b5,0x03c4,0x03a6,0x0398,0x03a9,0x03b4,0x221e,0x03c6,0x03b5,0x2229, 0x2261,0x00b1,0x2265,0x2264,0x2320,0x2321,0x00f7,0x2248,0x00b0,0x2219,0x00b7,0x221a,0x207f,0x00b2,0x25a0,0x00a0 }; // AMS2: Looking at Velvet Studio's bitmap font (TPIC32.PCX), these appear to be the only supported non-ASCII chars. static const uint32 CharsetTableCP437AMS2[256] = { C(' '),0x00a9,0x221a,0x00b7,C('0'),C('1'),C('2'),C('3'),C('4'),C('5'),C('6'),C('7'),C('8'),C('9'),C('A'),C('B'), // differs from CP437 C('C'),C('D'),C('E'),C('F'),C(' '),0x00a7,C(' '),C(' '),C(' '),C(' '),C(' '),C(' '),C(' '),C(' '),C(' '),C(' '), // differs from CP437 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, 0x0040,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,0x005b,0x005c,0x005d,0x005e,0x005f, 0x0060,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,0x007b,0x007c,0x007d,0x007e,0x2302, 0x00c7,0x00fc,0x00e9,0x00e2,0x00e4,0x00e0,0x00e5,0x00e7,0x00ea,0x00eb,0x00e8,0x00ef,0x00ee,0x00ec,0x00c4,0x00c5, 0x00c9,0x00e6,0x00c6,0x00f4,0x00f6,0x00f2,0x00fb,0x00f9,0x00ff,0x00d6,0x00dc,0x00a2,0x00a3,0x00a5,0x20a7,0x0192, 0x00e1,0x00ed,0x00f3,0x00fa,0x00f1,0x00d1,0x00aa,0x00ba,0x00bf,0x2310,0x00ac,0x00bd,0x00bc,0x00a1,0x00ab,0x00bb, 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,0x2555,0x2563,0x2551,0x2557,0x255d,0x255c,0x255b,0x2510, 0x2514,0x2534,0x252c,0x251c,0x2500,0x253c,0x255e,0x255f,0x255a,0x2554,0x2569,0x2566,0x2560,0x2550,0x256c,0x2567, 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256b,0x256a,0x2518,0x250c,0x2588,0x2584,0x258c,0x2590,0x2580, 0x03b1,0x00df,0x0393,0x03c0,0x03a3,0x03c3,0x00b5,0x03c4,0x03a6,0x0398,0x03a9,0x03b4,0x221e,0x03c6,0x03b5,0x2229, 0x2261,0x00b1,0x2265,0x2264,0x2320,0x2321,0x00f7,0x2248,0x00b0,0x2219,0x00b7,0x221a,0x207f,0x00b2,0x25a0,0x00a0 }; #undef C #if MPT_COMPILER_MSVC #pragma warning(disable:4428) // universal-character-name encountered in source #endif static std::wstring From8bit(const std::string &str, const uint32 (&table)[256], wchar_t replacement = L'\uFFFD') //--------------------------------------------------------------------------------------------------------------- { std::wstring res; res.reserve(str.length()); for(std::size_t i = 0; i < str.length(); ++i) { uint32 c = static_cast<uint32>(static_cast<uint8>(str[i])); if(c < CountOf(table)) { res.push_back(static_cast<wchar_t>(static_cast<uint32>(table[c]))); } else { res.push_back(replacement); } } return res; } static std::string To8bit(const std::wstring &str, const uint32 (&table)[256], char replacement = '?') //---------------------------------------------------------------------------------------------------- { std::string res; res.reserve(str.length()); for(std::size_t i = 0; i < str.length(); ++i) { uint32 c = str[i]; bool found = false; // Try non-control characters first. // In cases where there are actual characters mirrored in this range (like in AMS/AMS2 character sets), // characters in the common range are preferred this way. for(std::size_t x = 0x20; x < CountOf(table); ++x) { if(c == table[x]) { res.push_back(static_cast<char>(static_cast<uint8>(x))); found = true; break; } } if(!found) { // try control characters for(std::size_t x = 0x00; x < CountOf(table) && x < 0x20; ++x) { if(c == table[x]) { res.push_back(static_cast<char>(static_cast<uint8>(x))); found = true; break; } } } if(!found) { res.push_back(replacement); } } return res; } #if defined(MPT_CHARSET_CODECVTUTF8) || defined(MPT_CHARSET_INTERNAL) || defined(MPT_CHARSET_WIN32) static std::wstring FromAscii(const std::string &str, wchar_t replacement = L'\uFFFD') //------------------------------------------------------------------------------------ { std::wstring res; res.reserve(str.length()); for(std::size_t i = 0; i < str.length(); ++i) { uint8 c = str[i]; if(c <= 0x7f) { res.push_back(static_cast<wchar_t>(static_cast<uint32>(c))); } else { res.push_back(replacement); } } return res; } static std::string ToAscii(const std::wstring &str, char replacement = '?') //------------------------------------------------------------------------- { std::string res; res.reserve(str.length()); for(std::size_t i = 0; i < str.length(); ++i) { uint32 c = str[i]; if(c <= 0x7f) { res.push_back(static_cast<char>(static_cast<uint8>(c))); } else { res.push_back(replacement); } } return res; } static std::wstring FromISO_8859_1(const std::string &str, wchar_t replacement = L'\uFFFD') //----------------------------------------------------------------------------------------- { MPT_UNREFERENCED_PARAMETER(replacement); std::wstring res; res.reserve(str.length()); for(std::size_t i = 0; i < str.length(); ++i) { uint8 c = str[i]; res.push_back(static_cast<wchar_t>(static_cast<uint32>(c))); } return res; } static std::string ToISO_8859_1(const std::wstring &str, char replacement = '?') //------------------------------------------------------------------------------ { std::string res; res.reserve(str.length()); for(std::size_t i = 0; i < str.length(); ++i) { uint32 c = str[i]; if(c <= 0xff) { res.push_back(static_cast<char>(static_cast<uint8>(c))); } else { res.push_back(replacement); } } return res; } #if defined(MPT_WITH_CHARSET_LOCALE) static std::wstring LocaleDecode(const std::string &str, const std::locale & locale, wchar_t replacement = L'\uFFFD') //------------------------------------------------------------------------------------------------------------------- { if(str.empty()) { return std::wstring(); } std::vector<wchar_t> out; typedef std::codecvt<wchar_t, char, std::mbstate_t> codecvt_type; std::mbstate_t state = std::mbstate_t(); const codecvt_type & facet = std::use_facet<codecvt_type>(locale); codecvt_type::result result = codecvt_type::partial; const char * in_begin = str.data(); const char * in_end = in_begin + str.size(); out.resize((in_end - in_begin) * (facet.max_length() + 1)); wchar_t * out_begin = &(out[0]); wchar_t * out_end = &(out[0]) + out.size(); const char * in_next = nullptr; wchar_t * out_next = nullptr; do { in_next = nullptr; out_next = nullptr; result = facet.in(state, in_begin, in_end, in_next, out_begin, out_end, out_next); if(result == codecvt_type::partial || (result == codecvt_type::error && out_next == out_end)) { out.resize(out.size() * 2); in_begin = in_next; out_begin = &(out[0]) + (out_next - out_begin); out_end = &(out[0]) + out.size(); continue; } if(result == codecvt_type::error) { ++in_next; *out_next = replacement; ++out_next; } in_begin = in_next; out_begin = out_next; } while(result == codecvt_type::error && in_next < in_end && out_next < out_end); return std::wstring(&(out[0]), out_next); } static std::string LocaleEncode(const std::wstring &str, const std::locale & locale, char replacement = '?') //---------------------------------------------------------------------------------------------------------- { if(str.empty()) { return std::string(); } std::vector<char> out; typedef std::codecvt<wchar_t, char, std::mbstate_t> codecvt_type; std::mbstate_t state = std::mbstate_t(); const codecvt_type & facet = std::use_facet<codecvt_type>(locale); codecvt_type::result result = codecvt_type::partial; const wchar_t * in_begin = str.data(); const wchar_t * in_end = in_begin + str.size(); out.resize((in_end - in_begin) * (facet.max_length() + 1)); char * out_begin = &(out[0]); char * out_end = &(out[0]) + out.size(); const wchar_t * in_next = nullptr; char * out_next = nullptr; do { in_next = nullptr; out_next = nullptr; result = facet.out(state, in_begin, in_end, in_next, out_begin, out_end, out_next); if(result == codecvt_type::partial || (result == codecvt_type::error && out_next == out_end)) { out.resize(out.size() * 2); in_begin = in_next; out_begin = &(out[0]) + (out_next - out_begin); out_end = &(out[0]) + out.size(); continue; } if(result == codecvt_type::error) { ++in_next; *out_next = replacement; ++out_next; } in_begin = in_next; out_begin = out_next; } while(result == codecvt_type::error && in_next < in_end && out_next < out_end); return std::string(&(out[0]), out_next); } static std::wstring FromLocale(const std::string &str, wchar_t replacement = L'\uFFFD') //------------------------------------------------------------------------------------- { try { std::locale locale(""); // user locale return String::LocaleDecode(str, locale, replacement); } catch(...) { // nothing } try { std::locale locale; // current c++ locale return String::LocaleDecode(str, locale, replacement); } catch(...) { // nothing } try { std::locale locale = std::locale::classic(); // "C" locale return String::LocaleDecode(str, locale, replacement); } catch(...) { // nothing } MPT_ASSERT_NOTREACHED(); return String::FromAscii(str, replacement); // fallback } static std::string ToLocale(const std::wstring &str, char replacement = '?') //-------------------------------------------------------------------------- { try { std::locale locale(""); // user locale return String::LocaleEncode(str, locale, replacement); } catch(...) { // nothing } try { std::locale locale; // current c++ locale return String::LocaleEncode(str, locale, replacement); } catch(...) { // nothing } try { std::locale locale = std::locale::classic(); // "C" locale return String::LocaleEncode(str, locale, replacement); } catch(...) { // nothing } MPT_ASSERT_NOTREACHED(); return String::ToAscii(str, replacement); // fallback } #endif #endif // MPT_CHARSET_CODECVTUTF8 || MPT_CHARSET_INTERNAL || MPT_CHARSET_WIN32 #if defined(MPT_CHARSET_CODECVTUTF8) static std::wstring FromUTF8(const std::string &str, wchar_t replacement = L'\uFFFD') //----------------------------------------------------------------------------------- { MPT_UNREFERENCED_PARAMETER(replacement); std::wstring_convert<std::codecvt_utf8<wchar_t> > conv; return conv.from_bytes(str); } static std::string ToUTF8(const std::wstring &str, char replacement = '?') //------------------------------------------------------------------------ { MPT_UNREFERENCED_PARAMETER(replacement); std::wstring_convert<std::codecvt_utf8<wchar_t> > conv; return conv.to_bytes(str); } #endif // MPT_CHARSET_CODECVTUTF8 #if defined(MPT_CHARSET_INTERNAL) || defined(MPT_CHARSET_WIN32) static std::wstring FromUTF8(const std::string &str, wchar_t replacement = L'\uFFFD') //----------------------------------------------------------------------------------- { const std::string &in = str; std::wstring out; // state: std::size_t charsleft = 0; uint32 ucs4 = 0; for ( std::string::const_iterator i = in.begin(); i != in.end(); ++i ) { uint8 c = *i; if ( charsleft == 0 ) { if ( ( c & 0x80 ) == 0x00 ) { out.push_back( (wchar_t)c ); } else if ( ( c & 0xE0 ) == 0xC0 ) { ucs4 = c & 0x1F; charsleft = 1; } else if ( ( c & 0xF0 ) == 0xE0 ) { ucs4 = c & 0x0F; charsleft = 2; } else if ( ( c & 0xF8 ) == 0xF0 ) { ucs4 = c & 0x07; charsleft = 3; } else { out.push_back( replacement ); ucs4 = 0; charsleft = 0; } } else { if ( ( c & 0xC0 ) != 0x80 ) { out.push_back( replacement ); ucs4 = 0; charsleft = 0; } ucs4 <<= 6; ucs4 |= c & 0x3F; charsleft--; if ( charsleft == 0 ) { MPT_CONSTANT_IF ( sizeof( wchar_t ) == 2 ) { if ( ucs4 > 0x1fffff ) { out.push_back( replacement ); ucs4 = 0; charsleft = 0; } if ( ucs4 <= 0xffff ) { out.push_back( (uint16)ucs4 ); } else { uint32 surrogate = ucs4 - 0x10000; uint16 hi_sur = static_cast<uint16>( ( 0x36 << 10 ) | ( (surrogate>>10) & ((1<<10)-1) ) ); uint16 lo_sur = static_cast<uint16>( ( 0x37 << 10 ) | ( (surrogate>> 0) & ((1<<10)-1) ) ); out.push_back( hi_sur ); out.push_back( lo_sur ); } } else { out.push_back( static_cast<wchar_t>( ucs4 ) ); } ucs4 = 0; } } } if ( charsleft != 0 ) { out.push_back( replacement ); ucs4 = 0; charsleft = 0; } return out; } static std::string ToUTF8(const std::wstring &str, char replacement = '?') //------------------------------------------------------------------------ { const std::wstring &in = str; std::string out; for ( std::size_t i=0; i<in.length(); i++ ) { wchar_t wc = in[i]; uint32 ucs4 = 0; MPT_CONSTANT_IF ( sizeof( wchar_t ) == 2 ) { uint16 c = static_cast<uint16>( wc ); if ( i + 1 < in.length() ) { // check for surrogate pair uint16 hi_sur = in[i+0]; uint16 lo_sur = in[i+1]; if ( hi_sur >> 10 == 0x36 && lo_sur >> 10 == 0x37 ) { // surrogate pair ++i; hi_sur &= (1<<10)-1; lo_sur &= (1<<10)-1; ucs4 = ( static_cast<uint32>(hi_sur) << 10 ) | ( static_cast<uint32>(lo_sur) << 0 ); } else { // no surrogate pair ucs4 = static_cast<uint32>( c ); } } else { // no surrogate possible ucs4 = static_cast<uint32>( c ); } } else { ucs4 = static_cast<uint32>( wc ); } if ( ucs4 > 0x1fffff ) { out.push_back( replacement ); continue; } uint8 utf8[6]; std::size_t numchars = 0; for ( numchars = 0; numchars < 6; numchars++ ) { utf8[numchars] = ucs4 & 0x3F; ucs4 >>= 6; if ( ucs4 == 0 ) { break; } } numchars++; if ( numchars == 1 ) { out.push_back( utf8[0] ); continue; } if ( numchars == 2 && utf8[numchars-1] == 0x01 ) { // generate shortest form out.push_back( utf8[0] | 0x40 ); continue; } std::size_t charsleft = numchars; while ( charsleft > 0 ) { if ( charsleft == numchars ) { out.push_back( utf8[ charsleft - 1 ] | ( ((1<<numchars)-1) << (8-numchars) ) ); } else { out.push_back( utf8[ charsleft - 1 ] | 0x80 ); } charsleft--; } } return out; } #endif // MPT_CHARSET_INTERNAL || MPT_CHARSET_WIN32 #if defined(MPT_CHARSET_WIN32) static bool TestCodePage(UINT cp) { return IsValidCodePage(cp) ? true : false; } static bool HasCharset(Charset charset) { bool result = false; switch(charset) { #if defined(MPT_WITH_CHARSET_LOCALE) case CharsetLocale: result = true; break; #endif case CharsetUTF8: result = TestCodePage(CP_UTF8); break; case CharsetASCII: result = TestCodePage(20127); break; case CharsetISO8859_1: result = TestCodePage(28591); break; case CharsetISO8859_15: result = TestCodePage(28605); break; case CharsetCP437: result = TestCodePage(437); break; case CharsetWindows1252: result = TestCodePage(1252); break; case CharsetCP437AMS: result = false; break; case CharsetCP437AMS2: result = false; break; } return result; } #endif // MPT_CHARSET_WIN32 #if defined(MPT_CHARSET_WIN32) static UINT CharsetToCodepage(Charset charset) { switch(charset) { #if defined(MPT_WITH_CHARSET_LOCALE) case CharsetLocale: return CP_ACP; break; #endif case CharsetUTF8: return CP_UTF8; break; case CharsetASCII: return 20127; break; case CharsetISO8859_1: return 28591; break; case CharsetISO8859_15: return 28605; break; case CharsetCP437: return 437; break; case CharsetCP437AMS: return 437; break; // fallback, should not happen case CharsetCP437AMS2: return 437; break; // fallback, should not happen case CharsetWindows1252: return 1252; break; } return 0; } #endif // MPT_CHARSET_WIN32 #if defined(MPT_CHARSET_ICONV) static const char * CharsetToString(Charset charset) { switch(charset) { #if defined(MPT_WITH_CHARSET_LOCALE) case CharsetLocale: return ""; break; // "char" breaks with glibc when no locale is set #endif case CharsetUTF8: return "UTF-8"; break; case CharsetASCII: return "ASCII"; break; case CharsetISO8859_1: return "ISO-8859-1"; break; case CharsetISO8859_15: return "ISO-8859-15"; break; case CharsetCP437: return "CP437"; break; case CharsetCP437AMS: return "CP437"; break; // fallback, should not happen case CharsetCP437AMS2: return "CP437"; break; // fallback, should not happen case CharsetWindows1252: return "CP1252"; break; } return 0; } static const char * CharsetToStringTranslit(Charset charset) { switch(charset) { #if defined(MPT_WITH_CHARSET_LOCALE) case CharsetLocale: return "//TRANSLIT"; break; // "char" breaks with glibc when no locale is set #endif case CharsetUTF8: return "UTF-8//TRANSLIT"; break; case CharsetASCII: return "ASCII//TRANSLIT"; break; case CharsetISO8859_1: return "ISO-8859-1//TRANSLIT"; break; case CharsetISO8859_15: return "ISO-8859-15//TRANSLIT"; break; case CharsetCP437: return "CP437//TRANSLIT"; break; case CharsetCP437AMS: return "CP437//TRANSLIT"; break; // fallback, should not happen case CharsetCP437AMS2: return "CP437//TRANSLIT"; break; // fallback, should not happen case CharsetWindows1252: return "CP1252//TRANSLIT"; break; } return 0; } static const char * Charset_wchar_t() { #if !defined(MPT_ICONV_NO_WCHAR) return "wchar_t"; #else // MPT_ICONV_NO_WCHAR // iconv on OSX does not handle wchar_t if no locale is set STATIC_ASSERT(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4); if(sizeof(wchar_t) == 2) { // "UTF-16" generates BOM #if defined(MPT_PLATFORM_LITTLE_ENDIAN) return "UTF-16LE"; #elif defined(MPT_PLATFORM_BIG_ENDIAN) return "UTF-16BE"; #else STATIC_ASSERT(false); #endif } else if(sizeof(wchar_t) == 4) { // "UTF-32" generates BOM #if defined(MPT_PLATFORM_LITTLE_ENDIAN) return "UTF-32LE"; #elif defined(MPT_PLATFORM_BIG_ENDIAN) return "UTF-32BE"; #else STATIC_ASSERT(false); #endif } return ""; #endif // !MPT_ICONV_NO_WCHAR | MPT_ICONV_NO_WCHAR } #endif // MPT_CHARSET_ICONV #if !defined(MPT_CHARSET_ICONV) template<typename Tdststring> Tdststring EncodeImplFallback(Charset charset, const std::wstring &src); #endif // !MPT_CHARSET_ICONV // templated on 8bit strings because of type-safe variants template<typename Tdststring> Tdststring EncodeImpl(Charset charset, const std::wstring &src) { STATIC_ASSERT(sizeof(typename Tdststring::value_type) == sizeof(char)); if(charset == CharsetCP437AMS || charset == CharsetCP437AMS2) { std::string out; if(charset == CharsetCP437AMS ) out = String::To8bit(src, CharsetTableCP437AMS ); if(charset == CharsetCP437AMS2) out = String::To8bit(src, CharsetTableCP437AMS2); return Tdststring(out.begin(), out.end()); } #if defined(MPT_WITH_CHARSET_LOCALE) #if defined(MPT_LOCALE_ASSUME_CHARSET) if(charset == CharsetLocale) { charset = MPT_LOCALE_ASSUME_CHARSET; } #endif #endif #if defined(MPT_CHARSET_WIN32) if(!HasCharset(charset)) { return EncodeImplFallback<Tdststring>(charset, src); } const UINT codepage = CharsetToCodepage(charset); int required_size = WideCharToMultiByte(codepage, 0, src.c_str(), -1, nullptr, 0, nullptr, nullptr); if(required_size <= 0) { return Tdststring(); } std::vector<CHAR> encoded_string(required_size); WideCharToMultiByte(codepage, 0, src.c_str(), -1, &encoded_string[0], required_size, nullptr, nullptr); return reinterpret_cast<const typename Tdststring::value_type*>(&encoded_string[0]); #elif defined(MPT_CHARSET_ICONV) iconv_t conv = iconv_t(); conv = iconv_open(CharsetToStringTranslit(charset), Charset_wchar_t()); if(!conv) { conv = iconv_open(CharsetToString(charset), Charset_wchar_t()); if(!conv) { throw std::runtime_error("iconv conversion not working"); } } std::vector<wchar_t> wide_string(src.c_str(), src.c_str() + src.length() + 1); std::vector<char> encoded_string(wide_string.size() * 8); // large enough char * inbuf = reinterpret_cast<char*>(&wide_string[0]); size_t inbytesleft = wide_string.size() * sizeof(wchar_t); char * outbuf = &encoded_string[0]; size_t outbytesleft = encoded_string.size(); while(iconv(conv, &inbuf, &inbytesleft, &outbuf, &outbytesleft) == static_cast<size_t>(-1)) { if(errno == EILSEQ || errno == EILSEQ) { inbuf += sizeof(wchar_t); inbytesleft -= sizeof(wchar_t); outbuf[0] = '?'; outbuf++; outbytesleft--; iconv(conv, NULL, NULL, NULL, NULL); // reset state } else { iconv_close(conv); conv = iconv_t(); return Tdststring(); } } iconv_close(conv); conv = iconv_t(); return reinterpret_cast<const typename Tdststring::value_type*>(&encoded_string[0]); #else return EncodeImplFallback<Tdststring>(charset, src); #endif } #if !defined(MPT_CHARSET_ICONV) template<typename Tdststring> Tdststring EncodeImplFallback(Charset charset, const std::wstring &src) { std::string out; switch(charset) { #if defined(MPT_WITH_CHARSET_LOCALE) case CharsetLocale: out = String::ToLocale(src); break; #endif case CharsetUTF8: out = String::ToUTF8(src); break; case CharsetASCII: out = String::ToAscii(src); break; case CharsetISO8859_1: out = String::ToISO_8859_1(src); break; case CharsetISO8859_15: out = String::To8bit(src, CharsetTableISO8859_15); break; case CharsetCP437: out = String::To8bit(src, CharsetTableCP437); break; case CharsetCP437AMS: out = String::To8bit(src, CharsetTableCP437AMS); break; case CharsetCP437AMS2: out = String::To8bit(src, CharsetTableCP437AMS2); break; case CharsetWindows1252: out = String::To8bit(src, CharsetTableWindows1252); break; } return Tdststring(out.begin(), out.end()); } #endif // !MPT_CHARSET_ICONV #if !defined(MPT_CHARSET_ICONV) template<typename Tsrcstring> std::wstring DecodeImplFallback(Charset charset, const Tsrcstring &src); #endif // !MPT_CHARSET_ICONV // templated on 8bit strings because of type-safe variants template<typename Tsrcstring> std::wstring DecodeImpl(Charset charset, const Tsrcstring &src) { STATIC_ASSERT(sizeof(typename Tsrcstring::value_type) == sizeof(char)); if(charset == CharsetCP437AMS || charset == CharsetCP437AMS2) { std::string in(src.begin(), src.end()); std::wstring out; if(charset == CharsetCP437AMS ) out = String::From8bit(in, CharsetTableCP437AMS ); if(charset == CharsetCP437AMS2) out = String::From8bit(in, CharsetTableCP437AMS2); return out; } #if defined(MPT_WITH_CHARSET_LOCALE) #if defined(MPT_LOCALE_ASSUME_CHARSET) if(charset == CharsetLocale) { charset = MPT_LOCALE_ASSUME_CHARSET; } #endif #endif #if defined(MPT_CHARSET_WIN32) if(!HasCharset(charset)) { return DecodeImplFallback<Tsrcstring>(charset, src); } const UINT codepage = CharsetToCodepage(charset); int required_size = MultiByteToWideChar(codepage, 0, reinterpret_cast<const char*>(src.c_str()), -1, nullptr, 0); if(required_size <= 0) { return std::wstring(); } std::vector<WCHAR> decoded_string(required_size); MultiByteToWideChar(codepage, 0, reinterpret_cast<const char*>(src.c_str()), -1, &decoded_string[0], required_size); return &decoded_string[0]; #elif defined(MPT_CHARSET_ICONV) iconv_t conv = iconv_t(); conv = iconv_open(Charset_wchar_t(), CharsetToString(charset)); if(!conv) { throw std::runtime_error("iconv conversion not working"); } std::vector<char> encoded_string(reinterpret_cast<const char*>(src.c_str()), reinterpret_cast<const char*>(src.c_str()) + src.length() + 1); std::vector<wchar_t> wide_string(encoded_string.size() * 8); // large enough char * inbuf = &encoded_string[0]; size_t inbytesleft = encoded_string.size(); char * outbuf = reinterpret_cast<char*>(&wide_string[0]); size_t outbytesleft = wide_string.size() * sizeof(wchar_t); while(iconv(conv, &inbuf, &inbytesleft, &outbuf, &outbytesleft) == static_cast<size_t>(-1)) { if(errno == EILSEQ || errno == EILSEQ) { inbuf++; inbytesleft--; for(std::size_t i = 0; i < sizeof(wchar_t); ++i) { outbuf[i] = 0; } #ifdef MPT_PLATFORM_BIG_ENDIAN outbuf[sizeof(wchar_t)-1 - 1] = uint8(0xff); outbuf[sizeof(wchar_t)-1 - 0] = uint8(0xfd); #else outbuf[1] = uint8(0xff); outbuf[0] = uint8(0xfd); #endif outbuf += sizeof(wchar_t); outbytesleft -= sizeof(wchar_t); iconv(conv, NULL, NULL, NULL, NULL); // reset state } else { iconv_close(conv); conv = iconv_t(); return std::wstring(); } } iconv_close(conv); conv = iconv_t(); return &wide_string[0]; #else return DecodeImplFallback<Tsrcstring>(charset, src); #endif } #if !defined(MPT_CHARSET_ICONV) template<typename Tsrcstring> std::wstring DecodeImplFallback(Charset charset, const Tsrcstring &src) { std::string in(src.begin(), src.end()); std::wstring out; switch(charset) { #if defined(MPT_WITH_CHARSET_LOCALE) case CharsetLocale: out = String::FromLocale(in); break; #endif case CharsetUTF8: out = String::FromUTF8(in); break; case CharsetASCII: out = String::FromAscii(in); break; case CharsetISO8859_1: out = String::FromISO_8859_1(in); break; case CharsetISO8859_15: out = String::From8bit(in, CharsetTableISO8859_15); break; case CharsetCP437: out = String::From8bit(in, CharsetTableCP437); break; case CharsetCP437AMS: out = String::From8bit(in, CharsetTableCP437AMS); break; case CharsetCP437AMS2: out = String::From8bit(in, CharsetTableCP437AMS2); break; case CharsetWindows1252: out = String::From8bit(in, CharsetTableWindows1252); break; } return out; } #endif // !MPT_CHARSET_ICONV // templated on 8bit strings because of type-safe variants template<typename Tdststring, typename Tsrcstring> Tdststring ConvertImpl(Charset to, Charset from, const Tsrcstring &src) { STATIC_ASSERT(sizeof(typename Tdststring::value_type) == sizeof(char)); STATIC_ASSERT(sizeof(typename Tsrcstring::value_type) == sizeof(char)); if(to == from) { const typename Tsrcstring::value_type * src_beg = src.data(); const typename Tsrcstring::value_type * src_end = src_beg + src.size(); return Tdststring(reinterpret_cast<const typename Tdststring::value_type *>(src_beg), reinterpret_cast<const typename Tdststring::value_type *>(src_end)); } #if defined(MPT_CHARSET_ICONV) if(to == CharsetCP437AMS || to == CharsetCP437AMS2 || from == CharsetCP437AMS || from == CharsetCP437AMS2) { return EncodeImpl<Tdststring>(to, DecodeImpl(from, src)); } iconv_t conv = iconv_t(); conv = iconv_open(CharsetToStringTranslit(to), CharsetToString(from)); if(!conv) { conv = iconv_open(CharsetToString(to), CharsetToString(from)); if(!conv) { throw std::runtime_error("iconv conversion not working"); } } std::vector<char> src_string(reinterpret_cast<const char*>(src.c_str()), reinterpret_cast<const char*>(src.c_str()) + src.length() + 1); std::vector<char> dst_string(src_string.size() * 8); // large enough char * inbuf = &src_string[0]; size_t inbytesleft = src_string.size(); char * outbuf = &dst_string[0]; size_t outbytesleft = dst_string.size(); while(iconv(conv, &inbuf, &inbytesleft, &outbuf, &outbytesleft) == static_cast<size_t>(-1)) { if(errno == EILSEQ || errno == EILSEQ) { inbuf++; inbytesleft--; outbuf[0] = '?'; outbuf++; outbytesleft--; iconv(conv, NULL, NULL, NULL, NULL); // reset state } else { iconv_close(conv); conv = iconv_t(); return Tdststring(); } } iconv_close(conv); conv = iconv_t(); return reinterpret_cast<const typename Tdststring::value_type*>(&dst_string[0]); #else return EncodeImpl<Tdststring>(to, DecodeImpl(from, src)); #endif } } // namespace String bool IsUTF8(const std::string &str) //--------------------------------- { return (str == String::EncodeImpl<std::string>(mpt::CharsetUTF8, String::DecodeImpl<std::string>(mpt::CharsetUTF8, str))); } #if MPT_WSTRING_CONVERT std::wstring ToWide(Charset from, const std::string &str) { return String::DecodeImpl(from, str); } #endif #if MPT_WSTRING_CONVERT std::string ToCharset(Charset to, const std::wstring &str) { return String::EncodeImpl<std::string>(to, str); } #endif std::string ToCharset(Charset to, Charset from, const std::string &str) { return String::ConvertImpl<std::string>(to, from, str); } #if defined(_MFC_VER) CString ToCString(const std::wstring &str) { #ifdef UNICODE return str.c_str(); #else return ToCharset(CharsetLocale, str).c_str(); #endif } CString ToCString(Charset from, const std::string &str) { #ifdef UNICODE return ToWide(from, str).c_str(); #else return ToCharset(CharsetLocale, from, str).c_str(); #endif } std::wstring ToWide(const CString &str) { #ifdef UNICODE return str.GetString(); #else return ToWide(CharsetLocale, str.GetString()); #endif } std::string ToCharset(Charset to, const CString &str) { #ifdef UNICODE return ToCharset(to, str.GetString()); #else return ToCharset(to, CharsetLocale, str.GetString()); #endif } #ifdef UNICODE // inline #else // !UNICODE CStringW ToCStringW(const CString &str) { return ToWide(str).c_str(); } CStringW ToCStringW(const std::wstring &str) { return str.c_str(); } CStringW ToCStringW(Charset from, const std::string &str) { return ToWide(from, str).c_str(); } CStringW ToCStringW(const CStringW &str) { return str; } std::wstring ToWide(const CStringW &str) { return str.GetString(); } std::string ToCharset(Charset to, const CStringW &str) { return ToCharset(to, str.GetString()); } CString ToCString(const CStringW &str) { return ToCharset(CharsetLocale, str).c_str(); } #endif // UNICODE #endif // MFC #if MPT_USTRING_MODE_WIDE // inline #else // !MPT_USTRING_MODE_WIDE #if MPT_WSTRING_CONVERT mpt::ustring ToUnicode(const std::wstring &str) { return String::EncodeImpl<mpt::ustring>(mpt::CharsetUTF8, str); } #endif mpt::ustring ToUnicode(Charset from, const std::string &str) { return String::ConvertImpl<mpt::ustring>(mpt::CharsetUTF8, from, str); } #if defined(_MFC_VER) mpt::ustring ToUnicode(const CString &str) { #ifdef UNICODE return String::EncodeImpl<mpt::ustring>(mpt::CharsetUTF8, str.GetString()); #else // !UNICODE return String::ConvertImpl<mpt::ustring, std::string>(mpt::CharsetUTF8, mpt::CharsetLocale, str.GetString()); #endif // UNICODE } #ifndef UNICODE mpt::ustring ToUnicode(const CStringW &str) { return String::EncodeImpl<mpt::ustring>(mpt::CharsetUTF8, str.GetString()); } #endif // !UNICODE #endif // MFC #endif // MPT_USTRING_MODE_WIDE #if MPT_USTRING_MODE_WIDE // nothing, std::wstring overloads will catch all stuff #else // !MPT_USTRING_MODE_WIDE #if MPT_WSTRING_CONVERT std::wstring ToWide(const mpt::ustring &str) { return String::DecodeImpl<mpt::ustring>(mpt::CharsetUTF8, str); } #endif std::string ToCharset(Charset to, const mpt::ustring &str) { return String::ConvertImpl<std::string, mpt::ustring>(to, mpt::CharsetUTF8, str); } #if defined(_MFC_VER) CString ToCString(const mpt::ustring &str) { #ifdef UNICODE return String::DecodeImpl<mpt::ustring>(mpt::CharsetUTF8, str).c_str(); #else // !UNICODE return String::ConvertImpl<std::string, mpt::ustring>(mpt::CharsetLocale, mpt::CharsetUTF8, str).c_str(); #endif // UNICODE } #endif // MFC #endif // MPT_USTRING_MODE_WIDE char ToLowerCaseAscii(char c) { if('A' <= c && c <= 'Z') { c += 'a' - 'A'; } return c; } char ToUpperCaseAscii(char c) { if('a' <= c && c <= 'z') { c -= 'a' - 'A'; } return c; } std::string ToLowerCaseAscii(std::string s) { std::transform(s.begin(), s.end(), s.begin(), static_cast<char(*)(char)>(&mpt::ToLowerCaseAscii)); return s; } std::string ToUpperCaseAscii(std::string s) { std::transform(s.begin(), s.end(), s.begin(), static_cast<char(*)(char)>(&mpt::ToUpperCaseAscii)); return s; } int CompareNoCaseAscii(const char *a, const char *b, std::size_t n) { while(n--) { unsigned char ac = static_cast<unsigned char>(mpt::ToLowerCaseAscii(*a)); unsigned char bc = static_cast<unsigned char>(mpt::ToLowerCaseAscii(*b)); if(ac != bc) { return ac < bc ? -1 : 1; } else if(!ac && !bc) { return 0; } ++a; ++b; } return 0; } int CompareNoCaseAscii(const std::string &a, const std::string &b) { for(std::size_t i = 0; i < std::min(a.length(), b.length()); ++i) { unsigned char ac = static_cast<unsigned char>(mpt::ToLowerCaseAscii(a[i])); unsigned char bc = static_cast<unsigned char>(mpt::ToLowerCaseAscii(b[i])); if(ac != bc) { return ac < bc ? -1 : 1; } else if(!ac && !bc) { return 0; } } if(a.length() == b.length()) { return 0; } return a.length() < b.length() ? -1 : 1; } #if defined(MODPLUG_TRACKER) mpt::ustring ToLowerCase(const mpt::ustring &s) { #if defined(_MFC_VER) CStringW tmp = mpt::ToCStringW(s); tmp.MakeLower(); return mpt::ToUnicode(tmp); #else // !_MFC_VER std::wstring ws = mpt::ToWide(s); std::transform(ws.begin(), ws.end(), ws.begin(), &std::towlower); return mpt::ToUnicode(ws); #endif // _MFC_VER } mpt::ustring ToUpperCase(const mpt::ustring &s) { #if defined(_MFC_VER) CStringW tmp = mpt::ToCStringW(s); tmp.MakeUpper(); return mpt::ToUnicode(tmp); #else // !_MFC_VER std::wstring ws = mpt::ToWide(s); std::transform(ws.begin(), ws.end(), ws.begin(), &std::towlower); return mpt::ToUnicode(ws); #endif // _MFC_VER } #endif // MODPLUG_TRACKER } // namespace mpt OPENMPT_NAMESPACE_END
[ "woollybah@gmail.com" ]
woollybah@gmail.com
9252a1612ab26d41713090f7f739e8af89bed0ce
ffa40e15ee8285423092163fb3e447c21d248b8e
/src/50.cpp
3cdc4ca6eeee95209912b13ea64079a068a006f7
[]
no_license
jxyy/leetcode
e97f9f43cb595c918bba813ddadf76e9e92960ea
37cdcc98a795a98e0cb41abeb1adc42888cc6371
refs/heads/master
2021-01-19T21:28:41.457100
2019-08-03T09:56:30
2019-08-03T09:56:30
40,013,083
0
0
null
null
null
null
UTF-8
C++
false
false
680
cpp
#include<iostream> #include<vector> using namespace std; class Solution { public: double myPow(double x, int n) { if(n == INT_MIN){ return 1 / myPow(x, INT_MAX) / x; } if(n < 0){ return 1 / myPow(x, -n); } if(n == 0){ return 1; } if(n == 1) { return x; } int half = n / 2; double a = myPow(x, half); return n % 2 == 0 ? a*a:a*a*x; } }; int main(){ Solution s; cout << s.myPow(2, 10) << endl; cout << s.myPow(2.1, 3) << endl; cout << s.myPow(2, -2) << endl; cout << s.myPow(1, -2147483648) << endl; return 0; }
[ "xia.jing@wanweifund.com" ]
xia.jing@wanweifund.com
202958bac71dfca86e516b8539298f109f7d3f91
524299063b2532e3f094551062b6e18fd92c111c
/linkedList.h
3b01f0799fc0bc1684a0da8c49e2bf11105e3c47
[]
no_license
hmckelvie/Grep-Search
cd5b5e2db1a5a9d38453676f76eab8a3047616d4
8bc5699a5a19b1f4afde014a6c9653ea4fe842fd
refs/heads/master
2022-11-14T03:36:44.187108
2020-07-13T16:02:20
2020-07-13T16:02:20
279,330,212
0
0
null
null
null
null
UTF-8
C++
false
false
1,453
h
/* Hailey McKelvie Comp15 proj2 linkedList.h 12/3/19 The LinkedList class handles the chaining for collisions in The HashTable. Each node of the LinkedList contains a "List" of all instances of a case insensitive "string." */ #include <iostream> #include <vector> #include <fstream> #include "List.h" #include "PathTable.h" using namespace std; #ifndef _LINKEDLIST_H_ #define _LINKEDLIST_H_ class linkedList{ public: linkedList(); ~linkedList(); linkedList(const linkedList &source); linkedList &operator=(const linkedList &source); int insert(string toAdd, string lowered, int line, int pathToWord); int getLength(); int getNumWords(); bool findandPrint(ofstream &out, string toFind, string lowered, PathTable *paths); string getHeadLC(); void removeFromFront(); void deleteList(); void addFront(linkedList thisNode); bool findInsensitive(ofstream &out, string lowered, PathTable *paths); private: struct Node{ string lowerCase; List words; Node *next; }; Node *front; int length; int numTotalWords; int insertAtFront(string toAdd, string lowered, int line, int pathToWord); int findLowerCaseNode(string toFind, string lowered, int line, int pathToWord); string lower(string nonLower); Node *copy(Node *head); void AddToFront(Node *first); void printLine(ofstream &out, string file, int line); }; #endif
[ "hmckel01@dell27.eecs.tufts.edu" ]
hmckel01@dell27.eecs.tufts.edu
9a139b659e15268db8a66ceed3c4be8bc760fb7a
cc2ff70c799eb5748bb32ca3d6a275c4153ccc60
/src/nnr/ManagerFactory.h
30d0dd145ae3c90cf8d902b21f60f11f8a9206f4
[]
no_license
charme000/nnr
6d78c797b8b91750b595490780c0ba1a8c302c43
66af9a6634a446b446bbdd806954e5fe383936ee
refs/heads/master
2021-01-22T04:57:06.077576
2013-06-24T05:39:58
2013-06-24T05:39:58
10,899,369
0
1
null
null
null
null
UTF-8
C++
false
false
969
h
#ifndef MANAGERFACTORY_H #define MANAGERFACTORY_H #include "Common.h" #include "Manager.h" #include "TcpManager.h" #include "PipeManager.h" #include "Bus.h" QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class Bus; class Manager; /*! \class ManagerFactory \brief 管理器工厂类 \version 1.0 \date 2012.12.1-2012.1.30 */ class NNR_EXPORT ManagerFactory { public: static Manager* Create(Bus& bus, QString &attribute, Flag_Tag method, QString &value, QString &ip, QString &guidName) { QPointer<Manager> m; if (method == TcpFlag) { m = new TcpManager(bus, attribute, value, ip, guidName); } else if (method == PipeFlag) { m = new PipeManager(bus,attribute,value, ip, guidName); } else { } return m; } }; QT_END_NAMESPACE QT_END_HEADER #endif // MANAGERFACTORY_H
[ "909152171@qq.com" ]
909152171@qq.com
d1c22730fc6355263f3d1a22a5abd8ada4ef9117
d0c44dd3da2ef8c0ff835982a437946cbf4d2940
/cmake-build-debug/programs_tiling/function14453/function14453_schedule_28/function14453_schedule_28.cpp
bc0c760fcee19c9efb83857d6144df54e2c2981a
[]
no_license
IsraMekki/tiramisu_code_generator
8b3f1d63cff62ba9f5242c019058d5a3119184a3
5a259d8e244af452e5301126683fa4320c2047a3
refs/heads/master
2020-04-29T17:27:57.987172
2019-04-23T16:50:32
2019-04-23T16:50:32
176,297,755
1
2
null
null
null
null
UTF-8
C++
false
false
2,057
cpp
#include <tiramisu/tiramisu.h> using namespace tiramisu; int main(int argc, char **argv){ tiramisu::init("function14453_schedule_28"); constant c0("c0", 64), c1("c1", 128), c2("c2", 64), c3("c3", 64); var i0("i0", 0, c0), i1("i1", 0, c1), i2("i2", 0, c2), i3("i3", 0, c3), i01("i01"), i02("i02"), i03("i03"), i04("i04"), i05("i05"), i06("i06"); input input00("input00", {i0, i3}, p_int32); input input01("input01", {i3}, p_int32); input input02("input02", {i1, i2, i3}, p_int32); input input03("input03", {i1, i3}, p_int32); input input04("input04", {i1, i2, i3}, p_int32); input input05("input05", {i1, i3}, p_int32); input input06("input06", {i0, i1, i3}, p_int32); input input07("input07", {i1}, p_int32); computation comp0("comp0", {i0, i1, i2, i3}, input00(i0, i3) + input01(i3) + input02(i1, i2, i3) * input03(i1, i3) * input04(i1, i2, i3) - input05(i1, i3) + input06(i0, i1, i3) + input07(i1)); comp0.tile(i0, i1, i2, 64, 32, 64, i01, i02, i03, i04, i05, i06); comp0.parallelize(i01); buffer buf00("buf00", {64, 64}, p_int32, a_input); buffer buf01("buf01", {64}, p_int32, a_input); buffer buf02("buf02", {128, 64, 64}, p_int32, a_input); buffer buf03("buf03", {128, 64}, p_int32, a_input); buffer buf04("buf04", {128, 64, 64}, p_int32, a_input); buffer buf05("buf05", {128, 64}, p_int32, a_input); buffer buf06("buf06", {64, 128, 64}, p_int32, a_input); buffer buf07("buf07", {128}, p_int32, a_input); buffer buf0("buf0", {64, 128, 64, 64}, p_int32, a_output); input00.store_in(&buf00); input01.store_in(&buf01); input02.store_in(&buf02); input03.store_in(&buf03); input04.store_in(&buf04); input05.store_in(&buf05); input06.store_in(&buf06); input07.store_in(&buf07); comp0.store_in(&buf0); tiramisu::codegen({&buf00, &buf01, &buf02, &buf03, &buf04, &buf05, &buf06, &buf07, &buf0}, "../data/programs/function14453/function14453_schedule_28/function14453_schedule_28.o"); return 0; }
[ "ei_mekki@esi.dz" ]
ei_mekki@esi.dz
854218b3b6ac75091ec521c472d1f32f422901da
2476e036866ebf861e834eb0ddb2a8cd49104285
/competition/wap201510_B/wap201510_B/main.cpp
b40063df4422ec31665601334c62824fd0bab42c
[]
no_license
xchmwang/algorithm
7deaedecb58e3925cc23239020553ffed8cc3f04
55345160b6d8ef02bc89e01247b4dbd1bc094d5e
refs/heads/master
2021-09-17T23:54:40.785962
2018-07-07T06:40:27
2018-07-07T06:40:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,849
cpp
#include <cstdio> #include <set> #include <cstring> using namespace std; const int maxn = 1e5 + 10; const int INF = 0x3f3f3f3f; int n, m; multiset<int> near[maxn]; int stamp; int cluster[maxn], father[maxn], kid[maxn]; int top[maxn], idx[maxn], pos[maxn]; int festiveNum; bool isFestive[maxn]; inline int min(int x, int y) { return x<y ? x : y; } inline int getD(int u) { if (near[u].size() > 0) return *near[u].begin(); return INF; } struct Edge { int v, next; } edge[maxn * 2]; int edgeNum, head[maxn]; void clearEdge() { edgeNum = 0; memset(head, -1, sizeof(head)); return; } inline void addEdgeSub(const int &u, const int &v) { edge[edgeNum].v = v; edge[edgeNum].next = head[u]; head[u] = edgeNum++; return; } inline void addEdge(const int &u, const int &v) { addEdgeSub(u, v); addEdgeSub(v, u); return; } struct TreeNode { int l, r, lc, rc; int minL, minR; } node[maxn * 3]; int nodeNum, tree[maxn]; void initNode(int x) { if (isFestive[pos[node[x].l]]) node[x].minL = node[x].minR = 0; else node[x].minL = node[x].minR = getD(node[x].l); return; } void pushUp(int x) { int L = node[x].lc; int R = node[x].rc; int mid = (node[x].l + node[x].r) >> 1; node[x].minL = min(node[L].minL, node[R].minL + mid + 1 - node[x].l); node[x].minR = min(node[R].minR, node[L].minR + node[x].r - mid); return; } // build tree int buildTree(int l, int r) { int x = nodeNum++; node[x].l = l; node[x].r = r; if (l == r) { initNode(x); return x; } int mid = (l + r) >> 1; node[x].lc = buildTree(l, mid); node[x].rc = buildTree(mid + 1, r); pushUp(x); return x; } // update tree recursively, keep balanced void updateTree(int x, int pos) { if (node[x].l == node[x].r) { initNode(x); return; } int mid = (node[x].l + node[x].r) >> 1; if (pos <= mid) updateTree(node[x].lc, pos); else updateTree(node[x].rc, pos); pushUp(x); return; } // query for left tree, binary search, recursively int queryTreeL(int x, int l, int r) { if (node[x].l==l && node[x].r==r) return node[x].minL; int mid = (node[x].l + node[x].r) >> 1; if (r <= mid) return queryTreeL(node[x].lc, l, r); if (l > mid) return queryTreeL(node[x].rc, l, r); int lmin = queryTreeL(node[x].lc, l, mid); int rmin = queryTreeL(node[x].rc, mid + 1, r); return min(lmin, rmin + mid + 1 - l); } // query for right tree, binary search, recursively int queryTreeR(int x, int l, int r) { if (node[x].l==l && node[x].r==r) return node[x].minR; int mid = (node[x].l + node[x].r) >> 1; if (r <= mid) return queryTreeR(node[x].lc, l, r); if (l > mid) return queryTreeR(node[x].rc, l, r); int lmin = queryTreeR(node[x].lc, l, mid); int rmin = queryTreeR(node[x].rc, mid + 1, r); return min(rmin, lmin + r - mid); } // union-find structure void initRelation(int u, int f = -1) { cluster[u] = 1; father[u] = f; kid[u] = 0; top[u] = u; for (int i = head[u]; ~i; i = edge[i].next) { int v = edge[i].v; if (v != f) { initRelation(v, u); if (cluster[v] > cluster[kid[u]]) kid[u] = v; cluster[u] += cluster[v]; } } return; } void initIndex(int u, int f = -1) { idx[u] = ++stamp; pos[stamp] = u; if (kid[u]) { top[kid[u]] = top[u]; initIndex(kid[u], u); } for (int i = head[u]; ~i; i = edge[i].next) { int v = edge[i].v; if (v!=f && v!=kid[u]) initIndex(v, u); } return; } void initHeavy() { stamp = 0; initRelation(1); initIndex(1); return; } void buildTrees(int u, int f) { for (int i = head[u]; ~i; i = edge[i].next) { int v = edge[i].v; if (v!=f && v!=kid[u]) buildTrees(v, u); } if (kid[u]) buildTrees(kid[u], u); else tree[idx[top[u]]] = buildTree(idx[top[u]], idx[u]); return; } void buildTrees() { buildTrees(1, -1); return; } void init() { nodeNum = 0; clearEdge(); memset(isFestive, false, sizeof(isFestive)); festiveNum = 1; isFestive[1] = true; for (int i = 1; i <= n; ++i) near[i].clear(); return; } // update operation, update tree at the same time void update(int u) { if (!isFestive[u]) { isFestive[u] = true; ++festiveNum; } else return; while (true) { int t = tree[idx[top[u]]]; int oldVal = node[t].minL + 1; updateTree(t, idx[u]); int newVal = node[t].minL + 1; u = father[top[u]]; if (u == -1) break; multiset<int> &s = near[idx[u]]; if (newVal != oldVal) { multiset<int>::iterator it = s.find(oldVal); if (it != s.end()) s.erase(it); if (newVal < INF) s.insert(newVal); } } return; } // query operation, and print the result void query(int u) { if (isFestive[u]) puts("0"); else { int d = 0; int ans = INF; while (true) { int t = tree[idx[top[u]]]; int l = node[t].l; int r = node[t].r; ans = min(ans, queryTreeR(t, l, idx[u]) + d); ans = min(ans, queryTreeL(t, idx[u], r) + d); d += idx[u] - l + 1; u = father[top[u]]; if (u == -1) break; } printf("%d\n", ans); } return; } int main() { int u, v; scanf("%d %d", &n, &m); init(); for (int i = 1; i < n; ++i) { scanf("%d %d", &u, &v); addEdge(u, v); } initHeavy(); buildTrees(); while (m--) { scanf("%d %d", &u, &v); if (u == 1) update(v); else query(v); } return 0; } /* 5 5 1 2 1 3 3 4 3 5 2 5 2 3 1 3 2 3 2 4 15 100 1 2 1 3 2 4 2 5 3 6 3 7 4 8 4 9 5 10 5 11 6 12 6 13 7 14 7 15 15 100 1 2 1 3 1 4 1 5 1 6 2 7 2 8 3 9 9 10 9 11 10 15 5 12 12 13 6 14 */
[ "ChenminWang.Dk@gmail.com" ]
ChenminWang.Dk@gmail.com
f0e804f4298a76d99886911d4eda62101308073c
c5dbf850e49a5cfe1d9ca6ad7f91781d928d0747
/EASTL/benchmark/source/EASTLBenchmark.h
b9feb944bc0901696506100bfd10f3f6c4bfc7ce
[ "MIT", "BSD-3-Clause", "BSD-2-Clause" ]
permissive
nsgomez/sc4fix
f0c92711bafc1eb2109d80355c240ef4452f5185
1f6ee00eee8a34a3ab092f4bca6745031f571a54
refs/heads/master
2022-06-04T23:54:04.979600
2022-05-21T01:49:01
2022-05-21T01:49:01
48,570,607
29
2
null
null
null
null
UTF-8
C++
false
false
5,972
h
///////////////////////////////////////////////////////////////////////////// // Copyright (c) Electronic Arts Inc. All rights reserved. ///////////////////////////////////////////////////////////////////////////// #ifndef EASTLBENCHMARK_H #define EASTLBENCHMARK_H // Intrinsic control // // Our benchmark results are being skewed by inconsistent decisions by the // VC++ compiler to use intrinsic functions. Additionally, many of our // benchmarks work on large blocks of elements, whereas intrinsics often // are an improvement only over small blocks of elements. As a result, // enabling of intrinsics is often resulting in poor benchmark results for // code that gets an intrinsic enabled for it, even though it will often // happen in real code to be the opposite case. The disabling of intrinsics // here often results in EASTL performance being lower than it would be in // real-world situations. // #include <string.h> #ifdef _MSC_VER #pragma function(strlen, strcmp, strcpy, strcat, memcpy, memcmp, memset) #endif #include <EASTL/set.h> #include <EASTL/string.h> #include <EAStdC/EAStopwatch.h> #include <stdlib.h> #include <string.h> void BenchmarkSort(); void BenchmarkList(); void BenchmarkString(); void BenchmarkVector(); void BenchmarkDeque(); void BenchmarkSet(); void BenchmarkMap(); void BenchmarkHash(); void BenchmarkAlgorithm(); void BenchmarkHeap(); void BenchmarkBitset(); namespace Benchmark { // Environment // // The environment for this benchmark test. // struct Environment { eastl::string8 msPlatform; // Name of test platform (e.g. "Windows") eastl::string8 msSTLName1; // Name of competitor #1 (e.g. "EASTL"). eastl::string8 msSTLName2; // Name of competitor #2 (e.g. "MS STL"). void clear() { msPlatform.set_capacity(0); msSTLName1.set_capacity(0); msSTLName2.set_capacity(0); } }; Environment& GetEnvironment(); // Result // // An individual benchmark result. // struct Result { eastl::string8 msName; // Test name (e.g. "vector/insert"). int mUnits; // Timing units (e.g. EA::StdC::Stopwatch::kUnitsSeconds). int64_t mTime1; // Time of competitor #1. uint64_t mTime1NS; // Nanoseconds. int64_t mTime2; // Time of competitor #2. int64_t mTime2NS; // Nanoseconds. eastl::string8 msNotes; // Any comments to attach to this result. Result() : msName(), mUnits(EA::StdC::Stopwatch::kUnitsCPUCycles), mTime1(0), mTime1NS(0), mTime2(0), mTime2NS(0), msNotes() { } }; inline bool operator<(const Result& r1, const Result& r2) { return r1.msName < r2.msName; } typedef eastl::set<Result> ResultSet; ResultSet& GetResultSet(); // Scratch sprintf buffer extern char gScratchBuffer[1024]; // Utility functions // void DoNothing(...); void AddResult(const char* pName, int units, int64_t nTime1, int64_t nTime2, const char* pNotes = NULL); void PrintResults(); void WriteTime(int64_t timeNS, eastl::string& sTime); } // namespace Benchmark /////////////////////////////////////////////////////////////////////////////// /// LargePOD /// /// Implements a structure which is essentially a largish POD. Useful for testing /// containers and algorithms for their ability to efficiently work with PODs. /// This class isn't strictly a POD by the definition of the C++ standard, /// but it suffices for our interests. /// struct LargeObject { int32_t mData[2048]; }; struct LargePOD { LargeObject mLargeObject1; LargeObject mLargeObject2; const char* mpName1; const char* mpName2; explicit LargePOD(int32_t x = 0) // A true POD doesn't have a non-trivial constructor. { memset(mLargeObject1.mData, 0, sizeof(mLargeObject1.mData)); memset(mLargeObject2.mData, 0, sizeof(mLargeObject2.mData)); mLargeObject1.mData[0] = x; mpName1 = "LargePOD1"; mpName2 = "LargePOD2"; } LargePOD(const LargePOD& largePOD) // A true POD doesn't have a non-trivial copy-constructor. : mLargeObject1(largePOD.mLargeObject1), mLargeObject2(largePOD.mLargeObject2), mpName1(largePOD.mpName1), mpName2(largePOD.mpName2) { } virtual ~LargePOD() { } LargePOD& operator=(const LargePOD& largePOD) // A true POD doesn't have a non-trivial assignment operator. { if(&largePOD != this) { mLargeObject1 = largePOD.mLargeObject1; mLargeObject2 = largePOD.mLargeObject2; mpName1 = largePOD.mpName1; mpName2 = largePOD.mpName2; } return *this; } virtual void DoSomething() // Note that by declaring this virtual, this class is not truly a POD. { // But it acts like a POD for the purposes of EASTL algorithms. mLargeObject1.mData[1]++; } operator int() { return (int)mLargeObject1.mData[0]; } }; //EASTL_DECLARE_POD(LargePOD); //EASTL_DECLARE_TRIVIAL_CONSTRUCTOR(LargePOD); //EASTL_DECLARE_TRIVIAL_COPY(LargePOD); //EASTL_DECLARE_TRIVIAL_ASSIGN(LargePOD); //EASTL_DECLARE_TRIVIAL_DESTRUCTOR(LargePOD); //EASTL_DECLARE_TRIVIAL_RELOCATE(LargePOD); // Operators // We specifically define only == and <, in order to verify that // our containers and algorithms are not mistakenly expecting other // operators for the contained and manipulated classes. inline bool operator==(const LargePOD& t1, const LargePOD& t2) { return (memcmp(&t1.mLargeObject1, &t2.mLargeObject1, sizeof(t1.mLargeObject1)) == 0) && (memcmp(&t1.mLargeObject2, &t2.mLargeObject2, sizeof(t1.mLargeObject2)) == 0) && (strcmp(t1.mpName1, t2.mpName1) == 0) && (strcmp(t1.mpName2, t2.mpName2) == 0); } inline bool operator<(const LargePOD& t1, const LargePOD& t2) { return (memcmp(&t1.mLargeObject1, &t2.mLargeObject1, sizeof(t1.mLargeObject1)) < 0) && (memcmp(&t1.mLargeObject2, &t2.mLargeObject2, sizeof(t1.mLargeObject2)) < 0) && (strcmp(t1.mpName1, t2.mpName1) < 0) && (strcmp(t1.mpName2, t2.mpName2) < 0); } #endif // Header sentry
[ "nelson.gomez.msd@gmail.com" ]
nelson.gomez.msd@gmail.com
5326ffb8b4c8d70d83d73ddea4530985d2dcdced
3e4f9c2856564e2314cb71d07909891d1b740e6a
/src/ExtLib/MediaInfo/MediaInfo/Multiple/File_Wm_Elements.cpp
658f611f2099a864e162ebc709e422db0dc6a672
[ "Zlib", "curl", "NCSA", "BSD-2-Clause", "MIT" ]
permissive
chinajeffery/MPC-BE--1.2.3
62dd1adbb2c0ef3deed85c6c8ad7de03764e7144
2229fde5535f565ba4a496a7f73267bd2c1ad338
refs/heads/master
2021-01-10T13:36:59.981218
2016-03-16T07:46:05
2016-03-16T07:46:05
53,302,468
0
0
null
null
null
null
UTF-8
C++
false
false
81,846
cpp
/* Copyright (c) MediaArea.net SARL. All Rights Reserved. * * Use of this source code is governed by a BSD-style license that can * be found in the License.html file in the root of the source tree. */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // Elements part // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- // Pre-compilation #include "MediaInfo/PreComp.h" #ifdef __BORLANDC__ #pragma hdrstop #endif //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/Setup.h" //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #ifdef MEDIAINFO_WM_YES //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/Multiple/File_Wm.h" #if defined(MEDIAINFO_VC1_YES) #include "MediaInfo/Video/File_Vc1.h" #endif #if defined(MEDIAINFO_MPEGV_YES) #include "MediaInfo/Video/File_Mpegv.h" #endif #if defined(MEDIAINFO_AC3_YES) #include "MediaInfo/Audio/File_Ac3.h" #endif #if defined(MEDIAINFO_MPEGA_YES) #include "MediaInfo/Audio/File_Mpega.h" #endif #if MEDIAINFO_DEMUX #include "MediaInfo/MediaInfo_Config_MediaInfo.h" #include "base64.h" #endif //MEDIAINFO_DEMUX #include "ZenLib/Utils.h" using namespace ZenLib; //--------------------------------------------------------------------------- namespace MediaInfoLib { //*************************************************************************** // Constants //*************************************************************************** const char* Wm_CodecList_Kind(int32u Kind) { switch (Kind) { case 0x01 : return "Video"; case 0x02 : return "Audio"; default : return "Unknown"; } } const char* Wm_BannerImageData_Type(int32u Type) { switch (Type) { case 0x00 : return ""; case 0x01 : return "Bitmap"; case 0x02 : return "JPEG"; case 0x03 : return "GIF"; default : return "Unknown"; } } #define UUID(NAME, PART1, PART2, PART3, PART4, PART5) \ const int64u NAME =0x##PART3##PART2##PART1##ULL; \ const int64u NAME##2=0x##PART4##PART5##ULL; \ namespace Elements { UUID(Header, 75B22630, 668E, 11CF, A6D9, 00AA0062CE6C) UUID(Header_FileProperties, 8CABDCA1, A947, 11CF, 8EE4, 00C00C205365) UUID(Header_StreamProperties, B7DC0791, A9B7, 11CF, 8EE6, 00C00C205365) UUID(Header_StreamProperties_Audio, F8699E40, 5B4D, 11CF, A8FD, 00805F5C442B) UUID(Header_StreamProperties_Video, BC19EFC0, 5B4D, 11CF, A8FD, 00805F5C442B) UUID(Header_StreamProperties_Command, 59DACFC0, 59E6, 11D0, A3AC, 00A0C90348F6) UUID(Header_StreamProperties_JFIF, B61BE100, 5B4E, 11CF, A8FD, 00805F5C442B) UUID(Header_StreamProperties_DegradableJPEG, 35907DE0, E415, 11CF, A917, 00805F5C442B) UUID(Header_StreamProperties_FileTransfer, 91BD222C, F21C, 497A, 8B6D, 5AA86BFC0185) UUID(Header_StreamProperties_Binary, 3AFB65E2, 47EF, 40F2, AC2C, 70A90D71D343) UUID(Header_StreamProperties_Binary_WebStreamMediaSubType, 776257D4, C627, 41CB, 8F81, 7AC7FF1C40CC) UUID(Header_StreamProperties_Binary_WebStreamFormat, DA1E6B13, 8359, 4050, B398, 388E965BF00C) UUID(Header_HeaderExtension, 5FBF03B5, A92E, 11CF, 8EE3, 00C00C205365) UUID(Header_HeaderExtension_ExtendedStreamProperties, 14E6A5CB, C672, 4332, 8399, A96952065B5A) UUID(Header_HeaderExtension_AdvancedMutualExclusion, A08649CF, 4775, 4670, 8A16, 6E35357566CD) UUID(Header_HeaderExtension_GroupMutualExclusion, D1465A40, 5A79, 4338, B71B, E36B8FD6C249) UUID(Header_HeaderExtension_StreamPrioritization, D4FED15B, 88D3, 454F, 81F0, ED5C45999E24) UUID(Header_HeaderExtension_BandwidthSharing, A69609E6, 517B, 11D2, B6AF, 00C04FD908E9) UUID(Header_HeaderExtension_LanguageList, 7C4346A9, EFE0, 4BFC, B229, 393EDE415C85) UUID(Header_HeaderExtension_Metadata, C5F8CBEA, 5BAF, 4877, 8467, AA8C44FA4CCA) UUID(Header_HeaderExtension_MetadataLibrary, 44231C94, 9498, 49D1, A141, 1D134E457054) UUID(Header_HeaderExtension_IndexParameters, D6E229DF, 35DA, 11D1, 9034, 00A0C90349BE) UUID(Header_HeaderExtension_MediaIndexParameters, 6B203BAD, 3F11, 48E4, ACA8, D7613DE2CFA7) UUID(Header_HeaderExtension_TimecodeIndexParameters, F55E496D, 9797, 4B5D, 8C8B, 604DFE9BFB24) UUID(Header_HeaderExtension_Compatibility, 26F18B5D, 4584, 47EC, 9F5F, 0E651F0452C9) UUID(Header_HeaderExtension_AdvancedContentEncryption, 43058533, 6981, 49E6, 9B74, AD12CB86D58C) UUID(Header_HeaderExtension_IndexPlaceholder, D9AADE20, 7C17, 4F9C, BC28, 8555DD98E2A2) UUID(Header_CodecList, 86D15240, 311D, 11D0, A3A4, 00ACC90348F6) UUID(Header_ScriptCommand, 1EFB1A30, 0B62, 11D0, A39B, 00A0C90348F6) UUID(Header_Marker, F487CD01, A951, 11CF, 8EE6, 00C00C205365) UUID(Header_BitRateMutualExclusion, D6E229DC, 35DA, 11D1, 9034, 00A0C90349BE) UUID(Header_ErrorCorrection, 75B22635, 668E, 11CF, A6D9, 00AA0062CE6C) UUID(Header_ContentDescription, 75B22633, 668E, 11CF, A6D9, 00AA0062CE6C) UUID(Header_ExtendedContentDescription, D2D0A440, E307, 11D2, 97F0, 00A0C95EA850) UUID(Header_StreamBitRate, 7BF875CE, 468D, 11D1, 8D82, 006097C9A2B2) UUID(Header_ContentBranding, 2211B3FA, BD23, 11D2, B4B7, 00A0C955FC6E) UUID(Header_ContentEncryption, 2211B3FB, BD23, 11D2, B4B7, 00A0C955FC6E) UUID(Header_ExtendedContentEncryption, 298AE614, 2622, 4C17, B935, DAE07EE9289C) UUID(Header_DigitalSignature, 2211B3FC, BD23, 11D2, B4B7, 00A0C955FC6E) UUID(Header_Padding, 1806D474, CADF, 4509, A4BA, 9AABCB96AAE8) UUID(Data, 75B22636, 668E, 11CF, A6D9, 00AA0062CE6C) UUID(SimpleIndex, 33000890, E5B1, 11CF, 89F4, 00A0C90349CB) UUID(Index, D6E229D3, 35DA, 11D1, 9034, 00A0C90349BE) UUID(MediaIndex, FEB103F8, 12AD, 4C64, 840F, 2A1D2F7AD48C) UUID(TimecodeIndex, 3CB73FD0, 0C4A, 4803, 953D, EDF7B6228F0C) UUID(Payload_Extension_System_TimeStamp, 1135BEB7, 3A39, 478A, 98D9, 15C76B00EB69); UUID(Mutex_Language, D6E22A00, 35DA, 11D1, 9034, 00A0C90349BE); UUID(Mutex_Bitrate, D6E22A01, 35DA, 11D1, 9034, 00A0C90349BE); } const char* Wm_StreamType(const int128u Kind) { switch (Kind.hi) { case Elements::Header_StreamProperties_Audio : return "Audio"; case Elements::Header_StreamProperties_Video : return "Video"; case Elements::Header_StreamProperties_Command : return "Command"; case Elements::Header_StreamProperties_JFIF : return "JFIF"; case Elements::Header_StreamProperties_DegradableJPEG : return "Degradable JPEG"; case Elements::Header_StreamProperties_FileTransfer : return "File Transfer"; case Elements::Header_StreamProperties_Binary : return "Binary"; default : return "Unknown"; } } const char* Wm_ExclusionType(const int128u ExclusionType) { switch (ExclusionType.hi) { case Elements::Header_StreamProperties_Audio : return "Language"; case Elements::Header_StreamProperties_Video : return "Bitrate"; default : return "Unknown"; } } //*************************************************************************** // Format //*************************************************************************** //--------------------------------------------------------------------------- // Element parse // void File_Wm::Data_Parse() { //Parsing DATA_BEGIN LIST(Header) ATOM_BEGIN ATOM(Header_FileProperties) ATOM(Header_StreamProperties) LIST(Header_HeaderExtension) ATOM_BEGIN ATOM(Header_HeaderExtension_ExtendedStreamProperties) ATOM(Header_HeaderExtension_AdvancedMutualExclusion) ATOM(Header_HeaderExtension_GroupMutualExclusion) ATOM(Header_HeaderExtension_StreamPrioritization) ATOM(Header_HeaderExtension_BandwidthSharing) ATOM(Header_HeaderExtension_LanguageList) ATOM(Header_HeaderExtension_Metadata) ATOM(Header_HeaderExtension_MetadataLibrary) ATOM(Header_HeaderExtension_IndexParameters) ATOM(Header_HeaderExtension_MediaIndexParameters) ATOM(Header_HeaderExtension_TimecodeIndexParameters) ATOM(Header_HeaderExtension_Compatibility) ATOM(Header_HeaderExtension_AdvancedContentEncryption) ATOM(Header_HeaderExtension_IndexPlaceholder) ATOM(Header_Padding) ATOM_END ATOM(Header_CodecList) ATOM(Header_ScriptCommand) ATOM(Header_Marker) ATOM(Header_BitRateMutualExclusion) ATOM(Header_ErrorCorrection) ATOM(Header_ContentDescription) ATOM(Header_ExtendedContentDescription) ATOM(Header_StreamBitRate) ATOM(Header_ContentBranding) ATOM(Header_ContentEncryption) ATOM(Header_ExtendedContentEncryption) ATOM(Header_DigitalSignature) ATOM(Header_Padding) ATOM_END LIST(Data) ATOM_DEFAULT_ALONE(Data_Packet) LIST_SKIP(SimpleIndex) LIST_SKIP(Index) ATOM(MediaIndex) ATOM(TimecodeIndex) DATA_END } //*************************************************************************** // Elements //*************************************************************************** //--------------------------------------------------------------------------- void File_Wm::Header() { Data_Accept("Windows Media"); Element_Name("Header"); //Parsing Skip_L4( "Number of Header Objects"); Skip_L1( "Alignment"); Skip_L1( "Architecture"); FILLING_BEGIN(); Fill(Stream_General, 0, General_Format, "Windows Media"); Header_StreamProperties_StreamOrder=0; FILLING_END(); } //--------------------------------------------------------------------------- void File_Wm::Header_FileProperties() { Element_Name("File Properties"); //Parsing int64u CreationDate, PlayDuration, SendDuration, Preroll; int32u Flags, MaximumBitRate; Skip_GUID( "File ID"); Skip_L8( "File Size"); Get_L8 (CreationDate, "Creation Date"); Param_Info1(Ztring().Date_From_Milliseconds_1601(CreationDate/10000)); Skip_L8( "Data Packets Count"); Get_L8 (PlayDuration, "Play Duration"); Param_Info_From_Milliseconds(PlayDuration/10000); Get_L8 (SendDuration, "Send Duration"); Param_Info_From_Milliseconds(SendDuration/10000); Get_L8 (Preroll, "Preroll"); Param_Info_From_Milliseconds(Preroll); Get_L4 (Flags, "Flags"); Skip_Flags(Flags, 0, "Broadcast"); Skip_Flags(Flags, 1, "Seekable"); Skip_Flags(Flags, 2, "Use Packet Template"); Skip_Flags(Flags, 3, "Live"); Skip_Flags(Flags, 4, "Recordable"); Skip_Flags(Flags, 5, "Unknown Data Size"); Skip_L4( "Minimum Data Packet Size"); Get_L4 (MaximumDataPacketSize, "Maximum Data Packet Size"); Get_L4 (MaximumBitRate, "Maximum Bitrate"); //Filling if (MaximumBitRate) Fill(Stream_General, 0, General_OverallBitRate_Maximum, MaximumBitRate); Fill(Stream_General, 0, General_Encoded_Date, Ztring().Date_From_Milliseconds_1601(CreationDate/10000)); if (PlayDuration/1000>Preroll) Fill(Stream_General, 0, General_Duration, PlayDuration/10000-Preroll); FileProperties_Preroll=(int32u)(Preroll); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties () { Element_Name("Stream Properties"); //Parsing int128u StreamType; int32u StreamTypeLength, ErrorCorrectionTypeLength; Get_GUID(StreamType, "StreamType"); Param_Info1(Wm_StreamType(StreamType)); Element_Info1(Wm_StreamType(StreamType)); Skip_GUID( "Error Correction Type"); Skip_L8( "Time Offset"); Get_L4 (StreamTypeLength, "Type-Specific Data Length"); Get_L4 (ErrorCorrectionTypeLength, "Error Correction Data Length"); Get_L2 (Stream_Number, "Stream Number"); if (Stream_Number&0x8000) { Param_Info1("Encrypted Content"); Stream[Stream_Number&0x007F].Info["Encryption"]=__T("Encrypted"); } Stream_Number&=0x007F; //Only 7bits Element_Info1(Stream_Number); Skip_L4( "Reserved"); switch (StreamType.hi) { case Elements::Header_StreamProperties_Audio : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_Audio(); Element_End0(); break; case Elements::Header_StreamProperties_Video : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_Video(); Element_End0(); break; case Elements::Header_StreamProperties_JFIF : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_JFIF(); Element_End0(); break; case Elements::Header_StreamProperties_DegradableJPEG : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_DegradableJPEG(); Element_End0(); break; case Elements::Header_StreamProperties_FileTransfer : case Elements::Header_StreamProperties_Binary : Element_Begin0(); //size is StreamTypeLength Header_StreamProperties_Binary(); StreamKind_Last=Stream_Max; StreamPos_Last=(size_t)-1; Element_End0(); break; default : if (StreamTypeLength>0) Skip_XX(StreamTypeLength, "Type-Specific Data"); StreamKind_Last=Stream_Max; StreamPos_Last=(size_t)-1; } if (ErrorCorrectionTypeLength) Skip_XX(ErrorCorrectionTypeLength, "Error Correction Data"); //Filling Stream[Stream_Number].StreamKind=StreamKind_Last; Stream[Stream_Number].StreamPos=StreamPos_Last; Stream[Stream_Number].Info["ID"].From_Number(Stream_Number); Stream[Stream_Number].Info["StreamOrder"].From_Number(Header_StreamProperties_StreamOrder); Header_StreamProperties_StreamOrder++; } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Audio () { Element_Name("Audio"); //Parsing int32u SamplingRate, BytesPerSec; int16u CodecID, Channels, Data_Size, Resolution; Get_L2 (CodecID, "Codec ID"); Get_L2 (Channels, "Number of Channels"); Get_L4 (SamplingRate, "Samples Per Second"); Get_L4 (BytesPerSec, "Average Number of Bytes Per Second"); Skip_L2( "Block Alignment"); Get_L2 (Resolution, "Bits / Sample"); Get_L2 (Data_Size, "Codec Specific Data Size"); //Filling Stream_Prepare(Stream_Audio); Stream[Stream_Number].IsCreated=true; Ztring Codec; Codec.From_Number(CodecID, 16); Codec.MakeUpperCase(); CodecID_Fill(Codec, Stream_Audio, StreamPos_Last, InfoCodecID_Format_Riff); Fill(Stream_Audio, StreamPos_Last, Audio_Codec, Codec); //May be replaced by codec parser Fill(Stream_Audio, StreamPos_Last, Audio_Codec_CC, Codec); Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, Channels); Fill(Stream_Audio, StreamPos_Last, Audio_SamplingRate, SamplingRate); Fill(Stream_Audio, StreamPos_Last, Audio_BitRate, BytesPerSec*8); Fill(Stream_Audio, StreamPos_Last, Audio_BitDepth, Resolution); FILLING_BEGIN(); //Creating the parser if (0); #if defined(MEDIAINFO_MPEGA_YES) else if (MediaInfoLib::Config.CodecID_Get(Stream_Audio, InfoCodecID_Format_Riff, Ztring::ToZtring(CodecID, 16))==__T("MPEG Audio")) { Stream[Stream_Number].Parser=new File_Mpega; ((File_Mpega*)Stream[Stream_Number].Parser)->Frame_Count_Valid=8; Stream[Stream_Number].Parser->ShouldContinueParsing=true; } #endif Open_Buffer_Init(Stream[Stream_Number].Parser); FILLING_END(); //Parsing if (Data_Size>0) { Element_Begin1("Codec Specific Data"); switch (CodecID) { case 0x0161 : case 0x0162 : case 0x0163 : Header_StreamProperties_Audio_WMA(); break; case 0x7A21 : case 0x7A22 : Header_StreamProperties_Audio_AMR(); break; default : Skip_XX(Data_Size, "Unknown"); } Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Audio_WMA () { Element_Info1("WMA"); //Demux #if MEDIAINFO_DEMUX switch (Config->Demux_InitData_Get()) { case 0 : //In demux event Demux_Level=2; //Container Demux(Buffer+Buffer_Offset, (size_t)Element_Size, ContentType_Header); break; case 1 : //In field { std::string Data_Raw((const char*)(Buffer+Buffer_Offset+Element_Offset), (size_t)10);//Element_Size-(Element_Offset)); std::string Data_Base64(Base64::encode(Data_Raw)); Fill(Stream_Audio, StreamPos_Last, "Demux_InitBytes", Data_Base64); } break; default : ; } #endif //MEDIAINFO_DEMUX //Parsing Skip_L4( "SamplesPerBlock"); Skip_L2( "EncodeOptions"); Skip_L4( "SuperBlockAlign"); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Audio_AMR () { Element_Info1("AMR"); //Parsing int32u Flags; bool VBR; Get_L4 (Flags, "Flags"); Skip_Flags(Flags, 0, "SID is used"); Get_Flags (Flags, 1, VBR, "Varying bitrate"); //Filling Fill(Stream_Audio, StreamPos_Last, Audio_BitRate_Mode, VBR?"VBR":"CBR"); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Video () { Element_Name("Video"); //Parsing int32u Width, Height, Compression; int16u Data_Size, Resolution; Get_L4 (Width, "Width"); Get_L4 (Height, "Height"); Skip_L1( "Flags"); Get_L2 (Data_Size, "Format Data Size"); Skip_L4( "Size"); Get_L4 (Width, "Width"); Get_L4 (Height, "Height"); Skip_L2( "Planes"); Get_L2 (Resolution, "BitCount"); Get_C4 (Compression, "Compression"); Skip_L4( "SizeImage"); Skip_L4( "XPelsPerMeter"); Skip_L4( "YPelsPerMeter"); Skip_L4( "ClrUsed"); Skip_L4( "ClrImportant"); //Filling Stream_Prepare(Stream_Video); Stream[Stream_Number].IsCreated=true; CodecID_Fill(Ztring().From_CC4(Compression), Stream_Video, StreamPos_Last, InfoCodecID_Format_Riff); Fill(Stream_Video, StreamPos_Last, Video_Codec, Ztring().From_CC4(Compression)); //May be replaced by codec parser Fill(Stream_Video, StreamPos_Last, Video_Codec_CC, Ztring().From_CC4(Compression)); Fill(Stream_Video, StreamPos_Last, Video_Width, Width); Fill(Stream_Video, StreamPos_Last, Video_Height, Height); if (Resolution>0) Fill(Stream_Video, StreamPos_Last, Video_BitDepth, (Resolution%3)?Resolution:(Resolution/3)); //If not a multiple of 3, the total resolution is filled if (Compression==CC4("DVR ")) IsDvrMs=true; //From Content description (we imagine that data is for all video streams...) if (Header_ExtendedContentDescription_AspectRatioX && Header_ExtendedContentDescription_AspectRatioY) { if (Header_ExtendedContentDescription_AspectRatioX==16 && Header_ExtendedContentDescription_AspectRatioY==9) Fill(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio, ((float32)16)/9, 3); else if (Header_ExtendedContentDescription_AspectRatioX==4 && Header_ExtendedContentDescription_AspectRatioY==3) Fill(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio, ((float32)4)/3, 3); else Fill(Stream_Video, StreamPos_Last, Video_PixelAspectRatio, ((float32)Header_ExtendedContentDescription_AspectRatioX)/Header_ExtendedContentDescription_AspectRatioY, 3, true); } //Creating the parser if (0); #if defined(MEDIAINFO_VC1_YES) else if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Riff, Ztring().From_CC4(Compression), InfoCodecID_Format)==__T("VC-1")) { Stream[Stream_Number].Parser=new File_Vc1; if (Compression==CC4("WMV3")) { ((File_Vc1*)Stream[Stream_Number].Parser)->From_WMV3=true; ((File_Vc1*)Stream[Stream_Number].Parser)->MustSynchronize=false; } ((File_Vc1*)Stream[Stream_Number].Parser)->FrameIsAlwaysComplete=true; //Warning: this is not always the case, see data parsing Open_Buffer_Init(Stream[Stream_Number].Parser); if (Data_Size>40) { //Demux #if MEDIAINFO_DEMUX switch (Config->Demux_InitData_Get()) { case 0 : //In demux event Element_Code=Stream_Number; Demux_Level=2; //Container Demux(Buffer+(size_t)Element_Offset, (size_t)(Data_Size-40), ContentType_Header); break; case 1 : //In field { std::string Data_Raw((const char*)(Buffer+(size_t)Element_Offset), (size_t)(Data_Size-40)); std::string Data_Base64(Base64::encode(Data_Raw)); Fill(Stream_Video, StreamPos_Last, "Demux_InitBytes", Data_Base64); } break; default : ; } #endif //MEDIAINFO_DEMUX Open_Buffer_Continue(Stream[Stream_Number].Parser, (size_t)(Data_Size-40)); if (Stream[Stream_Number].Parser->Status[IsFinished]) { Finish(Stream[Stream_Number].Parser); Merge(*Stream[Stream_Number].Parser, Stream_Video, 0, StreamPos_Last); delete Stream[Stream_Number].Parser; Stream[Stream_Number].Parser=NULL; } else { ((File_Vc1*)Stream[Stream_Number].Parser)->Only_0D=true; ((File_Vc1*)Stream[Stream_Number].Parser)->MustSynchronize=false; } } } #endif #if defined(MEDIAINFO_MPEGV_YES) else if (MediaInfoLib::Config.Codec_Get(Ztring().From_CC4(Compression), InfoCodec_KindofCodec).find(__T("MPEG-2"))==0) { Stream[Stream_Number].Parser=new File_Mpegv; ((File_Mpegv*)Stream[Stream_Number].Parser)->Frame_Count_Valid=30; //For searching Pulldown Open_Buffer_Init(Stream[Stream_Number].Parser); } #endif else if (Data_Size>40) //TODO: see "The Mummy_e" Skip_XX(Data_Size-40, "Codec Specific Data"); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_JFIF () { Element_Name("JFIF"); //Parsing int32u Width, Height; Get_L4 (Width, "Width"); Get_L4 (Height, "Height"); Skip_L4( "Reserved"); //Filling Stream_Prepare(Stream_Image); Fill(Stream_Video, StreamPos_Last, Video_Format, "JPEG"); Fill(Stream_Video, StreamPos_Last, Video_Codec, "JPEG"); Fill(Stream_Video, StreamPos_Last, Video_Width, Width); Fill(Stream_Video, StreamPos_Last, Video_Height, Height); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_DegradableJPEG () { Element_Name("Degradable JPEG"); int32u Width, Height; int16u InterchangeDataLength; Get_L4 (Width, "Width"); Get_L4 (Height, "Height"); Skip_L2( "Reserved"); Skip_L2( "Reserved"); Skip_L2( "Reserved"); Get_L2 (InterchangeDataLength, "Interchange data length"); if (InterchangeDataLength>0) Skip_XX(InterchangeDataLength, "Interchange data"); else Skip_L1( "Zero"); //Filling Stream_Prepare(Stream_Image); Fill(Stream_Video, StreamPos_Last, Video_Format, "JPEG"); Fill(Stream_Video, StreamPos_Last, Video_Codec, "JPEG"); Fill(Stream_Video, StreamPos_Last, Video_Width, Width); Fill(Stream_Video, StreamPos_Last, Video_Height, Height); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamProperties_Binary () { Element_Name("Binary"); //Parsing int32u FormatDataLength; Skip_GUID( "Major media type"); Skip_GUID( "Media subtype"); Skip_L4( "Fixed-size samples"); Skip_L4( "Temporal compression"); Skip_L4( "Sample size"); Skip_GUID( "Format type"); Get_L4 (FormatDataLength, "Format data size"); if (FormatDataLength>0) Skip_XX(FormatDataLength, "Format data"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension() { Element_Name("Header Extension"); //Parsing int32u Size; Skip_GUID( "ClockType"); Skip_L2( "ClockSize"); Get_L4 (Size, "Extension Data Size"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_ExtendedStreamProperties() { Element_Name("Extended Stream Properties"); //Parsing int64u AverageTimePerFrame; int32u DataBitrate, Flags; int16u StreamNumber, LanguageID, StreamNameCount, PayloadExtensionSystemCount; Info_L8(StartTime, "Start Time"); Param_Info_From_Milliseconds(StartTime); Info_L8(EndTime, "End Time"); Param_Info_From_Milliseconds(EndTime); Get_L4 (DataBitrate, "Data Bitrate"); Skip_L4( "Buffer Size"); Skip_L4( "Initial Buffer Fullness"); Skip_L4( "Alternate Data Bitrate"); Skip_L4( "Alternate Buffer Size"); Skip_L4( "Alternate Initial Buffer Fullness"); Skip_L4( "Maximum Object Size"); Get_L4 (Flags, "Flags"); Skip_Flags(Flags, 0, "Reliable"); Skip_Flags(Flags, 1, "Seekable"); Skip_Flags(Flags, 2, "No Cleanpoints"); Skip_Flags(Flags, 3, "Resend Live Cleanpoints"); Get_L2 (StreamNumber, "Stream Number"); Element_Info1(StreamNumber); Get_L2 (LanguageID, "Stream Language ID Index"); Get_L8 (AverageTimePerFrame, "Average Time Per Frame"); Get_L2 (StreamNameCount, "Stream Name Count"); Get_L2 (PayloadExtensionSystemCount, "Payload Extension System Count"); for (int16u Pos=0; Pos<StreamNameCount; Pos++) { Element_Begin1("Stream Name"); int16u StreamNameLength; Skip_L2( "Language ID Index"); Get_L2 (StreamNameLength, "Stream Name Length"); Skip_UTF16L(StreamNameLength, "Stream Name"); Element_End0(); } for (int16u Pos=0; Pos<PayloadExtensionSystemCount; Pos++) { Element_Begin1("Payload Extension System"); stream::payload_extension_system Payload_Extension_System; int32u ExtensionSystemInfoLength; Get_GUID(Payload_Extension_System.ID, "Extension System ID"); Get_L2 (Payload_Extension_System.Size, "Extension Data Size"); Get_L4 (ExtensionSystemInfoLength, "Extension System Info Length"); if (ExtensionSystemInfoLength>0) Skip_XX(ExtensionSystemInfoLength, "Extension System Info"); Element_End0(); //Filling Stream[StreamNumber].Payload_Extension_Systems.push_back(Payload_Extension_System); } //Header_StreamProperties if (Element_Offset<Element_Size) { //This could be everything, but in theory this is only Header_StreamProperties int128u Name; int64u Size; Element_Begin1("Stream Properties Object"); Element_Begin1("Header"); Get_GUID(Name, "Name"); Get_L8 (Size, "Size"); Element_End0(); if (Size>=24 && Element_Offset+Size-24==Element_Size) { switch (Name.hi) { case Elements::Header_StreamProperties : Header_StreamProperties(); break; default : Skip_XX(Size-24, "Unknown"); } } else Skip_XX(Element_Size-Element_Offset, "Problem"); Element_End0(); } //Filling Stream[StreamNumber].LanguageID=LanguageID; Stream[StreamNumber].AverageBitRate=DataBitrate; Stream[StreamNumber].AverageTimePerFrame=AverageTimePerFrame; } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_AdvancedMutualExclusion() { Element_Name("Advanced Mutual Exclusion"); //Parsing int16u Count; Info_GUID(ExclusionType, "Exclusion Type"); Param_Info1(Wm_ExclusionType(ExclusionType)); Get_L2 (Count, "Stream Numbers Count"); for (int16u Pos=0; Pos<Count; Pos++) { Info_L2(StreamNumber, "Stream Number"); Element_Info1(StreamNumber); } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_GroupMutualExclusion() { Element_Name("Group Mutual Exclusion"); //Parsing Skip_XX(Element_Size, "Unknown"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_StreamPrioritization() { Element_Name("Stream Prioritization"); //Parsing int16u Count; Get_L2 (Count, "Stream Numbers Count"); for (int16u Pos=0; Pos<Count; Pos++) { int16u Flags; Element_Begin1("Stream"); Info_L2(StreamNumber, "Stream Number"); Element_Info1(StreamNumber); Get_L2 (Flags, "Flags"); Skip_Flags(Flags, 0, "Mandatory"); Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_BandwidthSharing() { Element_Name("Bandwidth Sharing"); //Parsing Skip_XX(Element_Size, "Unknown"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_LanguageList() { Element_Name("Language List"); //Parsing Ztring LanguageID; int16u Count; int8u LanguageID_Length; Get_L2 (Count, "Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Language ID"); Get_L1 (LanguageID_Length, "Language ID Length"); if (LanguageID_Length>0) { Get_UTF16L(LanguageID_Length, LanguageID, "Language ID"); Element_Info1(LanguageID); } Element_End0(); //Filling Languages.push_back(LanguageID); } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_MetadataLibrary() { Element_Name("Metadata Library"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_Metadata() { Element_Name("Metadata"); //Parsing float32 AspectRatioX=0, AspectRatioY=0; int16u Count; Get_L2 (Count, "Description Records Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Description Record"); Ztring Name, Data; int64u Data_Int64=0; int32u Data_Length; int16u StreamNumber, Name_Length, Data_Type; Skip_L2( "Reserved"); Get_L2 (StreamNumber, "Stream Number"); Get_L2 (Name_Length, "Name Length"); Get_L2 (Data_Type, "Data Type"); Get_L4 (Data_Length, "Data Length"); Get_UTF16L(Name_Length, Name, "Name Length"); switch (Data_Type) { case 0x00 : Get_UTF16L(Data_Length, Data, "Data"); break; case 0x01 : Skip_XX(Data_Length, "Data"); Data=__T("(Binary)"); break; case 0x02 : {int16u Data_Int; Get_L2 (Data_Int, "Data"); Data=(Data_Int==0)?__T("No"):__T("Yes"); Data_Int64=Data_Int;} break; case 0x03 : {int32u Data_Int; Get_L4 (Data_Int, "Data"); Data.From_Number(Data_Int); Data_Int64=Data_Int;} break; case 0x04 : {int64u Data_Int; Get_L8 (Data_Int, "Data"); Data.From_Number(Data_Int); Data_Int64=Data_Int;} break; case 0x05 : {int16u Data_Int; Get_L2 (Data_Int, "Data"); Data.From_Number(Data_Int); Data_Int64=Data_Int;} break; default : Skip_XX(Data_Length, "Data"); Data=__T("(Unknown)"); break; } Element_Info1(Name); Element_Info1(Data); Element_End0(); if (Name==__T("IsVBR")) Stream[StreamNumber].Info["BitRate_Mode"]=(Data_Int64==0)?"CBR":"VBR"; else if (Name==__T("AspectRatioX")) { AspectRatioX=Data.To_float32(); if (AspectRatioX && AspectRatioY) Stream[StreamNumber].Info["PixelAspectRatio"].From_Number(AspectRatioX/AspectRatioY, 3); } else if (Name==__T("AspectRatioY")) { AspectRatioY=Data.To_float32(); if (AspectRatioX && AspectRatioY) Stream[StreamNumber].Info["PixelAspectRatio"].From_Number(AspectRatioX/AspectRatioY, 3); } else if (Name==__T("DeviceConformanceTemplate")) { if (Data!=__T("@") && Data.find(__T('@'))!=std::string::npos) Stream[StreamNumber].Info["Format_Profile"]=Data; } else if (Name==__T("WM/WMADRCPeakReference")) {} else if (Name==__T("WM/WMADRCAverageReference")) {} else if (Name==__T("WM/WMADRCAverageTarget")) {} else if (Name==__T("WM/WMADRCPeakTarget")) {} else Stream[StreamNumber].Info[Name.To_Local()]=Data; } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_IndexParameters() { Element_Name("Index Parameters"); //Parsing int16u Count; Skip_L4( "Index Entry Time Interval"); Get_L2 (Count, "Index Specifiers Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Index Specifier"); int16u IndexType; Skip_L2( "Stream Number"); Get_L2 (IndexType, "Index Type"); Element_Info1(IndexType); Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_MediaIndexParameters() { Element_Name("MediaIndex Parameters"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_TimecodeIndexParameters() { Element_Name("Timecode Index Parameters"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_Compatibility() { Element_Name("Compatibility"); //Parsing Skip_L1( "Profile"); Skip_L1( "Mode"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_AdvancedContentEncryption() { Element_Name("Advanced Content Encryption"); } //--------------------------------------------------------------------------- void File_Wm::Header_HeaderExtension_IndexPlaceholder() { Element_Name("Index Placeholder"); } //--------------------------------------------------------------------------- void File_Wm::Header_CodecList() { Element_Name("Codec List"); //Parsing Ztring CodecName, CodecDescription; int32u Count32; int16u Count, Type, CodecNameLength, CodecDescriptionLength, CodecInformationLength; Skip_GUID( "Reserved"); Get_L4 (Count32, "Codec Entries Count"); Count=(int16u)Count32; CodecInfos.resize(Count); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Codec Entry"); Get_L2 (Type, "Type"); Param_Info1(Wm_CodecList_Kind(Type)); Get_L2 (CodecNameLength, "Codec Name Length"); Get_UTF16L(CodecNameLength*2, CodecName, "Codec Name"); Get_L2 (CodecDescriptionLength, "Codec Description Length"); Get_UTF16L(CodecDescriptionLength*2, CodecDescription, "Codec Description"); Get_L2 (CodecInformationLength, "Codec Information Length"); if (Type==2 && CodecInformationLength==2) //Audio and 2CC Skip_L2( "2CC"); //Not used, we have it elsewhere else if (Type==1 && CodecInformationLength==4) //Video and 4CC Skip_C4( "4CC"); //Not used, we have it elsewhere else Skip_XX(CodecInformationLength, "Codec Information"); Element_End0(); FILLING_BEGIN(); CodecInfos[Pos].Type=Type; CodecInfos[Pos].Info=CodecName; if (!CodecDescription.empty()) { CodecInfos[Pos].Info+=__T(" - "); CodecInfos[Pos].Info+=CodecDescription; } Codec_Description_Count++; FILLING_END(); } } //--------------------------------------------------------------------------- void File_Wm::Header_ScriptCommand() { Element_Name("Script Command"); //Parsing Skip_GUID( "Reserved"); int16u Commands_Count, CommandTypes_Count; Get_L2 (Commands_Count, "Commands Count"); Get_L2 (CommandTypes_Count, "Command Types Count"); for (int16u Pos=0; Pos<CommandTypes_Count; Pos++) { Element_Begin1("Command Type"); int16u Length; Get_L2 (Length, "Command Type Length"); if (Length>0) Skip_UTF16L(Length*2, "Command Type"); Element_End0(); } for (int16u Pos=0; Pos<Commands_Count; Pos++) { Element_Begin1("Command"); int16u Length; Skip_L2( "Type Index"); Get_L2 (Length, "Command Length"); if (Length>0) Skip_UTF16L(Length*2, "Command"); Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_Marker() { Element_Name("Markers"); //Parsing Skip_GUID( "Reserved"); int32u Markers_Count; int16u Name_Length; Get_L4 (Markers_Count, "Markers Count"); Skip_L2( "Reserved"); Get_L2 (Name_Length, "Name Length"); if (Name_Length>0) Skip_UTF16L(Name_Length, "Name"); //Filling if (Markers_Count>0) Stream_Prepare(Stream_Menu); //Parsing for (int32u Pos=0; Pos<Markers_Count; Pos++) { Element_Begin1("Marker"); Ztring Marker; int32u Marker_Length; Skip_L8( "Offset"); Info_L8(PresentationTime, "Presentation Time"); Param_Info_From_Milliseconds(PresentationTime/10000); Skip_L2( "Entry Length"); Info_L4(SendTime, "Send Time"); Param_Info_From_Milliseconds(SendTime); Skip_L4( "Flags"); Get_L4 (Marker_Length, "Marker Description Length"); if (Marker_Length>0) Get_UTF16L(Marker_Length*2, Marker, "Marker Description"); Element_End0(); } } //--------------------------------------------------------------------------- void File_Wm::Header_BitRateMutualExclusion() { Element_Name("BitRate Mutual Exclusion"); //Parsing int16u Count; Skip_GUID( "Exclusion Type"); Get_L2 (Count, "Stream Numbers Count"); for (int16u Pos=0; Pos<Count; Pos++) Skip_L2( "Stream Number"); } //--------------------------------------------------------------------------- void File_Wm::Header_ErrorCorrection() { Element_Name("Error Correction"); } //--------------------------------------------------------------------------- void File_Wm::Header_ContentDescription() { Element_Name("Content Description"); //Parsing Ztring Title, Author, Copyright, Description, Rating; int16u TitleLength, AuthorLength, CopyrightLength, DescriptionLength, RatingLength; Get_L2 (TitleLength, "TitleLength"); Get_L2 (AuthorLength, "AuthorLength"); Get_L2 (CopyrightLength, "CopyrightLength"); Get_L2 (DescriptionLength, "DescriptionLength"); Get_L2 (RatingLength, "RatingLength"); if (TitleLength>0) Get_UTF16L(TitleLength, Title, "Title"); if (AuthorLength>0) Get_UTF16L(AuthorLength, Author, "Author"); if (CopyrightLength>0) Get_UTF16L(CopyrightLength, Copyright, "Copyright"); if (DescriptionLength>0) Get_UTF16L(DescriptionLength, Description, "Description"); if (RatingLength>0) Get_UTF16L(RatingLength, Rating, "Rating"); //Filling Fill(Stream_General, 0, General_Title, Title); Fill(Stream_General, 0, General_Performer, Author); Fill(Stream_General, 0, General_Copyright, Copyright); Fill(Stream_General, 0, General_Comment, Description); Fill(Stream_General, 0, General_Rating, Rating); } //--------------------------------------------------------------------------- void File_Wm::Header_ExtendedContentDescription() { Element_Name("Extended Content Description"); //Parsing int16u Count; Get_L2 (Count, "Content Descriptors Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Content Descriptor"); Ztring Name, Value; int64u Value_Int64=0; int16u Name_Length, Value_Type, Value_Length; Get_L2 (Name_Length, "Name Length"); Get_UTF16L(Name_Length, Name, "Name"); Get_L2 (Value_Type, "Value Data Type"); Get_L2 (Value_Length, "Value Length"); switch (Value_Type) { case 0x00 : Get_UTF16L(Value_Length, Value, "Value"); break; case 0x01 : if (Name==__T("ASFLeakyBucketPairs")) Header_ExtendedContentDescription_ASFLeakyBucketPairs(Value_Length); else {Skip_XX(Value_Length, "Value"); Value=__T("(Binary)");} break; case 0x02 : {int32u Value_Int; Get_L4 (Value_Int, "Value"); Value=(Value_Int==0)?__T("No"):__T("Yes"); Value_Int64=Value_Int;} break; case 0x03 : {int32u Value_Int; Get_L4 (Value_Int, "Value"); Value.From_Number(Value_Int); Value_Int64=Value_Int;} break; case 0x04 : {int64u Value_Int; Get_L8 (Value_Int, "Value"); Value.From_Number(Value_Int); Value_Int64=Value_Int;} break; case 0x05 : {int16u Value_Int; Get_L2 (Value_Int, "Value"); Value.From_Number(Value_Int); Value_Int64=Value_Int;} break; default : Skip_XX(Value_Length, "Value"); Value=__T("(Unknown)"); break; } Element_Info1(Name); Element_Info1(Value); Element_End0(); //Filling if (!Value.empty()) { if (Name==__T("Agility FPS")) {} else if (Name==__T("ASFLeakyBucketPairs")) {} //Already done elsewhere else if (Name==__T("AspectRatioX")) Header_ExtendedContentDescription_AspectRatioX=Value_Int64; else if (Name==__T("AspectRatioY")) Header_ExtendedContentDescription_AspectRatioY=Value_Int64; else if (Name==__T("Buffer Average")) {} else if (Name==__T("DVR Index Granularity")) {} else if (Name==__T("DVR File Version")) {} else if (Name==__T("IsVBR")) Fill(Stream_General, 0, General_OverallBitRate_Mode, Value_Int64==0?"CBR":"VBR"); else if (Name==__T("VBR Peak")) {} //Already in "Stream Bitrate" chunk else if (Name==__T("WMFSDKVersion")) {} else if (Name==__T("WMFSDKNeeded")) {} else if (Name==__T("WM/AlbumTitle")) Fill(Stream_General, 0, General_Album, Value); else if (Name==__T("WM/AlbumArtist")) { Fill(Stream_General, 0, General_Performer, ""); Fill(Stream_General, 0, General_Performer, Value, true); //Clear last value, like Author (Content Description) } else if (Name==__T("WM/ArtistSortOrder")) Fill(Stream_General, 0, General_Performer_Sort, Value); else if (Name==__T("WM/AuthorURL")) Fill(Stream_General, 0, "Author/Url", Value); else if (Name==__T("WM/BeatsPerMinute")) Fill(Stream_General, 0, General_BPM, Value); else if (Name==__T("WM/Binary")) Fill(Stream_General, 0, General_Cover, "Y"); else if (Name==__T("WM/Comments")) Fill(Stream_General, 0, General_Comment, Value, true); //Clear last value else if (Name==__T("WM/Composer")) Fill(Stream_General, 0, General_Composer, Value); else if (Name==__T("WM/Conductor")) Fill(Stream_General, 0, General_Conductor, Value); else if (Name==__T("WM/EncodedBy")) Fill(Stream_General, 0, General_EncodedBy, Value); else if (Name==__T("WM/EncoderSettings")) Fill(Stream_General, 0, General_Encoded_Library_Settings, Value); else if (Name==__T("WM/EncodingTime")) Fill(Stream_General, 0, General_Encoded_Date, Ztring().Date_From_Seconds_1601(Value_Int64)); else if (Name==__T("WM/Genre")) Fill(Stream_General, 0, General_Genre, Value, true); //Clear last value else if (Name==__T("WM/GenreID")) { if (Retrieve(Stream_General, 0, General_Genre).empty()) Fill(Stream_General, 0, General_Genre, Value); } else if (Name==__T("WM/Language")) Language_ForAll=Value; else if (Name==__T("WM/MediaCredits")) Fill(Stream_General, 0, General_ThanksTo, Value); else if (Name==__T("WM/MediaPrimaryClassID")) {} else if (Name==__T("WM/MCDI")) {} else if (Name==__T("WM/ModifiedBy")) Fill(Stream_General, 0, General_RemixedBy, Value); else if (Name==__T("WM/OriginalAlbumTitle")) Fill(Stream_General, 0, "Original/Album", Value); else if (Name==__T("WM/OriginalReleaseTime")) Fill(Stream_General, 0, "Original/Released_Date", Value); else if (Name==__T("WM/ParentalRating")) Fill(Stream_General, 0, General_LawRating, Value); else if (Name==__T("WM/ParentalRatingReason")) Fill(Stream_General, 0, General_LawRating_Reason, Value); else if (Name==__T("WM/Picture")) Fill(Stream_General, 0, General_Cover, "Y"); else if (Name==__T("WM/Provider")) Fill(Stream_General, 0, "Provider", Value); else if (Name==__T("WM/Publisher")) Fill(Stream_General, 0, General_Publisher, Value); else if (Name==__T("WM/RadioStationName")) Fill(Stream_General, 0, General_ServiceName, Value); else if (Name==__T("WM/RadioStationOwner")) Fill(Stream_General, 0, General_ServiceProvider, Value); else if (Name==__T("WM/SubTitle")) Fill(Stream_General, 0, General_Title_More, Value); else if (Name==__T("WM/SubTitleDescription")) Fill(Stream_General, 0, General_Title_More, Value); else if (Name==__T("WM/ToolName")) Fill(Stream_General, 0, General_Encoded_Application, Value); else if (Name==__T("WM/ToolVersion")) Fill(Stream_General, 0, General_Encoded_Application, Retrieve(Stream_General, 0, General_Encoded_Application)+__T(" ")+Value, true); else if (Name==__T("WM/TrackNumber")) Fill(Stream_General, 0, General_Track_Position, Value, true); //Clear last value, like WM/Track else if (Name==__T("WM/Track")) { if (Retrieve(Stream_General, 0, General_Track_Position).empty()) Fill(Stream_General, 0, General_Track_Position, Value.To_int32u()+1); } else if (Name==__T("WM/UniqueFileIdentifier")) { if (Value.empty() || Value[0]!=__T(';')) //Test if there is only the separator { Value.FindAndReplace(__T(";"), MediaInfoLib::Config.TagSeparator_Get()); Fill(Stream_General, 0, General_UniqueID, Value); } } else if (Name==__T("WM/Writer")) Fill(Stream_General, 0, General_WrittenBy, Value); else if (Name==__T("WM/Year")) Fill(Stream_General, 0, General_Recorded_Date, Value); else Fill(Stream_General, 0, Name.To_Local().c_str(), Value); } } } //--------------------------------------------------------------------------- void File_Wm::Header_ExtendedContentDescription_ASFLeakyBucketPairs(int16u Value_Length) { Element_Begin1("ASFLeakyBucketPairs"); Skip_L2( "Reserved"); for (int16u Pos=2; Pos<Value_Length; Pos+=8) { Element_Begin1("Bucket"); Skip_L4( "BitRate"); Skip_L4( "msBufferWindow"); Element_End0(); } Element_End0(); } //--------------------------------------------------------------------------- void File_Wm::Header_StreamBitRate() { Element_Name("Stream Bitrate"); //Parsing int16u Count; Get_L2 (Count, "Count"); for (int16u Pos=0; Pos<Count; Pos++) { Element_Begin1("Stream"); int32u AverageBitRate; int16u StreamNumber; Get_L2 (StreamNumber, "Stream Number"); Element_Info1(StreamNumber); Get_L4 (AverageBitRate, "Average Bitrate"); Element_Info1(AverageBitRate); Element_End0(); //Filling if (Stream[StreamNumber].AverageBitRate==0) //Prefere Average bitrate of Extended Stream Properties if present Stream[StreamNumber].AverageBitRate=AverageBitRate; } } //--------------------------------------------------------------------------- void File_Wm::Header_ContentBranding() { Element_Name("Content Branding"); //Parsing Ztring CopyrightURL, BannerImageURL; int32u BannerImageData_Type, BannerImageData_Length, BannerImageURL_Length, CopyrightURL_Length; Get_L4 (BannerImageData_Type, "Banner Image Data Type"); Param_Info1(Wm_BannerImageData_Type(BannerImageData_Type)); Get_L4 (BannerImageData_Length, "Banner Image Data Length"); if (BannerImageData_Length>0) Skip_XX(BannerImageData_Length, "Banner Image Data"); Get_L4 (BannerImageURL_Length, "Banner Image URL Length"); if (BannerImageURL_Length>0) Get_Local(BannerImageURL_Length, BannerImageURL, "Banner Image URL"); Get_L4 (CopyrightURL_Length, "Copyright URL Length"); if (CopyrightURL_Length>0) Get_Local(CopyrightURL_Length, CopyrightURL, "Copyright URL"); } //--------------------------------------------------------------------------- void File_Wm::Header_ContentEncryption() { Element_Name("Content Encryption"); //Parsing Ztring LicenseURL; int32u SecretDataLength, ProtectionTypeLength, KeyIDLength, LicenseURLLength; Get_L4 (SecretDataLength, "Secret Data Length"); Skip_XX(SecretDataLength, "Secret Data"); Get_L4 (ProtectionTypeLength, "Protection Type Length"); Skip_Local(ProtectionTypeLength, "Protection Type"); Get_L4 (KeyIDLength, "Key ID Length"); Skip_Local(KeyIDLength, "Key ID Type"); Get_L4 (LicenseURLLength, "License URL Length"); Get_Local(LicenseURLLength, LicenseURL, "License URL"); //Filling Fill(Stream_General, 0, "Encryption", LicenseURL); } //--------------------------------------------------------------------------- void File_Wm::Header_ExtendedContentEncryption() { Element_Name("Extended Content Encryption"); //Parsing int32u DataLength; Get_L4 (DataLength, "Data Length"); Skip_XX(DataLength, "Data"); } //--------------------------------------------------------------------------- void File_Wm::Header_DigitalSignature() { Element_Name("Digital Signature"); //Parsing int32u DataLength; Skip_L4( "Signature Type"); Get_L4 (DataLength, "Signature Data Length"); Skip_XX(DataLength, "Signature Data"); } //--------------------------------------------------------------------------- void File_Wm::Header_Padding() { Element_Name("Padding"); //Parsing Skip_XX(Element_Size, "Padding"); } //--------------------------------------------------------------------------- void File_Wm::Data() { Element_Name("Data"); //Parsing Skip_GUID( "File ID"); Skip_L8( "Total Data Packets"); Skip_L1( "Alignment"); Skip_L1( "Packet Alignment"); //Filling Fill(Stream_General, 0, General_HeaderSize, File_Offset+Buffer_Offset-24); Fill(Stream_General, 0, General_DataSize, Element_TotalSize_Get()+24); //For each stream Streams_Count=0; std::map<int16u, stream>::iterator Temp=Stream.begin(); while (Temp!=Stream.end()) { #if defined(MEDIAINFO_MPEGA_YES) if (IsDvrMs && !Temp->second.Parser && Temp->second.AverageBitRate>=32768) { Temp->second.Parser=new File_Mpega; //No stream properties, trying to detect it in datas... ((File_Mpega*)Temp->second.Parser)->Frame_Count_Valid=8; Open_Buffer_Init(Temp->second.Parser); } #endif if (Temp->second.Parser || Temp->second.StreamKind==Stream_Video) //We need Stream_Video for Frame_Rate computing { Temp->second.SearchingPayload=true; Streams_Count++; } ++Temp; } //Enabling the alternative parser MustUseAlternativeParser=true; Data_AfterTheDataChunk=File_Offset+Buffer_Offset+Element_TotalSize_Get(); } //--------------------------------------------------------------------------- void File_Wm::Data_Packet() { //Counting Packet_Count++; Element_Info1(Packet_Count); size_t Element_Show_Count=0; //Parsing int32u PacketLength=0, SizeOfMediaObject=0; int8u Flags, ErrorCorrectionData_Length, ErrorCorrectionLengthType, SequenceType, PaddingLengthType, PacketLengthType; bool ErrorCorrectionPresent; Element_Begin1("Error Correction"); Get_L1 (Flags, "Flags"); Get_FlagsM(Flags&0x0F, ErrorCorrectionData_Length, "Error Correction Data Length"); //4 lowest bits Skip_Flags(Flags, 4, "Opaque Data Present"); Get_FlagsM((Flags>>5)&0x03, ErrorCorrectionLengthType, "Error Correction Length Type"); //bits 6 and 7 Get_Flags (Flags, 7, ErrorCorrectionPresent, "Error Correction Present"); if (ErrorCorrectionPresent && ErrorCorrectionLengthType==0 && ErrorCorrectionData_Length==2) { int8u TypeNumber; Get_L1 (TypeNumber, "Type/Number"); Skip_FlagsM((TypeNumber>>4)&0x0F, "Type"); Skip_FlagsM( TypeNumber &0x0F, "Number"); Skip_L1( "Cycle"); } Element_End0(); Element_Begin1("Payload Parsing Information"); Get_L1 (Flags, "Length Type Flags"); Get_Flags (Flags, 0, MultiplePayloadsPresent, "Multiple Payloads Present"); Get_FlagsM((Flags>>1)&0x3, SequenceType, "Sequence Type"); Get_FlagsM((Flags>>3)&0x3, PaddingLengthType, "Padding Length Type"); Get_FlagsM((Flags>>5)&0x3, PacketLengthType, "Packet Length Type"); Skip_Flags(Flags, 7, "Error Correction Present"); Get_L1 (Flags, "Property Flags"); Get_FlagsM( Flags &0x3, ReplicatedDataLengthType, "Replicated Data Length Type"); Get_FlagsM((Flags>>2)&0x3, OffsetIntoMediaObjectLengthType, "Offset Into Media Object Length Type"); Get_FlagsM((Flags>>4)&0x3, MediaObjectNumberLengthType, "Media Object Number Length Type"); Get_FlagsM((Flags>>6)&0x3, StreamNumberLengthType, "Stream Number Length Type"); switch (PacketLengthType) { case 1 : {int8u Data; Get_L1(Data, "Packet Length"); PacketLength=Data;} break; case 2 : {int16u Data; Get_L2(Data, "Packet Length"); PacketLength=Data;} break; case 3 : Get_L4(PacketLength, "Packet Length"); break; default: ; } switch (SequenceType) { case 1 : Skip_L1( "Sequence"); break; case 2 : Skip_L2( "Sequence"); break; case 3 : Skip_L4( "Sequence"); break; default: ; } switch (PaddingLengthType) { case 1 : {int8u Data; Get_L1(Data, "Padding Length"); Data_Parse_Padding=Data;} break; case 2 : {int16u Data; Get_L2(Data, "Padding Length"); Data_Parse_Padding=Data;} break; case 3 : Get_L4(Data_Parse_Padding, "Padding Length"); break; default: Data_Parse_Padding=0; } Skip_L4( "Send Time"); Skip_L2( "Duration"); Element_End0(); if (MultiplePayloadsPresent) { //Parsing Element_Begin1("Multiple Payloads additional flags"); int8u AdditionalFlags; Get_L1 (AdditionalFlags, "Flags"); Get_FlagsM( AdditionalFlags &0x3F, NumberPayloads, "Number of Payloads"); //6 bits Get_FlagsM((AdditionalFlags>>6)&0x03, PayloadLengthType, "Payload Length Type"); //bits 6 and 7 Element_End0(); } else { SizeOfMediaObject=(int32u)(Element_Size-Element_Offset-Data_Parse_Padding); NumberPayloads=1; } for (NumberPayloads_Pos=0; NumberPayloads_Pos<NumberPayloads; NumberPayloads_Pos++) { Element_Begin1("Payload"); int32u ReplicatedDataLength=0, PayloadLength=0; int8u StreamNumber; Get_L1 (StreamNumber, "Stream Number"); Stream_Number=StreamNumber&0x7F; //For KeyFrame Element_Info1(Stream_Number); switch (MediaObjectNumberLengthType) { case 1 : Skip_L1( "Media Object Number"); break; case 2 : Skip_L2( "Media Object Number"); break; case 3 : Skip_L4( "Media Object Number"); break; default: Trusted_IsNot("Media Object Number"); return; //Problem } switch (OffsetIntoMediaObjectLengthType) { case 1 : Skip_L1( "Offset Into Media Object"); break; case 2 : Skip_L2( "Offset Into Media Object"); break; case 3 : Skip_L4( "Offset Into Media Object"); break; default: Trusted_IsNot("Offset Into Media Object"); return; //Problem } switch (ReplicatedDataLengthType) { case 1 : {int8u Data; Get_L1(Data, "Replicated Data Length"); ReplicatedDataLength=Data;} break; case 2 : {int16u Data; Get_L2(Data, "Replicated Data Length"); ReplicatedDataLength=Data;} break; case 3 : Get_L4(ReplicatedDataLength, "Replicated Data Length"); break; default: Trusted_IsNot("Replicated Data Length"); return; //Problem } if (ReplicatedDataLengthType!=0 && ReplicatedDataLength>0) { if (ReplicatedDataLength>=8) { int32u PresentationTime; Get_L4 (SizeOfMediaObject, "Size Of Media Object"); Get_L4 (PresentationTime, "Presentation Time"); if (ReplicatedDataLength>8) Data_Packet_ReplicatedData(ReplicatedDataLength-8); //Presentation time delta std::map<int16u, stream>::iterator Strea=Stream.find(Stream_Number); if (Strea!=Stream.end() && Strea->second.StreamKind==Stream_Video) { if (Strea->second.PresentationTime_Old==0) Strea->second.PresentationTime_Old=FileProperties_Preroll; if (PresentationTime!=Strea->second.PresentationTime_Old) { Strea->second.PresentationTime_Deltas[PresentationTime-Strea->second.PresentationTime_Old]++; Strea->second.PresentationTime_Old=PresentationTime; Strea->second.PresentationTime_Count++; } } } else if (ReplicatedDataLength==1) { Skip_L1( "Presentation Time Delta"); //TODO } else { Skip_XX(ReplicatedDataLength, "Replicated Data"); } } if (MultiplePayloadsPresent) { switch (PayloadLengthType) { case 1 : {int8u Data; Get_L1(Data, "Payload Length"); PayloadLength=Data;} break; case 2 : {int16u Data; Get_L2(Data, "Payload Length"); PayloadLength=Data;} break; case 3 : Get_L4(PayloadLength, "Payload Length"); break; default: Trusted_IsNot("Payload Length"); return; //Problem } } else if (Element_Size-Element_Offset>Data_Parse_Padding) PayloadLength=(int32u)(Element_Size-(Element_Offset+Data_Parse_Padding)); else { Trusted_IsNot("Padding size problem"); return; //Problem } if (Element_Offset+PayloadLength+Data_Parse_Padding>Element_Size) { Trusted_IsNot("Payload Length problem"); return; //problem } //Demux Element_Code=Stream_Number; Demux(Buffer+(size_t)Element_Offset, (size_t)PayloadLength, ContentType_MainStream); //Analyzing if (Stream[Stream_Number].Parser && Stream[Stream_Number].SearchingPayload) { //Handling of spanned on multiple chunks #if defined(MEDIAINFO_VC1_YES) bool FrameIsAlwaysComplete=true; #endif if (PayloadLength!=SizeOfMediaObject) { if (SizeOfMediaObject_BytesAlreadyParsed==0) SizeOfMediaObject_BytesAlreadyParsed=SizeOfMediaObject-PayloadLength; else SizeOfMediaObject_BytesAlreadyParsed-=PayloadLength; if (SizeOfMediaObject_BytesAlreadyParsed==0) Element_Show_Count++; #if defined(MEDIAINFO_VC1_YES) else FrameIsAlwaysComplete=false; #endif } else Element_Show_Count++; //Codec specific #if defined(MEDIAINFO_VC1_YES) if (Retrieve(Stream[Stream_Number].StreamKind, Stream[Stream_Number].StreamPos, Fill_Parameter(Stream[Stream_Number].StreamKind, Generic_Format))==__T("VC-1")) ((File_Vc1*)Stream[Stream_Number].Parser)->FrameIsAlwaysComplete=FrameIsAlwaysComplete; #endif Open_Buffer_Continue(Stream[Stream_Number].Parser, (size_t)PayloadLength); if (Stream[Stream_Number].Parser->Status[IsFinished] || (Stream[Stream_Number].PresentationTime_Count>=300 && MediaInfoLib::Config.ParseSpeed_Get()<1)) { Stream[Stream_Number].Parser->Open_Buffer_Unsynch(); Stream[Stream_Number].SearchingPayload=false; Streams_Count--; } Element_Show(); } else { Skip_XX(PayloadLength, "Data"); if (Stream[Stream_Number].SearchingPayload && (Stream[Stream_Number].StreamKind==Stream_Video && Stream[Stream_Number].PresentationTime_Count>=300)) { Stream[Stream_Number].SearchingPayload=false; Streams_Count--; } } Element_End0(); } if (Data_Parse_Padding) Skip_XX(Data_Parse_Padding, "Padding"); //Jumping if needed if (Streams_Count==0 || (Packet_Count>=1000 && MediaInfoLib::Config.ParseSpeed_Get()<1)) { Info("Data, Jumping to end of chunk"); GoTo(Data_AfterTheDataChunk, "Windows Media"); } if (Element_Show_Count>0) Element_Show(); } //--------------------------------------------------------------------------- void File_Wm::Data_Packet_ReplicatedData(int32u Size) { Element_Begin1("Replicated Data"); int64u Element_Offset_Final=Element_Offset+Size; for (size_t Pos=0; Pos<Stream[Stream_Number].Payload_Extension_Systems.size(); Pos++) { Element_Begin0(); switch (Stream[Stream_Number].Payload_Extension_Systems[Pos].ID.hi) { case Elements::Payload_Extension_System_TimeStamp : Data_Packet_ReplicatedData_TimeStamp(); break; default : //Not enough info to validate this algorithm //if (Stream[Stream_Number].Payload_Extension_Systems[Pos].Size!=(int16u)-1) //{ // Element_Name("Unknown"); // Skip_XX(Stream[Stream_Number].Payload_Extension_Systems[Pos].Size, "Unknown"); //} //else Pos=Stream[Stream_Number].Payload_Extension_Systems.size(); //Disabling the rest, all is unknown } Element_End0(); } if (Element_Offset<Element_Offset_Final) { Element_Begin1("Other chunks"); Skip_XX(Element_Offset_Final-Element_Offset, "Unknown"); Element_End0(); } Element_End0(); } //--------------------------------------------------------------------------- void File_Wm::Data_Packet_ReplicatedData_TimeStamp() { Element_Name("TimeStamp"); //Parsing int64u TS0; Skip_L2( "Unknown"); Skip_L4( "Unknown"); Skip_L4( "Unknown"); Get_L8 (TS0, "TS0"); #if MEDIAINFO_TRACE if (TS0!=(int64u)-1) Param_Info1(TS0/10000); #endif //MEDIAINFO_TRACE Info_L8(TS1, "TS1"); #if MEDIAINFO_TRACE if (TS1!=(int64u)-1) Param_Info1(TS1/10000); #endif //MEDIAINFO_TRACE Skip_L4( "Unknown"); Skip_L4( "Unknown"); Skip_L4( "Unknown"); Skip_L4( "Unknown"); if (Stream[Stream_Number].TimeCode_First==(int64u)-1 && TS0!=(int64u)-1) Stream[Stream_Number].TimeCode_First=TS0/10000; } //--------------------------------------------------------------------------- void File_Wm::SimpleIndex() { Element_Name("Simple Index"); //Parsing /* int32u Count; Skip_GUID( "File ID"); Skip_L8( "Index Entry Time Interval"); Skip_L4( "Maximum Packet Count"); Get_L4 (Count, "Index Entries Count"); for (int32u Pos=0; Pos<Count; Pos++) { Element_Begin1("Index Entry", 6); int32u PacketNumber; int16u PacketCount; Get_L4 (PacketNumber, "Packet Number"); Get_L2 (PacketCount, "Packet Count"); Element_End0(); } */ Skip_XX(Element_TotalSize_Get()-Element_Offset, "Indexes"); } //--------------------------------------------------------------------------- void File_Wm::Index() { Element_Name("Index"); //Parsing /* int32u Blocks_Count; int16u Specifiers_Count; Skip_L4( "Index Entry Time Interval"); Get_L2 (Specifiers_Count, "Index Specifiers Count"); Get_L4 (Blocks_Count, "Index Blocks Count"); for (int16u Pos=0; Pos<Specifiers_Count; Pos++) { Element_Begin1("Specifier"); Skip_L2( "Stream Number"); Skip_L2( "Index Type"); Element_End0(); } for (int32u Pos=0; Pos<Blocks_Count; Pos++) { Element_Begin1("Block"); int32u Entry_Count; Get_L4 (Entry_Count, "Index Entry Count"); Element_Begin1("Block Positions"); for (int16u Pos=0; Pos<Specifiers_Count; Pos++) Skip_L4( "Position"); Element_End0(); for (int32u Pos=0; Pos<Entry_Count; Pos++) { Element_Begin1("Entry"); for (int16u Pos=0; Pos<Specifiers_Count; Pos++) Skip_L4( "Offset"); Element_End0(); } Element_End0(); } */ Skip_XX(Element_TotalSize_Get()-Element_Offset, "Indexes"); } //--------------------------------------------------------------------------- void File_Wm::MediaIndex() { Element_Name("MediaIndex"); } //--------------------------------------------------------------------------- void File_Wm::TimecodeIndex() { Element_Name("TimecodeIndex"); } //*************************************************************************** // C++ //*************************************************************************** } //NameSpace #endif //MEDIAINFO_WM_YES
[ "china_jeffery@163.com" ]
china_jeffery@163.com
91d12f0b317227b67a6bf14db79017662f49bdca
fae551eb54ab3a907ba13cf38aba1db288708d92
/chrome/browser/ui/autofill/payments/virtual_card_manual_fallback_bubble_controller.h
6f201b2417aa70c8a373a6295cc846879d8ebee2
[ "BSD-3-Clause" ]
permissive
xtblock/chromium
d4506722fc6e4c9bc04b54921a4382165d875f9a
5fe0705b86e692c65684cdb067d9b452cc5f063f
refs/heads/main
2023-04-26T18:34:42.207215
2021-05-27T04:45:24
2021-05-27T04:45:24
371,258,442
2
1
BSD-3-Clause
2021-05-27T05:36:28
2021-05-27T05:36:28
null
UTF-8
C++
false
false
3,141
h
// Copyright 2021 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. #ifndef CHROME_BROWSER_UI_AUTOFILL_PAYMENTS_VIRTUAL_CARD_MANUAL_FALLBACK_BUBBLE_CONTROLLER_H_ #define CHROME_BROWSER_UI_AUTOFILL_PAYMENTS_VIRTUAL_CARD_MANUAL_FALLBACK_BUBBLE_CONTROLLER_H_ #include <string> #include "components/autofill/core/browser/ui/payments/payments_bubble_closed_reasons.h" #include "content/public/browser/web_contents.h" namespace autofill { class AutofillBubbleBase; class CreditCard; // Interface that exposes controller functionality to // VirtualCardManualFallbackBubbleViews. The bubble is shown when the virtual // card option in the Autofill credit card suggestion list is clicked. It // contains the card number, expiry and CVC information of the virtual card that // users select to use, and serves as a fallback if not all the information is // filled in the form by Autofill correctly. class VirtualCardManualFallbackBubbleController { public: VirtualCardManualFallbackBubbleController() = default; virtual ~VirtualCardManualFallbackBubbleController() = default; VirtualCardManualFallbackBubbleController( const VirtualCardManualFallbackBubbleController&) = delete; VirtualCardManualFallbackBubbleController& operator=( const VirtualCardManualFallbackBubbleController&) = delete; // Returns a reference to VirtualCardManualFallbackBubbleController given the // |web_contents|. If the controller does not exist, creates one and returns // it. static VirtualCardManualFallbackBubbleController* GetOrCreate( content::WebContents* web_contents); // Returns a reference to VirtualCardManualFallbackBubbleController given the // |web_contents|. If the controller does not exist, returns nullptr. static VirtualCardManualFallbackBubbleController* Get( content::WebContents* web_contents); // Returns a reference to the bubble view. virtual AutofillBubbleBase* GetBubble() const = 0; // Returns the title text of the bubble. virtual std::u16string GetBubbleTitle() const = 0; // Returns the descriptive label of the virtual card number field. virtual std::u16string GetVirtualCardNumberFieldLabel() const = 0; // Returns the descriptive label of the expiration date field. virtual std::u16string GetExpirationDateFieldLabel() const = 0; // Returns the descriptive label of the CVC field. virtual std::u16string GetCvcFieldLabel() const = 0; // Returns the CVC value of the virtual card. virtual std::u16string GetCvc() const = 0; // Returns the related virtual card. virtual const CreditCard* GetVirtualCard() const = 0; // Returns whether the omnibox icon for the bubble should be visible. virtual bool ShouldIconBeVisible() const = 0; // Handles the event of bubble closure. |closed_reason| is the detailed reason // why the bubble was closed. virtual void OnBubbleClosed(PaymentsBubbleClosedReason closed_reason) = 0; }; } // namespace autofill #endif // CHROME_BROWSER_UI_AUTOFILL_PAYMENTS_VIRTUAL_CARD_MANUAL_FALLBACK_BUBBLE_CONTROLLER_H_
[ "chromium-scoped@luci-project-accounts.iam.gserviceaccount.com" ]
chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
944563f150bd6a4efdc5f81890b972d1a26c1109
7ee32ddb0cdfdf1993aa4967e1045790690d7089
/ACM-ICPC/NWERC 2012/NWERC12ProblemD.cpp
5809e66453f711f998ca09cf98c568fa58bd6a3f
[]
no_license
ajimenezh/Programing-Contests
b9b91c31814875fd5544d63d7365b3fc20abd354
ad47d1f38b780de46997f16fbaa3338c9aca0e1a
refs/heads/master
2020-12-24T14:56:14.154367
2017-10-16T21:05:01
2017-10-16T21:05:01
11,746,917
1
2
null
null
null
null
UTF-8
C++
false
false
1,488
cpp
#include <iostream> #include <sstream> #include <vector> #include <string> #include <algorithm> #include <utility> #include <set> #include <map> #include <deque> #include <queue> #include <cmath> #include <cstdlib> #include <ctime> #include <cstdio> #include <stdio.h> using namespace std; #define fo(i,n) for(int i=0; i<(int)n; i++) #define rep(it,s) for(__typeof((s).begin()) it=(s).begin();it!=(s).end();it++) #define mp(a,b) make_pair(a,b) #define pb(x) push_back(x) #define pii pair<int,int> string sum(string &s1, string &s2) { if (s1.length()<s2.length()) return sum(s2,s1); int r = 0; int c; for (int i=0; i<s2.length(); i++) { int a = s2[s2.length()-1-i] - '0'; int b = s1[s1.length()-1-i] - '0'; c = a+b+r; r = c/10; c = c%10; s1[s1.length()-1-i] = char('0'+c); } for (int i=s2.length(); i<s1.length(); i++) { int b = s1[s1.length()-1-i] - '0'; c = b+r; r = c/10; c = c%10; s1[s1.length()-1-i] = char('0'+c); } if (r!=0) s1 = char('0'+r) + s1; return s1; } int main() { //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); string s1 = "4"; string s2 = "7"; int n; cin>>n; if (n==3) cout<<s1; else if (n==4) cout<<s2; else { for (int i=0; i<n-4; i++) { string tmp = s2; s2 = sum(s1,s2); s1 = tmp; } cout<<s2; } return 0; }
[ "alejandrojh90@gmail.com" ]
alejandrojh90@gmail.com
626948553fb9e9e491fc0fcdd89ce4ec6011112a
0a1eb091a59dd8eabfa972920095c357f4137bc8
/atcoder/typical90/013/Main.cpp
eafd999e29ef8ba1a264bcdd86c4cb518ba6badc
[]
no_license
y-kamiya/contest
ec033a0b4340b1c8aed074a3a04f7007279b91ae
2af56ac79231a4d7bad3637771d1a985b6162b2e
refs/heads/master
2023-03-13T03:18:13.294463
2023-02-19T07:24:08
2023-02-19T07:24:08
17,743,711
0
0
null
null
null
null
UTF-8
C++
false
false
2,454
cpp
#include <bits/stdc++.h> #include <queue> using namespace std; using ll = long long; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) #define REPR(i,n) for(int i=n;i>=0;i--) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define FORR(i,a,b) for(int i=(a);i>=(b);--i) #define ALL(x) (x).begin(),(x).end() #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ); #define YES(n) cout << ((n) ? "YES" : "NO" ) << endl #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl #define PRINT_DOUBLE(n, x) cout << std::fixed << std::setprecision(n) << x << endl; void print() { cout << endl; } template<typename Head, typename... Tail> void print(Head h, Tail... t) { cout << h << " "; print(t...); } template<typename T, typename... Tail> void print(vector<T> vec, Tail... t) { cout << "["; for (const auto &e : vec) { cout << e << ", "; } cout << "] "; print(t...); } #ifdef _DEBUG #define DEBUG(...) print(__VA_ARGS__) #else #define DEBUG(...) #endif static const ll INF = 1ll<<61; using P = pair<ll, ll>; struct Edge { ll to, cost; }; struct Graph { ll n; vector<vector<Edge>> edges; vector<ll> dist; Graph(ll size) { n = size; edges.resize(n); dist.resize(n, INF); } void add_edge(ll s, ll t, ll cost) { Edge e{ t, cost }; edges[s].push_back(e); } void dijkstra(ll s) { REP(i, n) dist[i] = INF; dist[s] = 0; priority_queue<P, vector<P>, greater<P>> que; que.push({0, s}); while (!que.empty()) { P p = que.top(); que.pop(); auto cost = p.first; auto v = p.second; if (dist[v] < cost) continue; for (const auto &e : edges[v]) { if (dist[e.to] > dist[v] + e.cost) { dist[e.to] = dist[v] + e.cost; que.push({e.cost, e.to}); } } } } }; void _main() { int N, M; cin >> N >> M; Graph G(N); REP(i, M) { int a,b,c; cin >> a >> b >> c; --a, --b; G.add_edge(a, b, c); G.add_edge(b, a, c); } vector<int> ans(N, 0); G.dijkstra(0); REP(i, N) { ans[i] = G.dist[i]; } G.dijkstra(N-1); REP(i, N) { ans[i] += G.dist[i]; } REP(i, N) { cout << ans[i] << endl; } } int main() { _main(); return 0; }
[ "y.kamiya0@gmail.com" ]
y.kamiya0@gmail.com
d2715ee9512781c88d495473b5472365fb88cb35
16ecbc714de16d5e8b11d4fa44bdf976cd5984fd
/tensorflow/compiler/jit/xla_platform_info.h
fdd0681898cd5ba27433acb2c3f3bf2d50278491
[ "Apache-2.0" ]
permissive
adk9/tensorflow
9f73a8352981683ba34f7834e11641cc6d9c534d
29cde405e05632d1b0e5a65940d80afbe3b12ca4
refs/heads/master
2022-12-05T19:50:36.859514
2020-08-28T17:25:15
2020-08-28T17:31:11
276,285,904
0
0
Apache-2.0
2020-09-04T17:03:19
2020-07-01T05:33:55
C++
UTF-8
C++
false
false
4,394
h
/* Copyright 2020 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. ==============================================================================*/ #ifndef TENSORFLOW_COMPILER_JIT_XLA_PLATFORM_INFO_H_ #define TENSORFLOW_COMPILER_JIT_XLA_PLATFORM_INFO_H_ #include "tensorflow/compiler/jit/xla_compilation_cache.h" #include "tensorflow/compiler/jit/xla_device.h" #include "tensorflow/stream_executor/tf_allocator_adapter.h" namespace tensorflow { // Holds some information about the platform on which an // XlaLaunch/_XlaCompile/_XlaRun op must run on. Provides a common layer of // abstraction for normal and XLA devices. class XlaPlatformInfo { public: XlaPlatformInfo() : device_type_("") {} XlaPlatformInfo(XlaPlatformInfo&&) = default; explicit XlaPlatformInfo(const DeviceType device_type, se::Platform::Id platform_id, const XlaDevice::Metadata* xla_device_metadata, se::DeviceMemoryAllocator* device_allocator) : device_type_(device_type), platform_id_(platform_id), xla_device_metadata_(xla_device_metadata), device_allocator_(device_allocator) {} XlaPlatformInfo& operator=(XlaPlatformInfo&& other) = default; bool UseMultipleStreams() const { return xla_device_metadata_ && xla_device_metadata_->UseMultipleStreams(); } // Non-null only when run on an XLA device. se::DeviceMemoryAllocator* custom_allocator() const { return device_allocator_; } DeviceType device_type() const { return device_type_; } // This is equal to xla_device_metadata()->platform()->id() if // xla_device_metadata() is not nullptr. se::Platform::Id platform_id() const { return platform_id_; } // This may be null if the op this XlaPlatformInfo is for was not placed on an // XLA device. const XlaDevice::Metadata* xla_device_metadata() const { return xla_device_metadata_; } bool is_on_xla_device() const { return xla_device_metadata() != nullptr; } private: DeviceType device_type_; se::Platform::Id platform_id_; // xla_device_metadata_ lives in the tensorflow::DeviceBase in which the // XlaLaunch/_XlaCompile/_XlaRun op is placed and thus does not die before the // XlaLaunch/_XlaCompile/_XlaRun OpKernel. const XlaDevice::Metadata* xla_device_metadata_; // If the op associated with this XlaPlatformInfo is placed on an XLA device // then device_allocator_ is the xla::Backend's memory allocator. If the op // is placed on a regular CPU or GPU device then device_allocator_ is null. se::DeviceMemoryAllocator* device_allocator_; TF_DISALLOW_COPY_AND_ASSIGN(XlaPlatformInfo); }; // Returns created XLA compilation cache. Status BuildXlaCompilationCache(DeviceBase* dev, const XlaPlatformInfo& platform_info, XlaCompilationCache** cache); // Returns information about the platform from kernel context. XlaPlatformInfo XlaPlatformInfoFromContext(OpKernelConstruction* ctx); // Returns allocator from platform info if non-null, or populate and return a // pointer to the allocator adapter with allocator from context. // // This is necessary because for XLA devices the underlying TF allocator returns // dummy tensors. se::DeviceMemoryAllocator* GetAllocator( absl::optional<se::TfAllocatorAdapter>* tf_allocator_adapter, OpKernelContext* ctx, const XlaPlatformInfo& platform_info); // Returns created options for the XLA compiler, and writes the used allocator // into `tf_allocator_adapter`. XlaCompiler::Options GenerateCompilerOptions( const XlaCompilationCache& cache, OpKernelContext* ctx, const XlaPlatformInfo& platform_info, bool has_ref_vars, absl::optional<se::TfAllocatorAdapter>* tf_allocator_adapter); } // namespace tensorflow #endif // TENSORFLOW_COMPILER_JIT_XLA_PLATFORM_INFO_H_
[ "gardener@tensorflow.org" ]
gardener@tensorflow.org
c4d5b9646154e10e49d7ee90c2d44d4150d26794
4a8fca797b8b5edb3c11ae334bcb106af2dbf90b
/CS260/lab6/table.cpp
d4a622041aa08103960b1e69b8d50f7b6c253876
[]
no_license
AaronRito/OSU-and-PCC-Coursework
b1e95022617ed9810af450a07564b0c4ac37e95e
ced4d282ee50cfe1f16382bf5ab34f8724a5786b
refs/heads/master
2021-09-26T17:55:36.693259
2018-11-01T03:55:42
2018-11-01T03:55:42
155,659,595
0
0
null
null
null
null
UTF-8
C++
false
false
589
cpp
#include "table.h" int size(node *root) { if(root == NULL) return 0; else return (size(root->left) + size(root->right) + 1); } int sumR(node * root) { if (root == NULL) return 0; return (root->data + sumR(root->left) + sumR(root->right)); } int height(node * root) { if (root == NULL) return -1; return (1 + max(height(root->left), height(root->right))); } int treeHeight(node * root) { if (root == NULL) { return -1; } int left = treeHeight(root->left); int right = treeHeight(root->right); return 1 + std::max(left, right); }
[ "aaronrito@gmail.com" ]
aaronrito@gmail.com
109a7aa793d2d39d39f35f1068a83d33b6412865
06945dd959ddf9d4865bb96c088ce0a630edf38e
/Lista auxiliar/Peça.cpp
d2d2b81928ff298059e2012f7d2bb891b35b3a63
[]
no_license
GabrielSchenato/algoritmos
0acc240f1d66237b5b096b3c4f3fd661e0cef47e
750531e459239faaeee8298616370458939d94b9
refs/heads/master
2020-12-06T11:02:26.597398
2020-01-08T00:57:21
2020-01-08T00:57:21
232,447,205
0
0
null
null
null
null
UTF-8
C++
false
false
520
cpp
#include <iostream> using namespace std; main () { string nome; float preco, qtde, valor_total; cout << "\nOla, seja bem vindo"; while (1){ cout << "\n\nPor favor, digite o nome da pessoa: "; cin >> nome; cout << "\nPor favor, digite o preco da peca: "; cin >> preco; cout << "\nPor favor, digite a quantidade de peca: "; cin >> qtde; valor_total = preco * qtde; valor_total = valor_total * 0.05; cout << "\n\nA comissao do vendedor " <<nome <<" eh de: " << valor_total; } return 0; }
[ "gabrielschenato152@hotmail.com" ]
gabrielschenato152@hotmail.com
3786dd2b6e194a29f2ba3e6a5138c5f614b9c470
7a3a99e2c023358112c7f280c91fc0d227ec5f6b
/projects/2BD Engine 3.0/src/NotImportant.h
8c534b8e89278cbf7deeb2b22a279c105817aa00
[]
no_license
Eric-Aivaliotis/Phobrynth
508bbc1ba6a3ed7b1c459b16a242681899ea6fde
e73a1e490d33e49c29aaeceea20a46a00f447c79
refs/heads/master
2020-12-19T08:47:45.430385
2020-01-22T01:08:56
2020-01-22T01:08:56
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,715
h
#pragma once /* auto& ecs = GetRegistry("Test"); entt::entity e1 = ecs.create(); MeshRenderer& m1 = ecs.assign<MeshRenderer>(e1); ecs.assign<TempTransform>(e1).Scale = glm::vec3(1.0f); m1.Material = testMat; m1.Mesh = myMesh; //Spider entt::entity e2 = ecs.create(); MeshRenderer& m2 = ecs.assign<MeshRenderer>(e2); ecs.assign<TempTransform>(e2).Scale = glm::vec3(1.0f); m2.Material = testMat; m2.Mesh = myMeshObj; //Level1 entt::entity L1 = ecs.create(); MeshRenderer& Lv1 = ecs.assign<MeshRenderer>(L1); ecs.assign<TempTransform>(L1).Scale = glm::vec3(1.0f); Lv1.Material = testMat; Lv1.Mesh = mylevel; //Bed entt::entity e3 = ecs.create(); MeshRenderer& m3 = ecs.assign<MeshRenderer>(e3); ecs.assign<TempTransform>(e3).Scale = glm::vec3(1.0f); m3.Material = testMat; m3.Mesh = myMeshObjBed; myModelTransformObj = glm::mat4(1.0f); myModelTransform1 = glm::mat4(1.0f); //RNG Bed Spawning int rng; rng = rand() % 3; auto start = std::chrono::system_clock::now(); std::vector<int> v(100000, 42); auto end = std::chrono::system_clock::now(); std::chrono::duration<double> diff = end - start; rng = diff.count() * 100000; if (rng % 3 == 0) { auto BedPos1 = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).Position = glm::vec3(-2.0, 24.5, 0); }; auto& BedSpawn = ecs.get_or_assign<UpdateBehaviour>(e3);//e3 is the bed BedSpawn.Function = BedPos1; } else if (rng % 3 == 1) { auto BedPos2 = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).Position = glm::vec3(-28.0, 17.5, 0); }; auto& BedSpawn = ecs.get_or_assign<UpdateBehaviour>(e3);//e3 is the bed BedSpawn.Function = BedPos2; } else if (rng % 3 == 2) { auto BedPos3 = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).Position = glm::vec3(-28.0, 28.5, 0); }; auto& BedSpawn = ecs.get_or_assign<UpdateBehaviour>(e3);//e3 is the bed BedSpawn.Function = BedPos3; } //Movement //Forward auto moveF = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).Position += glm::vec3(0, 0.005, 0); }; //Back auto moveB = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).Position += glm::vec3(0, -0.005, 0); }; //Right auto moveR = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).Position += glm::vec3(0.005, 0, 0); }; //Left auto moveL = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).Position += glm::vec3(-0.005, 0, 0); }; //Rotate Right auto rotR = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).EulerRotation += glm::vec3(0, 0, 90 * dt); }; //Rotate Left auto rotL = [](entt::entity e, float dt) { CurrentRegistry().get<TempTransform>(e).EulerRotation += glm::vec3(0, 0, -90 * dt); }; //Gets and assigns the behaviour (think I'll only need this to work for all of them). auto& up = ecs.get_or_assign<UpdateBehaviour>(e1);//e1 is the tile square if (moveForward == true) { //Forward Moving up.Function = moveF; } if (moveBack == true) { //Back Moving up.Function = moveB; } if (moveLeft == true) { //Left Moving up.Function = moveL; } if (moveRight == true) { //Right Moving up.Function = moveR; } if (rotateLeft == true) { //Rotation Left up.Function = rotL; } if (rotateRight == true) { //Rotation Right up.Function = rotR; } //Movement auto& moveSpider = ecs.get_or_assign <UpdateBehaviour>(e2); //End of old */
[ "chrisgrigorsalas@gmailcome" ]
chrisgrigorsalas@gmailcome
958f82dc32366b361182ed909744e29dd750c70e
9b48da12e8d70fb3d633b988b9c7d63a954434bf
/ECC8.1/Server/kennel/monitor/unix/aimparser/aimparser.cpp
9a39af7a4e2c859af79f692ebd22536a369334b1
[]
no_license
SiteView/ECC8.1.3
446e222e33f37f0bb6b67a9799e1353db6308095
7d7d8c7e7d7e7e03fa14f9f0e3ce5e04aacdb033
refs/heads/master
2021-01-01T18:07:05.104362
2012-08-30T08:58:28
2012-08-30T08:58:28
4,735,167
1
3
null
null
null
null
GB18030
C++
false
false
133,080
cpp
// AimParser.cpp : Defines the initialization routines for the DLL. // #include "stdafx.h" #include "AimParser.h" //#include "../Global/global.h" #include "base/funcgeneral.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //在卓望版本打开,标准6.2关闭 //#define ZHUOWANG // // Note! // // If this DLL is dynamically linked against the MFC // DLLs, any functions exported from this DLL which // call into MFC must have the AFX_MANAGE_STATE macro // added at the very beginning of the function. // // For example: // // extern "C" BOOL PASCAL EXPORT ExportedFunction() // { // AFX_MANAGE_STATE(AfxGetStaticModuleState()); // // normal function body here // } // // It is very important that this macro appear in each // function, prior to any calls into MFC. This means that // it must appear as the first statement within the // function, even before any object variable declarations // as their constructors may generate calls into the MFC // DLL. // // Please see MFC Technical Notes 33 and 58 for additional // details. // ///////////////////////////////////////////////////////////////////////////// // CAimParserApp BEGIN_MESSAGE_MAP(CAimParserApp, CWinApp) //{{AFX_MSG_MAP(CAimParserApp) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CAimParserApp construction CAimParserApp::CAimParserApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// // The one and only CAimParserApp object CAimParserApp theApp; //#define KEY_PATH "SOFTWARE\\Aim" //#define KEY_NAME "RootPath" //char IniFileName[1024]; enum { char_space = 32, //0x20 char_return = 13, //0x0D char_newline = 10 //0x0A }; void AddToLogFile(const int nMonitorType, const char*szMsg); void GetColumnFromLine(CString& strIn, int nColumn, CString& strOut, int nMonitorType = -1); void GetLineString(const CStringList& lstStr, const int nReverse, int nStart, CString& strOut); BOOL GetIniFileName(const char *FileName, char *IniFileName); BOOL GetColumnIndex(CStringList& lstStr, int& nColumn,char*IniFileName); BOOL GetColumnIndex( CString strIn, int& nColumn, char* pszMatch ); BOOL FormatSource(const char * szSource, const int nMonitorType, CStringList& lstStr,char*IniFileName); BOOL GetBufferByNewMatchLine(const char * szSource, const int nMonitorType,char*IniFileName,char**buffer); extern "C" __declspec(dllexport) BOOL GetMatchColumn(const int nMatchColumnLine,const char * matchcolumnName,const CStringList* pList,int &matchcolumn); BOOL _GetMatchColumn(const char *szSrc,const char *szName, int &nMatchColumn); char *FindMonth(char *original); #include <time.h> #include <sys/types.h> #include <sys/stat.h> void WriteLog( const char* str ) { return; char timebuf[128],datebuf[128]; _tzset(); _strtime( timebuf ); _strdate( datebuf ); char szLogFile[] = "aimParser.log"; // 判断文件大小:在不打开文件的情况下实现 struct _stat buf; if( _stat( szLogFile, &buf ) == 0 ) { if( buf.st_size > 100*1024 ) { FILE *log = fopen( szLogFile, "w" ); if( log != NULL ) fclose( log ); } } FILE *log = fopen( szLogFile,"a+"); if( log != NULL ) { fprintf( log, "%s %s \t%s\n", datebuf, timebuf, str ); fclose( log ); } } char *FindMonth(char *original, int &mlen) { char *s_tmp = NULL; if(s_tmp = strstr(original, "Jan")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_01"))) // <%IDS_AimParser_01%>"1月" else if(s_tmp = strstr(original,"1月")) mlen = 3; else if(s_tmp = strstr(original, "Feb")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_02"))) // <%IDS_AimParser_02%>"2月" else if(s_tmp = strstr(original,"2月")) mlen = 3; else if(s_tmp = strstr(original, "Mar")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_03"))) // <%IDS_AimParser_03%>"3月" else if(s_tmp = strstr(original,"3月")) mlen = 3; else if(s_tmp = strstr(original, "Apr")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_04"))) // <%IDS_AimParser_04%>"4月" else if(s_tmp = strstr(original,"4月")) mlen = 3; else if(s_tmp = strstr(original, "May")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_05"))) // <%IDS_AimParser_05%>"5月" else if(s_tmp = strstr(original,"5月")) mlen = 3; else if(s_tmp = strstr(original, "Jun")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_06"))) // <%IDS_AimParser_06%>"6月" else if(s_tmp = strstr(original,"6月")) mlen = 3; else if(s_tmp = strstr(original, "Jul")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_07"))) // <%IDS_AimParser_07%>"7月" else if(s_tmp = strstr(original,"7月")) mlen = 3; else if(s_tmp = strstr(original, "Aug")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_08"))) // <%IDS_AimParser_08%>"8月" else if(s_tmp = strstr(original,"8月")) mlen = 3; else if(s_tmp = strstr(original, "Sep")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_09"))) // <%IDS_AimParser_09%>"9月" else if(s_tmp = strstr(original,"9月")) mlen = 3; else if(s_tmp = strstr(original, "Oct")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_10"))) // <%IDS_AimParser_10%>"10月" else if(s_tmp = strstr(original,"10月")) mlen = 4; else if(s_tmp = strstr(original, "Nov")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_11"))) // <%IDS_AimParser_11%>"11月" else if(s_tmp = strstr(original,"11月")) mlen = 4; else if(s_tmp = strstr(original, "Dec")) mlen = 3; //else if(s_tmp = strstr(original, FuncGetStringFromIDS("SV_MONTH", "MONTH_12"))) // <%IDS_AimParser_12%>"12月" else if(s_tmp = strstr(original,"12月")) mlen = 4; else mlen = 0; return s_tmp; } extern "C" __declspec(dllexport) BOOL CpuParserTest(const char * szSource, const int nTelInfo, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { if(nTelInfo & 0x02) { int count = 1; POSITION pos = lstString.FindIndex(0); while(pos) printf("Line %2.2d: %s<br>\r\n", count++, lstString.GetNext(pos)); printf("\r\n<br>"); fflush(stdout); } int nOsType = DFNParser_GetPrivateProfileInt("cpu", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"idle\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_13%>"), nIdle); // <%IDS_AimParser_13%>CPU 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_14%>"), nStart); // <%IDS_AimParser_14%>CPU 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_15%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_15%>CPU 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg.Format("%s(%%): %d", FuncGetStringFromIDS("SV_CPU", "CPU_USED"), nValue); // <%IDS_AimParser_16%>CPU使用率 strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); int nWait = DFNParser_GetPrivateProfileInt("cpu", "wait", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"idle\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_17%>"), nIdle); // <%IDS_AimParser_17%>CPU 命令设置 printf("%s \"wait\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_18%>"), nWait); // <%IDS_AimParser_18%>CPU 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_19%>"), nStart); // <%IDS_AimParser_19%>CPU 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_20%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_20%>CPU 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nIdle, strOut1); GetColumnFromLine(strTarget, nWait, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut1) - atoi((LPCTSTR)strOut2); if(nValue < 0) nValue = 0; strMsg.Format("%s(%%): %d", FuncGetStringFromIDS("SV_CPU", "CPU_USED"),nValue); // <%IDS_AimParser_21%>CPU使用率 strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"idle\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_22%>"),nIdle); // <%IDS_AimParser_22%>CPU 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_23%>"),nStart); // <%IDS_AimParser_23%>CPU 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_24%>"),nReverse ? "true" : "false"); // <%IDS_AimParser_24%>CPU 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg.Format("%s(%%): %d", FuncGetStringFromIDS("SV_CPU", "CPU_USED"),nValue); // <%IDS_AimParser_25%>CPU使用率 strcpy(szOut, (LPCTSTR)strMsg); } } else if (nOsType == 4) { // HPUX int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"idle\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_13%>"), nIdle); // <%IDS_AimParser_13%>CPU 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_14%>"), nStart); // <%IDS_AimParser_14%>CPU 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_15%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_15%>CPU 命令设置 fflush(stdout); } int nCount = 0; int index = nStart; while(1) { GetLineString(lstString, nReverse, index, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) break; else { char buff[256] = {0}; nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg += FuncGetStringFromIDS("SV_CPU", "CPU_USED"); strMsg += "_"; strMsg += _itoa(nCount, buff, 10); strMsg += ": "; strMsg += _itoa(nValue, buff, 10); strMsg += ", "; //strMsg.Format("%s(%%): %d", FuncGetStringFromIDS("<%IDS_AimParser_16%>"), nValue); // <%IDS_AimParser_16%>CPU使用率 nCount ++; } index ++; } if(!strMsg.IsEmpty()) { strMsg.Delete(strMsg.GetLength() - 2, 2); char buff[256] = {0}; sprintf(buff, "%s_%d", FuncGetStringFromIDS("SV_CPU", "CPU_USED"), nCount - 1); if(nCount == 1) { strMsg.Replace(buff, FuncGetStringFromIDS("SV_CPU", "CPU_USED")); } else { char buff2[256] = {0}; sprintf(buff2, "%s_%s", FuncGetStringFromIDS("SV_CPU", "CPU_USED"), "Average"); strMsg.Replace(buff, buff2); } strcpy(szOut, (LPCTSTR)strMsg); } else { bRet = FALSE; } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL HP_CpuParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("cpu", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); int nWait = DFNParser_GetPrivateProfileInt("cpu", "wait", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nIdle, strOut1); GetColumnFromLine(strTarget, nWait, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut1) - atoi((LPCTSTR)strOut2); if(nValue < 0) nValue = 0; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if (nOsType == 4) { // HPUX int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); int nWIO = DFNParser_GetPrivateProfileInt("cpu", "wio", 0, IniFileName); int nUsr = DFNParser_GetPrivateProfileInt("cpu", "usr", 0, IniFileName); int nSys = DFNParser_GetPrivateProfileInt("cpu", "sys", 0, IniFileName); int nCount = 0; int index = nStart; int nUsedValue = 0; CString strIdle = _T(""); CString strWIO = _T(""); CString strUsr = _T(""); CString strSys = _T(""); puts("hp"); while(1) { GetLineString(lstString, nReverse, index, strTarget); GetColumnFromLine(strTarget, nIdle, strIdle); GetColumnFromLine(strTarget, nWIO, strWIO); GetColumnFromLine(strTarget, nUsr, strUsr); GetColumnFromLine(strTarget, nSys, strSys); if (strIdle.IsEmpty() || strWIO.IsEmpty() || strUsr.IsEmpty() || strSys.IsEmpty()) { break; } else { nUsedValue = 100 - atoi((LPCTSTR)strIdle) - atoi((LPCTSTR)strWIO); if(nUsedValue < 0) nUsedValue = 0; strMsg.Format("utilization=%d$sysper=%d$usrper=%d$wio=%d$idle=%d$", nUsedValue, atoi((LPCTSTR)strSys), atoi((LPCTSTR)strUsr), atoi((LPCTSTR)strWIO), atoi((LPCTSTR)strIdle)); strcpy(szOut, (LPCTSTR)strMsg); // char buff[256] = {0}; // nValue = 100 - atoi((LPCTSTR)strOut); // if(nValue < 0) nValue = 0; // strMsg += "utilization"; // strMsg += _itoa(nCount, buff, 10); // strMsg += "="; // strMsg += _itoa(nValue, buff, 10); // strMsg += "$"; // nCount ++; } index ++; } // if(!strMsg.IsEmpty()) // { // char buff[256] = {0}; // sprintf(buff, "%s%d", "utilization", nCount - 1); // strMsg.Replace(buff, "utilization"); // // strcpy(szOut, (LPCTSTR)strMsg); // } // else // { // bRet = FALSE; // } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } #ifdef ZHUOWANG //卓望使用的监测器,hp cpu特殊处理 extern "C" __declspec(dllexport) BOOL CpuParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("cpu", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); int nWait = DFNParser_GetPrivateProfileInt("cpu", "wait", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nIdle, strOut1); GetColumnFromLine(strTarget, nWait, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut1) - atoi((LPCTSTR)strOut2); if(nValue < 0) nValue = 0; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if (nOsType == 4) { // HPUX int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); int nWIO = DFNParser_GetPrivateProfileInt("cpu", "wio", 0, IniFileName); int nUsr = DFNParser_GetPrivateProfileInt("cpu", "usr", 0, IniFileName); int nSys = DFNParser_GetPrivateProfileInt("cpu", "sys", 0, IniFileName); int nCount = 0; int index = nStart; int nUsedValue = 0; CString strIdle = _T(""); CString strWIO = _T(""); CString strUsr = _T(""); CString strSys = _T(""); puts("hp"); while(1) { GetLineString(lstString, nReverse, index, strTarget); GetColumnFromLine(strTarget, nIdle, strIdle); GetColumnFromLine(strTarget, nWIO, strWIO); GetColumnFromLine(strTarget, nUsr, strUsr); GetColumnFromLine(strTarget, nSys, strSys); if (strIdle.IsEmpty() || strWIO.IsEmpty() || strUsr.IsEmpty() || strSys.IsEmpty()) { break; } else { nUsedValue = 100 - atoi((LPCTSTR)strIdle) - atoi((LPCTSTR)strWIO); if(nUsedValue < 0) nUsedValue = 0; strMsg.Format("utilization=%d$sysper=%d$usrper=%d$wio=%d$idle=%d$", nUsedValue, atoi((LPCTSTR)strSys), atoi((LPCTSTR)strUsr), atoi((LPCTSTR)strWIO), atoi((LPCTSTR)strIdle)); strcpy(szOut, (LPCTSTR)strMsg); // char buff[256] = {0}; // nValue = 100 - atoi((LPCTSTR)strOut); // if(nValue < 0) nValue = 0; // strMsg += "utilization"; // strMsg += _itoa(nCount, buff, 10); // strMsg += "="; // strMsg += _itoa(nValue, buff, 10); // strMsg += "$"; // nCount ++; } index ++; } // if(!strMsg.IsEmpty()) // { // char buff[256] = {0}; // sprintf(buff, "%s%d", "utilization", nCount - 1); // strMsg.Replace(buff, "utilization"); // // strcpy(szOut, (LPCTSTR)strMsg); // } // else // { // bRet = FALSE; // } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } #else //区分hp cpu和普通cpu extern "C" __declspec(dllexport) BOOL CpuParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); puts(szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("cpu", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); printf("%d -%d-%d\n",nReverse,nStart,nIdle); /*start ***add by mtx************************************************************************************************/ //得到匹配列 int nMatchColumnLine = DFNParser_GetPrivateProfileInt("cpu", "matchColumnLine", 0, IniFileName); char matchcolumnName[16] = {0}; DFNParser_GetPrivateProfileString("cpu", "matchcolumn", "", matchcolumnName, sizeof(matchcolumnName), IniFileName); //判断是否有匹配列 if((matchcolumnName[0]>0) && (nMatchColumnLine>0)) { int matchcolumn = 0; //得到新的 if(GetMatchColumn(nMatchColumnLine,matchcolumnName,&lstString,matchcolumn)) nIdle = matchcolumn; } /*end ***add by mtx************************************************************************************************/ GetLineString(lstString, nReverse, nStart, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; //nValue = 100; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); int nWait = DFNParser_GetPrivateProfileInt("cpu", "wait", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nIdle, strOut1); GetColumnFromLine(strTarget, nWait, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut1) - atoi((LPCTSTR)strOut2); if(nValue < 0) nValue = 0; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) bRet = FALSE; else { nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg.Format("utilization=%d$", nValue); strcpy(szOut, (LPCTSTR)strMsg); } } else if (nOsType == 4) { // HPUX int nReverse = DFNParser_GetPrivateProfileInt("cpu", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("cpu", "startline", 0, IniFileName); int nIdle = DFNParser_GetPrivateProfileInt("cpu", "idle", 0, IniFileName); int nCount = 0; int index = nStart; while(1) { GetLineString(lstString, nReverse, index, strTarget); CString strOut = _T(""); GetColumnFromLine(strTarget, nIdle, strOut); if (strOut.IsEmpty()) break; else { char buff[256] = {0}; nValue = 100 - atoi((LPCTSTR)strOut); if(nValue < 0) nValue = 0; strMsg += "utilization"; strMsg += _itoa(nCount, buff, 10); strMsg += "="; strMsg += _itoa(nValue, buff, 10); strMsg += "$"; nCount ++; } index ++; } if(!strMsg.IsEmpty()) { char buff[256] = {0}; sprintf(buff, "%s%d", "utilization", nCount - 1); strMsg.Replace(buff, "utilization"); strcpy(szOut, (LPCTSTR)strMsg); } else { bRet = FALSE; } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } #endif extern "C" __declspec(dllexport) BOOL GetMatchColumn(const int nMatchColumnLine,const char * matchcolumnName,const CStringList* pList,int &matchcolumn) { if(!pList) return FALSE; POSITION pos = pList->GetHeadPosition(); int i = 0; while (pos) { i++; CString sTemp = pList->GetNext(pos); if(i == nMatchColumnLine) { char szSrc[1024]={0}; strcpy(szSrc, (LPCTSTR)sTemp); if(_GetMatchColumn(szSrc,matchcolumnName,matchcolumn)) return TRUE; break; } } return FALSE; } BOOL _GetMatchColumn(const char *szSrc,const char *szName, int &nMatchColumn) { char *t_szSrc = strdup(szSrc); char *t_szName = strdup(szName); char *s_tmp = t_szSrc; char *s_tmp1 = NULL; //去掉空格 while(*s_tmp == 32) { s_tmp++; } int nPos = 0; while(1){ if(s_tmp1 = strstr(s_tmp, " ")) { nPos++; //去掉空格 int nSpace = 0; while(*s_tmp1 == 32) { nSpace++; s_tmp1++; } //得到每一列的名称长度 int nLen = s_tmp1 - s_tmp - nSpace; //得到列名 char cTemp[16]={0}; strncpy(cTemp, s_tmp, nLen); //比较 if(!strcmp(cTemp,szName)) { //判断列名后的空格 if (*(s_tmp+nLen) == 32) { nMatchColumn = nPos; free(t_szSrc); free(t_szName); return TRUE; } } s_tmp = s_tmp1; } else { //当为最后一列时 if(!strcmp(s_tmp,szName)) { nPos++; nMatchColumn = nPos; free(t_szSrc); free(t_szName); return TRUE; } break; } } free(t_szSrc); free(t_szName); return TRUE; } extern "C" __declspec(dllexport) BOOL FileParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("file", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nStart = DFNParser_GetPrivateProfileInt("file", "startline", 0, IniFileName); int nMode = DFNParser_GetPrivateProfileInt("file", "mode", 0, IniFileName); int nName = DFNParser_GetPrivateProfileInt("file", "name", 0, IniFileName); int nReverse = DFNParser_GetPrivateProfileInt("file", "reverselines", 0, IniFileName); int i = nStart; while(1) { GetLineString(lstString, nReverse, i++, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nMode, strOut1); GetColumnFromLine(strTarget, nName, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) break; else { if(strOut1.GetAt(0) == 'd') continue; sprintf(szOut, "%s%s$$$", szOut, strOut2); } } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } BOOL GetBufferByNewMatchLine(const char * szSource, const int nMonitorType,char*IniFileName,char**buffer) { char *Source = NULL; char matchLine[16] = {0}; Source = strdup(szSource); if (Source) { if (nMonitorType == CPU_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("cpu", "matchLine1", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == DISK_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("disk", "matchLine1", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == MEMORY_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("memory", "matchLine1", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == SERVICE_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("service", "matchLine1", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == DISKS_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("disks", "matchLine1", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == FILE_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("file", "matchLine1", "", matchLine, sizeof(matchLine), IniFileName); } else { } *buffer = strstr(Source, matchLine); if(!*buffer) return FALSE; else return TRUE; } else return FALSE; return TRUE; } BOOL FormatSource(const char * szSource, const int nMonitorType, CStringList& lstStr,char*IniFileName) { WriteLog("============== FormatSource =============="); BOOL bRet = FALSE; char *Source = NULL; char *buffer = NULL; char matchLine[16] = {0}; Source = strdup(szSource); if (Source) { if (nMonitorType == CPU_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("cpu", "matchline", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == DISK_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("disk", "matchline", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == MEMORY_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("memory", "matchline", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == SERVICE_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("service", "matchline", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == USER_CPU_MONITOR) { DFNParser_GetPrivateProfileString("usercpu", "matchline", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == DISKS_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("disks", "matchline", "", matchLine, sizeof(matchLine), IniFileName); } else if (nMonitorType == FILE_TYPE_MONITOR) { DFNParser_GetPrivateProfileString("file", "matchline", "", matchLine, sizeof(matchLine), IniFileName); } else { } buffer = strstr(Source, matchLine); /*start ***add by mtx************************************************************************************************/ if(!buffer) { GetBufferByNewMatchLine(szSource,nMonitorType,IniFileName,&buffer); } if(!buffer) return FALSE; /*end ***add by mtx************************************************************************************************/ if(buffer) { char *s_original = buffer; char *s_derive = NULL; char *s_derive2 = NULL; //while ((s_derive = strchr(s_original,char_return))) { // for telnet //while ((s_derive = strchr(s_original,char_newline))) { // just for debug from file and SSH while (1) { s_derive = strchr(s_original, char_return); s_derive2 = strchr(s_original, char_newline); //puts(s_derive); //puts(s_derive2); //WriteLog("s_derive:"); //WriteLog(s_derive); //WriteLog("s_derive2:"); //WriteLog(s_derive2); if(s_derive && s_derive2) { if(s_derive2 < s_derive) s_derive = s_derive2; } else if(s_derive2 && !s_derive) { s_derive = s_derive2; } else if(!s_derive2 && s_derive) { } else { break; } // if (!(s_derive = strchr(s_original,char_return))) // for telnet // if (!(s_derive = strchr(s_original,char_newline))) // just for debug from file or SSH // break; /*if (!(s_derive = strstr(s_original,"\r\n"))) // just for debug break;*/ s_original[s_derive-s_original] = 0; if(nMonitorType == SERVICE_TYPE_MONITOR) { int mlen = 0; char *s_tmp = FindMonth(s_original, mlen); while(s_tmp && *(s_tmp + mlen) == ' ') { *(s_tmp + mlen) = '+'; mlen ++; } } if(nMonitorType == MEMORY_TYPE_MONITOR) { char *s_tmp = NULL; while(s_tmp = strstr(s_original, ",")) { *(s_tmp) = ' '; *(s_tmp + 1) = ' '; } } WriteLog( "\nline:\n" ); WriteLog( s_original ); lstStr.AddTail(s_original); s_derive += 1; while (1) { if (s_derive[0] == char_newline || s_derive[0] == char_return) s_derive += 1; else break; } s_original = s_derive; } lstStr.AddTail(s_original); bRet = TRUE; } free(Source); } return bRet; } void GetLineString(const CStringList& lstStr, const int nReverse, int nStart, CString& strOut) { POSITION pos = NULL; if (nReverse) { pos = lstStr.GetTailPosition(); while (pos) { strOut = lstStr.GetPrev(pos); nStart--; if (nStart == 0) break; } } else { pos = lstStr.GetHeadPosition(); while (pos) { strOut = lstStr.GetNext(pos); nStart--; if (nStart == 0) break; } } return; } void GetColumnFromLine(CString& strIn, int nColumn, CString& strOut, int nMonitorType) { strOut = _T(""); int nLen = strIn.GetLength(); TCHAR ch; CString str = _T(""); if(nColumn == 999) { int index = strIn.ReverseFind(' '); if(index >= 0) strOut = strIn.Right(strIn.GetLength() - index - 1); } else { for (int i = 0; i < nLen; i++) { ch = strIn.GetAt(i); if (ch == char_space) continue; nColumn--; str = strIn.Right(nLen - i); str = str.SpanExcluding(" "); /*if (nColumn == 4) { int nFound = str.Find(":", 0); if (nFound >=0) nColumn --; }*/ if (nColumn == 0) { if (nMonitorType == SERVICE_TYPE_MONITOR) { char *p = strIn.GetBuffer(strIn.GetLength()); strOut = p+i; } else { strOut = str; } break; } i += str.GetLength(); } } return; } extern "C" __declspec(dllexport) BOOL MemoryParserTest(const char * szSource, const int nTelInfo, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strTarget2 = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { if(nTelInfo & 0x02) { int count = 1; POSITION pos = lstString.FindIndex(0); while(pos) printf("%s %2.2d: %s<br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_26%>"),count++, lstString.GetNext(pos)); // <%IDS_AimParser_26%>行 printf("<br>\r\n"); fflush(stdout); } int nOsType = DFNParser_GetPrivateProfileInt("memory", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); int nUsed = DFNParser_GetPrivateProfileInt("memory", "used", 0, IniFileName); int nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"used\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_27%>"), nUsed); // <%IDS_AimParser_27%>内存 命令设置 printf("%s \"total\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_28%>"), nTotal); // <%IDS_AimParser_28%>内存 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_29%>"), nStart); // <%IDS_AimParser_29%>内存 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_30%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_30%>内存 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsed, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%dk", &nUsed); sscanf((LPCTSTR)strOut2, "%dk", &nTotal); float fRate = (float)(100.0 * nUsed / (1.0 * nTotal)); float fMbFree = (float)((nTotal - nUsed) / (1.0 * 1024 * 1024)); strMsg.Format("%s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_MEMORY", "MEMORY_USED"), fRate, FuncGetStringFromIDS("SV_MEMORY", "MEMORY_FREED"), fMbFree); // <%IDS_AimParser_31%>Memory使用率,<%IDS_AimParser_32%>Memory剩余 strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); int nUsed = DFNParser_GetPrivateProfileInt("memory", "used", 0, IniFileName); int nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); int nSwapUnit = DFNParser_GetPrivateProfileInt("memory", "swapunit", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"used\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_33%>"), nUsed); // <%IDS_AimParser_33%>内存 命令设置 printf("%s \"free\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_34%>"), nFree); // <%IDS_AimParser_34%>内存 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_35%>"), nStart); // <%IDS_AimParser_35%>内存 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_36%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_36%>内存 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsed, strOut1); GetColumnFromLine(strTarget, nFree, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%dk", &nUsed); sscanf((LPCTSTR)strOut2, "%dk", &nFree); float fRate = (float)(100.0 * nUsed / (1.0 * (nUsed + nFree))); float fMbFree = (float)(nFree / (1.0 * 1024)); strMsg.Format("%s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_MEMORY", "MEMORY_USED"), fRate, FuncGetStringFromIDS("SV_MEMORY", "MEMORY_FREED"), fMbFree); // <%IDS_AimParser_37%>Memory使用率,<%IDS_AimParser_38%>Memory剩余 strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); int nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); int nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"total\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_39%>"), nTotal); // <%IDS_AimParser_39%>内存 命令设置 printf("%s \"free\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_40%>"), nFree); // <%IDS_AimParser_40%>内存 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_41%>"), nStart); // <%IDS_AimParser_41%>内存 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_42%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_42%>内存 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); float fRate = (float)(100.0 * (nTotal - nFree) / (1.0 * nTotal)); float fMbFree = (float)(nFree / (1.0 * 1024)); strMsg.Format("%s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_MEMORY", "MEMORY_USED"), fRate, FuncGetStringFromIDS("SV_MEMORY", "MEMORY_FREED"), fMbFree); // <%IDS_AimParser_43%>Memory使用率,<%IDS_AimParser_44%>Memory剩余 strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 4) { // compatible with digital os int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); int nFreeLine = DFNParser_GetPrivateProfileInt("memory", "freeLine", 0, IniFileName); long nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); int nTotalLine = DFNParser_GetPrivateProfileInt("memory", "totalLine", 0, IniFileName); long nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); long nSwapUnit = DFNParser_GetPrivateProfileInt("memory", "swapunit", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"totalline\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_45%>"), nTotalLine); // <%IDS_AimParser_45%>内存 命令设置 printf("%s \"total\": %ld <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_46%>"), nTotal); // <%IDS_AimParser_46%>内存 命令设置 printf("%s \"freeline\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_47%>"), nFreeLine); // <%IDS_AimParser_47%>内存 命令设置 printf("%s \"free\": %ld <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_48%>"), nFree); // <%IDS_AimParser_48%>内存 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_49%>"), nStart); // <%IDS_AimParser_49%>内存 命令设置 printf("%s \"swapunit\": %ld <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_50%>"), nSwapUnit); // <%IDS_AimParser_50%>内存 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_51%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_51%>内存 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nFreeLine, strTarget); GetLineString(lstString, nReverse, nTotalLine, strTarget2); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget2, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%ld", &nFree); sscanf((LPCTSTR)strOut2, "%ld", &nTotal); float fRate = (float)(100.0 * (nTotal - nFree) / (1.0 * nTotal)); float fMbFree = (float)(nFree * nSwapUnit / (1.0 * 1024 * 1024)); strMsg.Format("%s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_MEMORY", "MEMORY_USED"), fRate, FuncGetStringFromIDS("SV_MEMORY", "MEMORY_FREED"), fMbFree); // <%IDS_AimParser_52%>Memory使用率,<%IDS_AimParser_53%>Memory剩余 strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 5) { int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); long nUsePercent = DFNParser_GetPrivateProfileInt("memory", "usePercent", 0, IniFileName); long nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"use percent\": %ld <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_54%>"), nUsePercent); // <%IDS_AimParser_54%>内存 命令设置 printf("%s \"total\": %ld <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_55%>"), nTotal); // <%IDS_AimParser_55%>内存 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_56%>"), nStart); // <%IDS_AimParser_56%>内存 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_57%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_57%>内存 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsePercent, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%ld", &nUsePercent); sscanf((LPCTSTR)strOut2, "%ld", &nTotal); float fRate = (float)(1.0 * nUsePercent); float fMbFree = (float)(nTotal * (100 - fRate) / 100.0); strMsg.Format("%s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_MEMORY", "MEMORY_USED"), fRate, FuncGetStringFromIDS("SV_MEMORY", "MEMORY_FREED"), fMbFree); // <%IDS_AimParser_58%>Memory使用率,<%IDS_AimParser_59%>Memory剩余 strcpy(szOut, (LPCTSTR)strMsg); } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL MemoryParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strTarget2 = _T(""); CString strMsg = _T(""); int nValue = 0; double dwUsed=0 , dwTotal=0 ,dwFree = 0 , dwUsePercent=0; // szSource = "总数: 分配了 1000000K + 保留 5000K = 使用 1005000K, 5000000K 可使用"; bRet = FormatSource(szSource, nMonitorType, lstString, IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("memory", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nUsed = DFNParser_GetPrivateProfileInt("memory", "used", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsed, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { //float dwUsed = atof(strOut1);///1024; dwTotal = atof(strOut2);///1024; //sscanf((LPCTSTR)strOut1, "%f", &dwUsed); //sscanf((LPCTSTR)strOut2, "%f", &dwTotal); if(nTotal == 0) { bRet = FALSE; } else { float fRate = (float)(100 * dwUsed / (1.0 * dwTotal)); float fMbFree = (float)((dwTotal - dwUsed) / (1.0 * 1024 * 1024)); float fMbTotal = (float)(dwTotal/(1.0* 1024 * 1024)); //float fMbTotal = (float)(nTotal/(1.0 * 1024 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nUsed = DFNParser_GetPrivateProfileInt("memory", "used", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); UINT nSwapUnit = DFNParser_GetPrivateProfileInt("memory", "swapunit", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsed, strOut1); GetColumnFromLine(strTarget, nFree, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { dwUsed = atof(strOut1);///1024; dwFree = atof(strOut2);///1024; //sscanf((LPCTSTR)strOut1, "%f", &dwUsed); //sscanf((LPCTSTR)strOut2, "%f", &dwTotal); //sscanf((LPCTSTR)strOut1, "%dk", &nUsed); //sscanf((LPCTSTR)strOut2, "%dk", &nFree); float fRate = (float)(100.0 * dwUsed / (1.0 * (dwUsed + dwFree))); float fMbFree = (float)(dwFree / (1.0 * 1024)); //float fMbTotal = (float)(nUsed+nFree)/(1.0* 1000 * 1024); float fMbTotal = (float)((dwUsed+dwFree)/(1.0 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { //sscanf((LPCTSTR)strOut1, "%d", &nFree); //sscanf((LPCTSTR)strOut2, "%d", &nTotal); dwFree = atof(strOut1);///1024; dwTotal = atof(strOut2);///1024; //sscanf((LPCTSTR)strOut1, "%f", &dwUsed); //sscanf((LPCTSTR)strOut2, "%f", &dwTotal); float fRate = (float)(100.0 * (dwTotal - dwFree) / (1.0 * dwTotal)); float fMbFree = (float)(dwFree / (1.0 * 1024)); //float fMbTotal = (float)nTotal/(1.0* 1000 * 1024); float fMbTotal = (float)(dwTotal/(1.0 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 4) { // compatible with digital os int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); int nFreeLine = DFNParser_GetPrivateProfileInt("memory", "freeLine", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); int nTotalLine = DFNParser_GetPrivateProfileInt("memory", "totalLine", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); UINT nSwapUnit = DFNParser_GetPrivateProfileInt("memory", "swapunit", 0, IniFileName); GetLineString(lstString, nReverse, nFreeLine, strTarget); GetLineString(lstString, nReverse, nTotalLine, strTarget2); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget2, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { //sscanf((LPCTSTR)strOut1, "%ld", &nFree); //sscanf((LPCTSTR)strOut2, "%ld", &nTotal); dwFree = atof(strOut1);///1024; dwTotal = atof(strOut2);///1024; //sscanf((LPCTSTR)strOut1, "%f", &dwUsed); //sscanf((LPCTSTR)strOut2, "%f", &dwTotal); float fRate = (float)(100.0 * (dwTotal - dwFree) / (1.0 * dwTotal)); float fMbFree = (float)(dwFree * nSwapUnit / (1.0 * 1024 * 1024)); float fMbTotal = (float)(dwTotal* nSwapUnit /(1.0* 1024 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 5) { int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nUsePercent = DFNParser_GetPrivateProfileInt("memory", "usePercent", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsePercent, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { //sscanf((LPCTSTR)strOut1, "%ld", &nUsePercent); //sscanf((LPCTSTR)strOut2, "%ld", &nTotal); dwUsePercent = atof(strOut1);///1024; dwTotal = atof(strOut2);///1024; //sscanf((LPCTSTR)strOut1, "%f", &dwUsed); //sscanf((LPCTSTR)strOut2, "%f", &dwTotal); float fRate = (float)(1.0 * dwUsePercent); float fMbFree = (float)(dwTotal * (100 - fRate) / 100.0); //float fMbTotal = (float)nTotal/(1.0* 1000 * 1024); //float fMbTotal = (float)nTotal/(1.0 * 1024); float fMbTotal = (float)dwTotal; strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 6) { // UNIX WARE 内存解析 int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nUsed = DFNParser_GetPrivateProfileInt("memory", "used", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); UINT nSwapUnit = DFNParser_GetPrivateProfileInt("memory", "swapunit", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsed, strOut1); GetColumnFromLine(strTarget, nFree, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { dwUsed = atof(strOut1);///1024; dwFree = atof(strOut2);///1024; float fRate = (float)(100.0 * dwUsed / (1.0 * (dwUsed + dwFree))); float fMbFree = (float)(dwFree / (1.0 * 1024)); fMbFree = fMbFree/2; float fMbTotal = (float)((dwUsed+dwFree)/(1.0 * 1024)); fMbTotal = fMbTotal/2; strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL PMemoryParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; //mtx??? //strcpy(IniFileName,"C:\\SITEVIEW6\\SiteView.DataCollection.WebService\\MonitorManager\\templates.os\\Linux.cmd"); CStringList lstString; CString strTarget = _T(""); CString strTarget2 = _T(""); CString strMsg = _T(""); int nValue = 0; double dwUsed=0 , dwTotal=0 ,dwFree = 0 , dwUsePercent=0; double dwCached = 0; double dwBuffers = 0; // szSource = "总数: 分配了 1000000K + 保留 5000K = 使用 1005000K, 5000000K 可使用"; bRet = FormatSource(szSource, nMonitorType, lstString, IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("memory", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("physicalmemory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("physicalmemory", "startline", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("physicalmemory", "total", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("physicalmemory", "free", 0, IniFileName); UINT nCached = DFNParser_GetPrivateProfileInt("physicalmemory", "cached", 0, IniFileName); UINT nBuffers = DFNParser_GetPrivateProfileInt("physicalmemory", "buffers", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); CString strOut3 = _T(""); CString strOut4 = _T(""); GetColumnFromLine(strTarget, nTotal, strOut1); GetColumnFromLine(strTarget, nFree, strOut2); GetColumnFromLine(strTarget, nCached, strOut3); GetColumnFromLine(strTarget, nBuffers, strOut4); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { //float dwTotal = atof(strOut1);///1024; dwFree = atof(strOut2); dwCached = atof(strOut3); dwBuffers = atof(strOut4); dwFree += dwCached; dwFree += dwBuffers; dwUsed = dwTotal - dwFree; if(nTotal == 0) { bRet = FALSE; } else { float fRate = (float)(dwUsed / (1.0 * dwTotal)); fRate = fRate*100; float fMbFree = (float)(dwFree / (1.0 * 1024)); fMbFree = fMbFree/1024; float fMbTotal = (float)(dwTotal/(1.0* 1024)); fMbTotal = fMbTotal/1024; strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } } else if(nOsType == 2) { // Solaris //----------------------------------------------------------------------------------------------------------- // 更改内容:针对solaris的物理内存信息采取两步获取(prtconf:总物理内存,vmstat:剩余物理内存) // 更改人:邹晓 // 更改时间:2009.02.25 //----------------------------------------------------------------------------------------------------------- if( nMonitorType == TOTAL_PMEMORY ) { int nReverse = DFNParser_GetPrivateProfileInt( "totalPhysicalMemory", "reverselines", 0, IniFileName ); int nStart = DFNParser_GetPrivateProfileInt( "totalPhysicalMemory", "startline", 0, IniFileName ); UINT nTotal = DFNParser_GetPrivateProfileInt( "totalPhysicalMemory", "value", 0, IniFileName ); UINT nUnit = DFNParser_GetPrivateProfileInt( "totalPhysicalMemory", "unit", 0, IniFileName ); GetLineString( lstString, nReverse, nStart, strTarget ); CString strOut = _T( "" ); GetColumnFromLine( strTarget, nTotal, strOut ); if( strOut.IsEmpty() ) bRet = FALSE; else { float fTotalMemory = atof( strOut ); fTotalMemory = fTotalMemory * (float)nUnit; strMsg.Format("totalMemory=%.2f$", fTotalMemory ); strcpy(szOut, (LPCTSTR)strMsg); } } else if( nMonitorType == FREE_PMEMORY ) { int nReverse = DFNParser_GetPrivateProfileInt( "freePhysicalMemory", "reverselines", 0, IniFileName ); int nStart = DFNParser_GetPrivateProfileInt( "freePhysicalMemory", "startline", 0, IniFileName ); UINT nFree = DFNParser_GetPrivateProfileInt( "freePhysicalMemory", "value", 0, IniFileName ); UINT nUnit = DFNParser_GetPrivateProfileInt( "freePhysicalMemory", "unit", 0, IniFileName ); GetLineString( lstString, nReverse, nStart, strTarget ); CString strOut = _T( "" ); GetColumnFromLine( strTarget, nFree, strOut ); if( strOut.IsEmpty() ) bRet = FALSE; else { float fFreeMemory = atof( strOut ); fFreeMemory = fFreeMemory * (float)nUnit; strMsg.Format("freeMemory=%.2f$", fFreeMemory ); strcpy(szOut, (LPCTSTR)strMsg); } }// 结束更改 else { int nReverse = DFNParser_GetPrivateProfileInt("physicalmemory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("physicalmemory", "startline", 0, IniFileName); UINT nReal = DFNParser_GetPrivateProfileInt("physicalmemory", "real", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("physicalmemory", "free", 0, IniFileName); UINT nSwapUnit = DFNParser_GetPrivateProfileInt("physicalmemory", "memunit", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nReal, strOut1); GetColumnFromLine(strTarget, nFree, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { dwFree = atof(strOut2); float fMbFree = (float)(dwFree / (1.0 * 1024)); float fMbTotal = atof(strOut1); float fRate = (fMbTotal- fMbFree)/ fMbTotal; fRate = fRate*100; strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { //sscanf((LPCTSTR)strOut1, "%d", &nFree); //sscanf((LPCTSTR)strOut2, "%d", &nTotal); dwFree = atof(strOut1);///1024; dwTotal = atof(strOut2);///1024; //sscanf((LPCTSTR)strOut1, "%f", &dwUsed); //sscanf((LPCTSTR)strOut2, "%f", &dwTotal); float fRate = (float)(100.0 * (dwTotal - dwFree) / (1.0 * dwTotal)); float fMbFree = (float)(dwFree / (1.0 * 1024)); //float fMbTotal = (float)nTotal/(1.0* 1000 * 1024); float fMbTotal = (float)(dwTotal/(1.0 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 4) { // compatible with digital os int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); int nFreeLine = DFNParser_GetPrivateProfileInt("memory", "freeLine", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); int nTotalLine = DFNParser_GetPrivateProfileInt("memory", "totalLine", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); UINT nSwapUnit = DFNParser_GetPrivateProfileInt("memory", "swapunit", 0, IniFileName); GetLineString(lstString, nReverse, nFreeLine, strTarget); GetLineString(lstString, nReverse, nTotalLine, strTarget2); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget2, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { //sscanf((LPCTSTR)strOut1, "%ld", &nFree); //sscanf((LPCTSTR)strOut2, "%ld", &nTotal); dwFree = atof(strOut1);///1024; dwTotal = atof(strOut2);///1024; //sscanf((LPCTSTR)strOut1, "%f", &dwUsed); //sscanf((LPCTSTR)strOut2, "%f", &dwTotal); float fRate = (float)(100.0 * (dwTotal - dwFree) / (1.0 * dwTotal)); float fMbFree = (float)(dwFree * nSwapUnit / (1.0 * 1024 * 1024)); float fMbTotal = (float)(dwTotal/(1.0* 1024 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 5)//AIX { //----------------------------------------------------------------------------------------------------------- // 更改内容:针对aix的物理内存信息采取两步获取(prtconf:总物理内存,vmstat:剩余物理内存) // 更改人:邹晓 // 更改时间:2009.02.25 //----------------------------------------------------------------------------------------------------------- if( nMonitorType == TOTAL_PMEMORY ) { int nReverse = DFNParser_GetPrivateProfileInt( "totalPhysicalMemory", "reverselines", 0, IniFileName ); int nStart = DFNParser_GetPrivateProfileInt( "totalPhysicalMemory", "startline", 0, IniFileName ); UINT nTotal = DFNParser_GetPrivateProfileInt( "totalPhysicalMemory", "value", 0, IniFileName ); UINT nUnit = DFNParser_GetPrivateProfileInt( "totalPhysicalMemory", "unit", 0, IniFileName ); GetLineString( lstString, nReverse, nStart, strTarget ); CString strOut = _T( "" ); GetColumnFromLine( strTarget, nTotal, strOut ); if( strOut.IsEmpty() ) bRet = FALSE; else { float fTotalMemory = atof( strOut ); fTotalMemory = fTotalMemory * (float)nUnit; strMsg.Format("totalMemory=%.2f$", fTotalMemory ); strcpy(szOut, (LPCTSTR)strMsg); } } else if( nMonitorType == FREE_PMEMORY ) { int nReverse = DFNParser_GetPrivateProfileInt( "freePhysicalMemory", "reverselines", 0, IniFileName ); int nStart = DFNParser_GetPrivateProfileInt( "freePhysicalMemory", "startline", 0, IniFileName ); UINT nFree = DFNParser_GetPrivateProfileInt( "freePhysicalMemory", "value", 0, IniFileName ); UINT nUnit = DFNParser_GetPrivateProfileInt( "freePhysicalMemory", "unit", 0, IniFileName ); GetLineString( lstString, nReverse, nStart, strTarget ); CString strOut = _T( "" ); GetColumnFromLine( strTarget, nFree, strOut ); if( strOut.IsEmpty() ) bRet = FALSE; else { float fFreeMemory = atof( strOut ); fFreeMemory = fFreeMemory * (float)nUnit; strMsg.Format("freeMemory=%.2f$", fFreeMemory ); strcpy(szOut, (LPCTSTR)strMsg); } }// 结束更改 else { int nReverse = DFNParser_GetPrivateProfileInt("physicalmemory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("physicalmemory", "startline", 0, IniFileName); UINT nSize = DFNParser_GetPrivateProfileInt("physicalmemory", "size", 0, IniFileName); UINT nInuse = DFNParser_GetPrivateProfileInt("physicalmemory", "inuse", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("physicalmemory", "free", 0, IniFileName); CString str; str.Format("nReverse=%d, nStart=%d, nSize=%d, nInuse=%d, nFree=%d", nReverse, nStart, nSize, nInuse, nFree); OutputDebugString((LPCSTR)str); //zjw GetLineString(lstString, nReverse, nStart, strTarget); OutputDebugString((LPCSTR)strTarget); //zjw CString strOut1 = _T(""); CString strOut2 = _T(""); CString strOut3 = _T(""); GetColumnFromLine(strTarget, nSize, strOut1); GetColumnFromLine(strTarget, nInuse, strOut2); GetColumnFromLine(strTarget, nFree, strOut3); str.Format("%s, %s, %s", strOut1, strOut2, strOut3); OutputDebugString((LPCSTR)str); //zjw if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { dwUsePercent = atof(strOut2)/atof(strOut1);///1024; dwTotal = atof(strOut1)*4/1024;///1024; float fRate = (float)(1.0 * dwUsePercent); float fMbFree = atof(strOut3)*4/1024; float fMbTotal = (float)dwTotal; fRate = fRate*100; strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL MemoryParser_zw(const char * szSource, const int nMonitorType, char *szOut, const char *FileName, const char* szTotalMem) { BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; // printf("get it\n"); CStringList lstString; CString strTarget = _T(""); CString strTarget2 = _T(""); CString strMsg = _T(""); double dwUsed = 0.0; double dwFree = 0.0; int nValue = 0; long lTotalMem = 0; lTotalMem = atol(szTotalMem); bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("memory", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nUsed = DFNParser_GetPrivateProfileInt("memory", "used", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); // printf("lnux\n"); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsed, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { //sscanf((LPCTSTR)strOut1, "%dk", &nUsed); dwUsed = atof(strOut1); //sscanf((LPCTSTR)strOut2, "%dk", &nTotal); if(nTotal == 0) { bRet = FALSE; } else { float fRate = (float)(100.0 * dwUsed / (1.0 * lTotalMem*1024*1024)); float fMbFree = (float)(lTotalMem - dwUsed / (1.0 * 1024 * 1024)); //float fMbTotal = (float)(lTotalMem/(1.0* 1024 * 1024)); float fMbTotal = (float)(lTotalMem); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nUsed = DFNParser_GetPrivateProfileInt("memory", "used", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); UINT nSwapUnit = DFNParser_GetPrivateProfileInt("memory", "swapunit", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsed, strOut1); GetColumnFromLine(strTarget, nFree, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%dk", &nUsed); sscanf((LPCTSTR)strOut2, "%dk", &nFree); float fRate = (float)(100.0 * nUsed / (1.0 * (nUsed + nFree))); float fMbFree = (float)(nFree / (1.0 * 1024)); float fMbTotal = (float)((nUsed+nFree)/(1.0 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); // GetColumnFromLine(strTarget, nTotal, strOut2); //if (strOut1.IsEmpty() || strOut2.IsEmpty()) if (strOut1.IsEmpty()) bRet = FALSE; else { // sscanf((LPCTSTR)strOut1, "%d", &dwUsed); // sscanf((LPCTSTR)strOut2, "%d", &nTotal); dwFree = atof(strOut1); float fRate = (float)(100.0 * (lTotalMem*1024 - dwFree) / (1.0 * lTotalMem*1024)); float fMbFree = (float)(dwFree / (1.0 * 1024)); float fMbTotal = (float)lTotalMem; strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 4) { // compatible with digital os int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); int nFreeLine = DFNParser_GetPrivateProfileInt("memory", "freeLine", 0, IniFileName); UINT nFree = DFNParser_GetPrivateProfileInt("memory", "free", 0, IniFileName); int nTotalLine = DFNParser_GetPrivateProfileInt("memory", "totalLine", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); UINT nSwapUnit = DFNParser_GetPrivateProfileInt("memory", "swapunit", 0, IniFileName); GetLineString(lstString, nReverse, nFreeLine, strTarget); GetLineString(lstString, nReverse, nTotalLine, strTarget2); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget2, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%ld", &nFree); sscanf((LPCTSTR)strOut2, "%ld", &nTotal); float fRate = (float)(100.0 * (nTotal - nFree) / (1.0 * nTotal)); float fMbFree = (float)(nFree * nSwapUnit / (1.0 * 1024 * 1024)); float fMbTotal = (float)(nTotal/(1.0* 1000 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 5) { int nReverse = DFNParser_GetPrivateProfileInt("memory", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("memory", "startline", 0, IniFileName); UINT nUsePercent = DFNParser_GetPrivateProfileInt("memory", "usePercent", 0, IniFileName); UINT nTotal = DFNParser_GetPrivateProfileInt("memory", "total", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); GetColumnFromLine(strTarget, nUsePercent, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); if (strOut1.IsEmpty() || strOut2.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%ld", &nUsePercent); sscanf((LPCTSTR)strOut2, "%ld", &nTotal); float fRate = (float)(1.0 * nUsePercent); float fMbFree = (float)(nTotal * (100 - fRate) / 100.0); float fMbTotal = (float)(nTotal/(1.0* 1000 * 1024)); strMsg.Format("percentUsed=%.2f$Mbfree=%.2f$pagesPerSec=0.0$TotalMemory=%.2f$", fRate, fMbFree, fMbTotal); strcpy(szOut, (LPCTSTR)strMsg); } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL DiskParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString, IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("disk", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("disk", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("disk", "startline", 0, IniFileName); int nFree = DFNParser_GetPrivateProfileInt("disk", "free", 0, IniFileName); int nTotal = DFNParser_GetPrivateProfileInt("disk", "total", 0, IniFileName); int nPercentUsed = DFNParser_GetPrivateProfileInt("disk", "percentused", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); CString strOut3 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); GetColumnFromLine(strTarget, nPercentUsed, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) { GetLineString(lstString, nReverse, nStart+1, strTarget); GetColumnFromLine(strTarget, nFree - 1, strOut1); GetColumnFromLine(strTarget, nTotal - 1, strOut2); GetColumnFromLine(strTarget, nPercentUsed - 1, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); float fper=(float)((100.00-fPercentFull)/100.00); //Edit By Kevin.Yang float fTotalSize= (float)(nTotal / (1.0 * 1024)); //(fper<=0)?0:fMbFree/fper; //wangpeng strMsg.Format("percentFull=%.2f$Mbfree=%.2f$", fPercentFull, fMbFree); //strMsg.Format("percentFull=%.2f$Mbfree=%.2f$TotalSize=%.2f$", fPercentFull, fMbFree,fTotalSize); strcpy(szOut, (LPCTSTR)strMsg); } } else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); float fper=(float)((100.00-fPercentFull)/100.00); float fTotalSize= (float)(nTotal / (1.0 * 1024)); //(fper<=0)?0:fMbFree/fper; //wangpeng //strMsg.Format("percentFull=%.2f$Mbfree=%.2f$TotalSize=%.2f$", fPercentFull, fMbFree,fTotalSize); strMsg.Format("percentFull=%.2f$Mbfree=%.2f$", fPercentFull, fMbFree); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("disk", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("disk", "startline", 0, IniFileName); int nFree = DFNParser_GetPrivateProfileInt("disk", "free", 0, IniFileName); int nTotal = DFNParser_GetPrivateProfileInt("disk", "total", 0, IniFileName); int nPercentUsed = DFNParser_GetPrivateProfileInt("disk", "percentused", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); CString strOut3 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); GetColumnFromLine(strTarget, nPercentUsed, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) { GetLineString(lstString, nReverse, nStart + 1, strTarget); GetColumnFromLine(strTarget, nFree - 1, strOut1); GetColumnFromLine(strTarget, nTotal - 1, strOut2); GetColumnFromLine(strTarget, nPercentUsed - 1, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); float fper=(float)((100.00-fPercentFull)/100.00); float fTotalSize= (float)(nTotal / (1.0 * 1024)); //(fper<=0)?0:fMbFree/fper; //wangpeng //strMsg.Format("percentFull=%.2f$Mbfree=%.2f$TotalSize=%.2f$", fPercentFull, fMbFree,fTotalSize); strMsg.Format("percentFull=%.2f$Mbfree=%.2f$", fPercentFull, fMbFree); strcpy(szOut, (LPCTSTR)strMsg); } } else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); float fper=(float)((100.00-fPercentFull)/100.00); float fTotalSize= (float)(nTotal / (1.0 * 1024)); //(fper<=0)?0:fMbFree/fper; // strMsg.Format("percentFull=%.2f$Mbfree=%.2f$TotalSize=%.2f$", fPercentFull, fMbFree,fTotalSize); //wangpeng strMsg.Format("percentFull=%.2f$Mbfree=%.2f$", fPercentFull, fMbFree); strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("disk", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("disk", "startline", 0, IniFileName); int nFree = DFNParser_GetPrivateProfileInt("disk", "free", 0, IniFileName); int nTotal = DFNParser_GetPrivateProfileInt("disk", "total", 0, IniFileName); int nPercentUsed = DFNParser_GetPrivateProfileInt("disk", "percentused", 0, IniFileName); GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); CString strOut2 = _T(""); CString strOut3 = _T(""); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); GetColumnFromLine(strTarget, nPercentUsed, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) { GetLineString(lstString, nReverse, nStart + 1, strTarget); GetColumnFromLine(strTarget, nFree - 1, strOut1); GetColumnFromLine(strTarget, nTotal - 1, strOut2); GetColumnFromLine(strTarget, nPercentUsed - 1, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); float fper=(float)((100.00-fPercentFull)/100.00); float fTotalSize= (float)(nTotal / (1.0 * 1024)); //(fper<=0)?0:fMbFree/fper; //wangpeng //strMsg.Format("percentFull=%.2f$Mbfree=%.2f$TotalSize=%.2f$", fPercentFull, fMbFree,fTotalSize); strMsg.Format("percentFull=%.2f$Mbfree=%.2f$", fPercentFull, fMbFree); strcpy(szOut, (LPCTSTR)strMsg); } } else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); float fper=(float)((100.00-fPercentFull)/100.00); float fTotalSize= (float)(nTotal / (1.0 * 1024)); //(fper<=0)?0:fMbFree/fper; // strMsg.Format("percentFull=%.2f$Mbfree=%.2f$TotalSize=%.2f$", fPercentFull, fMbFree,fTotalSize); strMsg.Format("percentFull=%.2f$Mbfree=%.2f$", fPercentFull, fMbFree); strcpy(szOut, (LPCTSTR)strMsg); } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL DiskParserTest(const char * szSource, const int nTelInfo, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { if(nTelInfo & 0x02) { int count = 1; POSITION pos = lstString.FindIndex(0); while(pos) printf("Line %2.2d: %s<br>\r\n", count++, lstString.GetNext(pos)); printf("<br>\r\n"); fflush(stdout); } int nOsType = DFNParser_GetPrivateProfileInt("disk", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nReverse = DFNParser_GetPrivateProfileInt("disk", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("disk", "startline", 0, IniFileName); int nName = DFNParser_GetPrivateProfileInt("disks", "name", 0, IniFileName); int nFree = DFNParser_GetPrivateProfileInt("disk", "free", 0, IniFileName); int nTotal = DFNParser_GetPrivateProfileInt("disk", "total", 0, IniFileName); int nPercentUsed = DFNParser_GetPrivateProfileInt("disk", "percentused", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"name\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_60%>"), nName); // <%IDS_AimParser_60%>磁盘空间 命令设置 printf("%s \"use percent\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_61%>"), nPercentUsed); // <%IDS_AimParser_61%>磁盘空间 命令设置 printf("%s \"free\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_62%>"), nFree); // <%IDS_AimParser_62%>磁盘空间 命令设置 printf("%s \"total\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_63%>"), nTotal); // <%IDS_AimParser_63%>磁盘空间 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_64%>"), nStart); // <%IDS_AimParser_64%>磁盘空间 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_65%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_65%>磁盘空间 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut0 = _T(""); CString strOut1 = _T(""); CString strOut2 = _T(""); CString strOut3 = _T(""); GetColumnFromLine(strTarget, nName, strOut0); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); GetColumnFromLine(strTarget, nPercentUsed, strOut3); if (strOut0.IsEmpty() || strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) { GetLineString(lstString, nReverse, nStart+1, strTarget); GetColumnFromLine(strTarget, nFree - 1, strOut1); GetColumnFromLine(strTarget, nTotal - 1, strOut2); GetColumnFromLine(strTarget, nPercentUsed - 1, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); strMsg.Format(" %s[%s] %s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_DISK","DISK_DESC"), strOut0, FuncGetStringFromIDS("SV_DISK","DISK_USED"), fPercentFull, FuncGetStringFromIDS("SV_DISK","DISK_FREED"), fMbFree); // <%IDS_AimParser_66%>磁盘,<%IDS_AimParser_67%>使用率,<%IDS_AimParser_68%>剩余空间 strcpy(szOut, (LPCTSTR)strMsg); } } else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); strMsg.Format("%s [%s] %s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_DISK","DISK_DESC"), strOut0, FuncGetStringFromIDS("SV_DISK","DISK_USED"), fPercentFull, FuncGetStringFromIDS("SV_DISK","DISK_FREED"), fMbFree); // <%IDS_AimParser_69%>,<%IDS_AimParser_70%>,<%IDS_AimParser_71%> strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 2) { // Solaris int nReverse = DFNParser_GetPrivateProfileInt("disk", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("disk", "startline", 0, IniFileName); int nName = DFNParser_GetPrivateProfileInt("disks", "name", 0, IniFileName); int nFree = DFNParser_GetPrivateProfileInt("disk", "free", 0, IniFileName); int nTotal = DFNParser_GetPrivateProfileInt("disk", "total", 0, IniFileName); int nPercentUsed = DFNParser_GetPrivateProfileInt("disk", "percentused", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"name\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_72%>"), nName); // <%IDS_AimParser_72%>磁盘空间 命令设置 printf("%s \"use percent\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_73%>"), nPercentUsed); // <%IDS_AimParser_73%>磁盘空间 命令设置 printf("%s \"free\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_74%>"), nFree); // <%IDS_AimParser_74%>磁盘空间 命令设置 printf("%s \"total\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_75%>"), nTotal); // <%IDS_AimParser_75%>磁盘空间 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_76%>"), nStart); // <%IDS_AimParser_76%>磁盘空间 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_77%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_77%>磁盘空间 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut0 = _T(""); CString strOut1 = _T(""); CString strOut2 = _T(""); CString strOut3 = _T(""); GetColumnFromLine(strTarget, nName, strOut0); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); GetColumnFromLine(strTarget, nPercentUsed, strOut3); if (strOut0.IsEmpty() || strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) { GetLineString(lstString, nReverse, nStart + 1, strTarget); GetColumnFromLine(strTarget, nFree - 1, strOut1); GetColumnFromLine(strTarget, nTotal - 1, strOut2); GetColumnFromLine(strTarget, nPercentUsed - 1, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); strMsg.Format("%s [%s] %s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_DISK","DISK_DESC"), strOut0, FuncGetStringFromIDS("SV_DISK","DISK_USED"), fPercentFull, FuncGetStringFromIDS("SV_DISK","DISK_FREED"), fMbFree); // <%IDS_AimParser_78%>,<%IDS_AimParser_79%>,<%IDS_AimParser_80%> strcpy(szOut, (LPCTSTR)strMsg); } } else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); strMsg.Format("%s [%s] %s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_DISK","DISK_DESC"), strOut0, FuncGetStringFromIDS("SV_DISK","DISK_USED"), fPercentFull, FuncGetStringFromIDS("SV_DISK","DISK_FREED"), fMbFree); // <%IDS_AimParser_81%>,<%IDS_AimParser_82%>,<%IDS_AimParser_83%> strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("disk", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("disk", "startline", 0, IniFileName); int nName = DFNParser_GetPrivateProfileInt("disks", "name", 0, IniFileName); int nFree = DFNParser_GetPrivateProfileInt("disk", "free", 0, IniFileName); int nTotal = DFNParser_GetPrivateProfileInt("disk", "total", 0, IniFileName); int nPercentUsed = DFNParser_GetPrivateProfileInt("disk", "percentused", 0, IniFileName); if(nTelInfo & 0x02) { printf("%s \"name\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_84%>"), nName); // <%IDS_AimParser_84%>磁盘空间 命令设置 printf("%s \"use percent\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_85%>"), nPercentUsed); // <%IDS_AimParser_85%>磁盘空间 命令设置 printf("%s \"free\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_86%>"), nFree); // <%IDS_AimParser_86%>磁盘空间 命令设置 printf("%s \"total\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_87%>"), nTotal); // <%IDS_AimParser_87%>磁盘空间 命令设置 printf("%s \"startLine\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_88%>"), nStart); // <%IDS_AimParser_88%>磁盘空间 命令设置 printf("%s \"reverseLines\": %s <br><br>\r\n\r\n", FuncGetStringFromIDS("<%IDS_AimParser_89%>"), nReverse ? "true" : "false"); // <%IDS_AimParser_89%>磁盘空间 命令设置 fflush(stdout); } GetLineString(lstString, nReverse, nStart, strTarget); CString strOut0 = _T(""); CString strOut1 = _T(""); CString strOut2 = _T(""); CString strOut3 = _T(""); GetColumnFromLine(strTarget, nName, strOut0); GetColumnFromLine(strTarget, nFree, strOut1); GetColumnFromLine(strTarget, nTotal, strOut2); GetColumnFromLine(strTarget, nPercentUsed, strOut3); if (strOut0.IsEmpty() || strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) { GetLineString(lstString, nReverse, nStart + 1, strTarget); GetColumnFromLine(strTarget, nFree - 1, strOut1); GetColumnFromLine(strTarget, nTotal - 1, strOut2); GetColumnFromLine(strTarget, nPercentUsed - 1, strOut3); if (strOut1.IsEmpty() || strOut2.IsEmpty() || strOut3.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); strMsg.Format("%s [%s] %s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_DISK","DISK_DESC"), strOut0, FuncGetStringFromIDS("SV_DISK","DISK_USED"), fPercentFull, FuncGetStringFromIDS("SV_DISK","DISK_FREED"), fMbFree); // <%IDS_AimParser_90%>,<%IDS_AimParser_91%>,<%IDS_AimParser_92%> strcpy(szOut, (LPCTSTR)strMsg); } } else { sscanf((LPCTSTR)strOut1, "%d", &nFree); sscanf((LPCTSTR)strOut2, "%d", &nTotal); sscanf((LPCTSTR)strOut3, "%d%%", &nPercentUsed); float fPercentFull = (float)(1.0 * nPercentUsed); float fMbFree = (float)(nFree / (1.0 * 1024)); strMsg.Format("%s [%s] %s(%%): %.2f %s: %.2f", FuncGetStringFromIDS("SV_DISK","DISK_DESC"), strOut0, FuncGetStringFromIDS("SV_DISK","DISK_USED"), fPercentFull, FuncGetStringFromIDS("SV_DISK","DISK_FREED"), fMbFree); // <%IDS_AimParser_93%>,<%IDS_AimParser_94%>,<%IDS_AimParser_95%> strcpy(szOut, (LPCTSTR)strMsg); } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL UserCPUParser(const char * szSource, const int nMonitorType, char *szOut, const char* szUserName, const char *FileName) { char szTemp[1024] = {0}; WriteLog("============== UserCPUParser =============="); WriteLog( szSource ); WriteLog( szUserName ); WriteLog( FileName ); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) { return bRet; } CStringList lstString; CStringList lstProcs; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; int nUserColumn = 0; int nCPUColumn = 0; int nPIDColumn = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("usercpu", "ostype", 0, IniFileName); int j = 0; if ( 1 )// aix { CString strIn = lstString.GetHead(); char buffer[32] = {0}; WriteLog( "fileName:" ); WriteLog( IniFileName ); // 从配置文件中获取userColumn DFNParser_GetPrivateProfileString( "usercpu", "userColumnName", "", buffer, sizeof(buffer), IniFileName ); bRet = GetColumnIndex( strIn, nUserColumn, buffer ); sprintf( szTemp, "userColumn=%d", nUserColumn ); WriteLog( szTemp ); if (bRet) { int nTempColumn = DFNParser_GetPrivateProfileInt( "usercpu", "userColumnIndex", 0, IniFileName ); if( nTempColumn ) { if( nTempColumn != nUserColumn ) { nUserColumn = nTempColumn; } } } // 从配置文件中获取cpuColumn DFNParser_GetPrivateProfileString( "usercpu", "CPUColumnName", "", buffer, sizeof(buffer), IniFileName ); bRet = GetColumnIndex( strIn, nCPUColumn, buffer ); sprintf( szTemp, "cpuColumn=%d", nCPUColumn ); WriteLog( szTemp ); if (bRet) { int nTempColumn = DFNParser_GetPrivateProfileInt( "usercpu", "CPUColumnIndex", 0, IniFileName ); if( nTempColumn ) { if( nTempColumn != nCPUColumn ) { nCPUColumn = nTempColumn; } } } // 从配置文件中获取PIDColumn DFNParser_GetPrivateProfileString( "usercpu", "PIDColumnName", "", buffer, sizeof(buffer), IniFileName ); bRet = GetColumnIndex( strIn, nPIDColumn, buffer ); sprintf( szTemp, "PIDColumn=%d", nPIDColumn ); WriteLog( szTemp ); WriteLog("============== 循环匹配: =============="); CString strUserName = _T(""); CString strPID = _T(""); std::list<string> listPID; std::list<string>::iterator it; bool bWhile(true); float fCPU(0.0); POSITION pos = lstString.GetHeadPosition(); strTarget = lstString.GetNext(pos); while( pos ) { strTarget = lstString.GetNext(pos); sprintf( szTemp, "string=%s", strTarget.GetBuffer(strTarget.GetLength()) ); WriteLog( szTemp ); /* GetColumnFromLine( strTarget, nPIDColumn, strPID, nMonitorType ); strUserName.TrimRight(" "); sprintf( szTemp, "PID=%s", strPID.GetBuffer(strPID.GetLength()) ); WriteLog( szTemp ); for( it=listPID.begin(); it!=listPID.end(); it++ ) { if( it->compare(strPID.GetBuffer(strPID.GetLength())) == 0 ) { bWhile = false; break; } } if( !bWhile ) { break; } else { listPID.push_back( strPID.GetBuffer(strPID.GetLength()) ); } */ GetColumnFromLine( strTarget, nUserColumn, strUserName, nMonitorType ); strPID.TrimRight(" "); sprintf( szTemp, "userName=%s", strUserName.GetBuffer(strUserName.GetLength()) ); WriteLog( szTemp ); if ( !stricmp((LPCTSTR)strUserName, szUserName) ) { CString strCPU = _T(""); GetColumnFromLine( strTarget, nCPUColumn, strCPU, nMonitorType ); strCPU.TrimRight(" "); sprintf( szTemp, "cpu=%s", strCPU.GetBuffer(strCPU.GetLength()) ); WriteLog( szTemp ); fCPU += atof( strCPU.GetBuffer(strCPU.GetLength()) ); } } sprintf( szOut, "user=%s$cpu=%.1f", szUserName, fCPU ); WriteLog( szOut ); } } } extern "C" __declspec(dllexport) BOOL ServiceParser(const char * szSource, const int nMonitorType, char *szOut, const char* szProcName, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CStringList lstProcs; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; int nColumn = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("service", "ostype", 0, IniFileName); int j = 0; if (nOsType == 1) { // Linux bRet = GetColumnIndex(lstString, nColumn,IniFileName); if (bRet) { int nTempColumn = DFNParser_GetPrivateProfileInt("service", "namecolumnindex", 0, IniFileName); if (nTempColumn) { if (nTempColumn != nColumn) nColumn = nTempColumn; } POSITION pos = lstString.GetHeadPosition(); CString strOut = _T(""); int nProcesses = 0; while (pos) { strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nColumn, strOut, nMonitorType); strOut.TrimRight(" "); //puts(strOut); j++; if (szProcName == NULL) { if (j <= 1) continue; POSITION pos1= lstProcs.GetHeadPosition(); if (pos1) { BOOL bFound = FALSE; while (pos1) { CString strProc = lstProcs.GetNext(pos1); if (!strProc.Compare((LPCTSTR)strOut)) { bFound = TRUE; break; } } if (!bFound) { lstProcs.AddTail(strOut); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut); } } else { lstProcs.AddTail(strOut); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut); } } else { if (!stricmp((LPCTSTR)strOut, szProcName)) { //if (!strOut.Compare(szProcName)) { nProcesses++; } } } if(szProcName != NULL) { strMsg.Format("Processes=%d$", nProcesses); strcpy(szOut, (LPCTSTR)strMsg); } } } else if(nOsType == 2) { // Solaris bRet = GetColumnIndex(lstString, nColumn,IniFileName); if (bRet) { int nTempColumn = DFNParser_GetPrivateProfileInt("service", "namecolumnindex", 0, IniFileName); if (nTempColumn) { if (nTempColumn != nColumn) nColumn = nTempColumn; } POSITION pos = lstString.GetHeadPosition(); CString strOut = _T(""); int nProcesses = 0; while (pos) { strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nColumn, strOut, nMonitorType); strOut.TrimRight(" "); j++; if ((szProcName == NULL)) { if (j <= 1) continue; POSITION pos1= lstProcs.GetHeadPosition(); if (pos1) { BOOL bFound = FALSE; while (pos1) { CString strProc = lstProcs.GetNext(pos1); if (!strProc.Compare((LPCTSTR)strOut)) { bFound = TRUE; break; } } if (!bFound) { lstProcs.AddTail(strOut); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut); } } else { lstProcs.AddTail(strOut); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut); } } else { if (!strOut.Compare(szProcName)) { nProcesses++; } } } if(szProcName != NULL) { strMsg.Format("Processes=%d$", nProcesses); strcpy(szOut, (LPCTSTR)strMsg); } } } else if(nOsType == 3) { // FreeBSD bRet = GetColumnIndex(lstString, nColumn,IniFileName); if (bRet) { int nTempColumn = DFNParser_GetPrivateProfileInt("service", "namecolumnindex", 0, IniFileName); if (nTempColumn) { if (nTempColumn != nColumn) nColumn = nTempColumn; } POSITION pos = lstString.GetHeadPosition(); CString strOut = _T(""); int nProcesses = 0; while (pos) { strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nColumn, strOut, nMonitorType); strOut.TrimRight(" "); j++; if (szProcName == NULL) { if (j <= 1) continue; POSITION pos1= lstProcs.GetHeadPosition(); if (pos1) { BOOL bFound = FALSE; while (pos1) { CString strProc = lstProcs.GetNext(pos1); if (!strProc.Compare((LPCTSTR)strOut)) { bFound = TRUE; break; } } if (!bFound) { lstProcs.AddTail(strOut); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut); } } else { lstProcs.AddTail(strOut); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut); } } else { if (!stricmp((LPCTSTR)strOut, szProcName)) { //if (!strOut.Compare(szProcName)) { nProcesses++; } } } if(szProcName != NULL) { strMsg.Format("Processes=%d$", nProcesses); strcpy(szOut, (LPCTSTR)strMsg); } } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL ServiceParserTest(const char * szSource, const int nTelInfo, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char szProcName[1024] = {0}; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CStringList lstProcs; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; int nColumn = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { if(nTelInfo & 0x02) { int count = 1; POSITION pos = lstString.FindIndex(0); while(pos) printf("Line %2.2d: %s<br>\r\n", count++, lstString.GetNext(pos)); printf("<br>\r\n"); fflush(stdout); } int nOsType = DFNParser_GetPrivateProfileInt("service", "ostype", 0, IniFileName); int j = 0; if (nOsType == 1) { // Linux bRet = GetColumnIndex(lstString, nColumn,IniFileName); if (bRet) { int nTempColumn = DFNParser_GetPrivateProfileInt("service", "namecolumnindex", 0, IniFileName); if (nTempColumn) { if (nTempColumn != nColumn) nColumn = nTempColumn; } if(nTelInfo & 0x02) { printf("%s \"namecolumnindex\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_96%>"), nColumn); // <%IDS_AimParser_96%>SERVICE 命令设置 fflush(stdout); } POSITION pos = lstString.GetHeadPosition(); CString strOut = _T(""); int nProcesses = 0; while (pos) { strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nColumn, strOut, nMonitorType); strOut.TrimRight(" "); j++; if(j <= 1) continue; else if(j == 2) strcpy(szProcName ,strOut.GetBuffer(strOut.GetLength())); if (!strOut.Compare(szProcName)) { nProcesses++; } } strMsg.Format("Service [%s] %s %d", szProcName, FuncGetStringFromIDS("SV_SERVICE","SERVICE_DESC"), nProcesses); // <%IDS_AimParser_97%>运行实例: strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 2) { // Solaris bRet = GetColumnIndex(lstString, nColumn,IniFileName); if (bRet) { int nTempColumn = DFNParser_GetPrivateProfileInt("service", "namecolumnindex", 0, IniFileName); if (nTempColumn) { if (nTempColumn != nColumn) nColumn = nTempColumn; } if(nTelInfo & 0x02) { printf("%s \"namecolumnindex\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_98%>"), nColumn); // <%IDS_AimParser_98%>SERVICE 命令设置 fflush(stdout); } POSITION pos = lstString.GetHeadPosition(); CString strOut = _T(""); int nProcesses = 0; while (pos) { strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nColumn, strOut, nMonitorType); strOut.TrimRight(" "); j++; if(j <= 1) continue; else if(j == 2) strcpy(szProcName ,strOut.GetBuffer(strOut.GetLength())); if (!strOut.Compare(szProcName)) { nProcesses++; } } strMsg.Format("Service [%s] %s %d", szProcName, FuncGetStringFromIDS("SV_SERVICE","SERVICE_DESC"), nProcesses); // <%IDS_AimParser_99%>运行实例: strcpy(szOut, (LPCTSTR)strMsg); } } else if(nOsType == 3) { // FreeBSD bRet = GetColumnIndex(lstString, nColumn,IniFileName); if (bRet) { int nTempColumn = DFNParser_GetPrivateProfileInt("service", "namecolumnindex", 0, IniFileName); if (nTempColumn) { if (nTempColumn != nColumn) nColumn = nTempColumn; } if(nTelInfo & 0x02) { printf("%s \"namecolumnindex\": %d <br>\r\n", FuncGetStringFromIDS("<%IDS_AimParser_100%>"), nColumn); // <%IDS_AimParser_100%>SERVICE 命令设置 fflush(stdout); } POSITION pos = lstString.GetHeadPosition(); CString strOut = _T(""); int nProcesses = 0; while (pos) { strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nColumn, strOut, nMonitorType); strOut.TrimRight(" "); j++; if(j <= 1) continue; else if(j == 2) strcpy(szProcName ,strOut.GetBuffer(strOut.GetLength())); if (!strOut.Compare(szProcName)) { nProcesses++; } } strMsg.Format("Service [%s] %s %d", szProcName, FuncGetStringFromIDS("SV_SERVICE","SERVICE_DESC"), nProcesses); // <%IDS_AimParser_101%>运行实例: strcpy(szOut, (LPCTSTR)strMsg); } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } BOOL GetColumnIndex(CStringList& lstStr, int& nColumn,char*IniFileName) { BOOL bRet = FALSE; char buffer[32] = {0}; DFNParser_GetPrivateProfileString("service", "namecolumnname", "", buffer, sizeof(buffer), IniFileName); CString strIn = lstStr.GetHead(); int nLen = strIn.GetLength(); TCHAR ch; CString str = _T(""); int j = 0; for (int i = 0; i < nLen; i++) { ch = strIn.GetAt(i); if (ch == char_space) continue; j++; str = strIn.Right(nLen - i); str = str.SpanExcluding(" "); if (!str.Compare(buffer)) { nColumn = j; bRet = TRUE; break; } i += str.GetLength(); } return bRet; } BOOL GetColumnIndex( CString strIn, int& nColumn, char* pszMatch ) { WriteLog( "============= GetColumnIndex ==============" ); WriteLog(strIn.GetBuffer(strIn.GetLength())); WriteLog(pszMatch); BOOL bRet = FALSE; int nLen = strIn.GetLength(); TCHAR ch; CString str = _T(""); int j = 0; for (int i = 0; i < nLen; i++) { ch = strIn.GetAt(i); if (ch == char_space) continue; j++; str = strIn.Right(nLen - i); str = str.SpanExcluding(" "); if (!str.Compare(pszMatch)) { nColumn = j; bRet = TRUE; break; } i += str.GetLength(); } return bRet; } BOOL GetIniFileName(const char *FileName,char *IniFileName) { strcpy(IniFileName,FileName); return TRUE; /* HKEY hKey = NULL; LONG lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,KEY_PATH,0,KEY_READ,&hKey); if(lRet != ERROR_SUCCESS) return FALSE; LPTSTR lpName = NULL, lpValue = NULL; CString strSubKey = _T(""), strValKey = _T(""); DWORD dwIndex = 0, dwS1 = 255, dwS2 = 255, dwType = REG_SZ; BOOL bFindFlag = FALSE; while(lRet == ERROR_SUCCESS) { lpName = strSubKey.GetBuffer(dwS1); lpValue = strValKey.GetBuffer(dwS2); lRet = RegEnumValue(hKey, dwIndex++, lpName , &dwS1,NULL, &dwType ,(LPBYTE)lpValue, &dwS2); dwS1 = 255; dwS2 = 255; strSubKey.ReleaseBuffer(); strValKey.ReleaseBuffer(); if(lRet == ERROR_NO_MORE_ITEMS) break; if(strSubKey.CompareNoCase(KEY_NAME) == 0) { bFindFlag = TRUE; strValKey.Replace("/", "\\"); #if _DEBUG strValKey += "\\templates.os\\"; #else strValKey += "\\MonitorManager\\templates.os\\"; #endif CString strFileName = _T(""); strFileName.Format("%s%s", (LPCTSTR)strValKey, FileName); strcpy(IniFileName, (LPCTSTR)strFileName); break; } } RegCloseKey(hKey); return bFindFlag; */ } void AddToLogFile(const int nMonitorType, const char*szMsg) { HKEY hKey = NULL; LONG lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,KEY_PATH,0,KEY_READ,&hKey); if(lRet != ERROR_SUCCESS) return; CString strFileName = _T(""); LPTSTR lpName = NULL, lpValue = NULL; CString strSubKey = _T(""), strValKey = _T(""); DWORD dwIndex = 0, dwS1 = 255, dwS2 = 255, dwType = REG_SZ; BOOL bFindFlag = FALSE; while(lRet == ERROR_SUCCESS) { lpName = strSubKey.GetBuffer(dwS1); lpValue = strValKey.GetBuffer(dwS2); lRet = RegEnumValue(hKey, dwIndex++, lpName , &dwS1,NULL, &dwType ,(LPBYTE)lpValue, &dwS2); dwS1 = 255; dwS2 = 255; strSubKey.ReleaseBuffer(); strValKey.ReleaseBuffer(); if(lRet == ERROR_NO_MORE_ITEMS) break; if(strSubKey.CompareNoCase(KEY_NAME) == 0) { bFindFlag = TRUE; strValKey.Replace("/", "\\"); strValKey += "\\doc\\dragondoc\\"; strFileName.Format("%stemp.dat", (LPCTSTR)strValKey); break; } } RegCloseKey(hKey); if (bFindFlag && (nMonitorType == 11)) { FILE *logfile=fopen((LPCTSTR)strFileName,"a+"); if (logfile) { CTime curtime = CTime::GetCurrentTime(); CString strtime = curtime.Format("%Y-%m-%d %H:%M:%S"); fprintf(logfile,"Time: %s\r\n", (LPCTSTR)strtime); switch (nMonitorType) { case 7: // CPU fprintf(logfile,"MonitorType: CPU\r\n"); break; case 8: // Disk fprintf(logfile,"MonitorType: Disk\r\n"); break; case 9: // Memory fprintf(logfile,"MonitorType: Memory\r\n"); break; case 11: // Service fprintf(logfile,"MonitorType: Service\r\n"); break; case 21: // File fprintf(logfile, "MonitorType: File\r\n"); break; } fprintf(logfile,"%s\r\n",szMsg); fclose(logfile); } } } extern "C" __declspec(dllexport) BOOL DisksParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); char matchLine[64] = {0}; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("disks", "ostype", 0, IniFileName); if (nOsType == 1) { // Linux int nName = DFNParser_GetPrivateProfileInt("disks", "name", 0, IniFileName); int nMount = DFNParser_GetPrivateProfileInt("disks", "mount", 0, IniFileName); DFNParser_GetPrivateProfileString("disks", "matchline", "", matchLine, sizeof(matchLine), IniFileName); POSITION pos = lstString.GetHeadPosition(); while (pos) { CString strOut1 = _T(""); CString strOut2 = _T(""); strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nName, strOut1, nMonitorType); GetColumnFromLine(strTarget, nMount, strOut2, nMonitorType); strOut1.TrimRight(" "); strOut2.TrimRight(" "); if ((!(!strOut1.Compare((LPCTSTR)matchLine)))&&(!strOut2.IsEmpty())) { sprintf(szOut, "%s%s###%s$$$", szOut, (LPCTSTR)strOut1, (LPCTSTR)strOut2); } else if ((!(!strOut1.Compare((LPCTSTR)matchLine)))&&(strOut2.IsEmpty())) { if (pos) { sprintf(szOut, "%s%s###", szOut, (LPCTSTR)strOut1); strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nMount - 1, strOut2, nMonitorType); strOut2.TrimRight(" "); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut2); } } else { } } } else if(nOsType == 2) { // Solaris int nName = DFNParser_GetPrivateProfileInt("disks", "name", 0, IniFileName); int nMount = DFNParser_GetPrivateProfileInt("disks", "mount", 0, IniFileName); DFNParser_GetPrivateProfileString("disks", "matchline", "", matchLine, sizeof(matchLine), IniFileName); POSITION pos = lstString.GetHeadPosition(); while (pos) { CString strOut1 = _T(""); CString strOut2 = _T(""); strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nName, strOut1, nMonitorType); GetColumnFromLine(strTarget, nMount, strOut2, nMonitorType); strOut1.TrimRight(" "); strOut2.TrimRight(" "); if ((!(!strOut1.Compare((LPCTSTR)matchLine)))&&(!strOut2.IsEmpty())) { sprintf(szOut, "%s%s###%s$$$", szOut, (LPCTSTR)strOut1, (LPCTSTR)strOut2); } else if ((!(!strOut1.Compare((LPCTSTR)matchLine)))&&(strOut2.IsEmpty())) { if (pos) { sprintf(szOut, "%s%s###", szOut, (LPCTSTR)strOut1); strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nMount - 1, strOut2, nMonitorType); strOut2.TrimRight(" "); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut2); } } else { } } } else if(nOsType == 3) { // FreeBSD int nName = DFNParser_GetPrivateProfileInt("disks", "name", 0, IniFileName); int nMount = DFNParser_GetPrivateProfileInt("disks", "mount", 0, IniFileName); DFNParser_GetPrivateProfileString("disks", "matchline", "", matchLine, sizeof(matchLine), IniFileName); POSITION pos = lstString.GetHeadPosition(); while (pos) { CString strOut1 = _T(""); CString strOut2 = _T(""); strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nName, strOut1, nMonitorType); GetColumnFromLine(strTarget, nMount, strOut2, nMonitorType); strOut1.TrimRight(" "); strOut2.TrimRight(" "); if ((!(!strOut1.Compare((LPCTSTR)matchLine)))&&(!strOut2.IsEmpty())) { sprintf(szOut, "%s%s###%s$$$", szOut, (LPCTSTR)strOut1, (LPCTSTR)strOut2); } else if ((!(!strOut1.Compare((LPCTSTR)matchLine)))&&(strOut2.IsEmpty())) { if (pos) { sprintf(szOut, "%s%s###", szOut, (LPCTSTR)strOut1); strTarget = lstString.GetNext(pos); GetColumnFromLine(strTarget, nMount - 1, strOut2, nMonitorType); strOut2.TrimRight(" "); sprintf(szOut, "%s%s$$$", szOut, (LPCTSTR)strOut2); } } else { } } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; } extern "C" __declspec(dllexport) BOOL DiskActParser(const char * szSource, const int nMonitorType, char *szOut, const char *FileName) { //AddToLogFile(nMonitorType, szSource); BOOL bRet = FALSE; char IniFileName[1024]={0}; bRet = GetIniFileName(FileName,IniFileName); if (!bRet) return bRet; CStringList lstString; CString strTarget = _T(""); CString strMsg = _T(""); int nValue = 0; bRet = FormatSource(szSource, nMonitorType, lstString,IniFileName); if (bRet) { int nOsType = DFNParser_GetPrivateProfileInt("DiskAct", "ostype", 0, IniFileName); if(nOsType == 5) { // FreeBSD int nReverse = DFNParser_GetPrivateProfileInt("DiskAct", "reverselines", 0, IniFileName); int nStart = DFNParser_GetPrivateProfileInt("DiskAct", "startline", 0, IniFileName); int nDiskAct = DFNParser_GetPrivateProfileInt("DiskAct", "diskact", 0, IniFileName); float fDiskAct = 0.0; GetLineString(lstString, nReverse, nStart, strTarget); CString strOut1 = _T(""); GetColumnFromLine(strTarget, nDiskAct, strOut1); if (strOut1.IsEmpty()) { GetLineString(lstString, nReverse, nStart + 1, strTarget); GetColumnFromLine(strTarget, nDiskAct - 1, strOut1); if (strOut1.IsEmpty()) bRet = FALSE; else { sscanf((LPCTSTR)strOut1, "%f", &fDiskAct); strMsg.Format("DiskAct=%.2f$", fDiskAct); // strMsg.Format("percentFull=%.2f$Mbfree=%.2f$", fPercentFull, fMbFree); strcpy(szOut, (LPCTSTR)strMsg); } } else { sscanf((LPCTSTR)strOut1, "%f", &fDiskAct); strMsg.Format("DiskAct=%.2f$", fDiskAct); // strMsg.Format("percentFull=%.2f$Mbfree=%.2f$", fPercentFull, fMbFree); strcpy(szOut, (LPCTSTR)strMsg); } } else { bRet = FALSE; } lstString.RemoveAll(); } return bRet; }
[ "136122085@163.com" ]
136122085@163.com
6c64130bf883d35ffb1b0907593b2859f40f830a
08699fd7b96d48de7c3f70ce83dc2ea59ec20af7
/atcoder/algorithim/a.cpp
02938c4cf5e5dd57a043fafe6279e304a382189a
[]
no_license
KazutoYunoki/programing-contest
0b89f92145a3e9ef09f6522cabe200259960a981
b8123f8902a157678bd8fe860f0b1da9f2b1883d
refs/heads/master
2022-11-05T01:25:35.900951
2020-06-22T10:01:57
2020-06-22T10:01:57
267,318,061
0
0
null
null
null
null
UTF-8
C++
false
false
427
cpp
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; if (s == t) { cout << "same" << endl; return 0; } transform(s.begin(), s.end(), s.begin(), ::toupper); transform(t.begin(), t.end(), t.begin(), ::toupper); if (s == t) { cout << "case-insensitive" << endl; return 0; } else cout << "different" << endl; }
[ "kazuto233@gmail.com" ]
kazuto233@gmail.com
8325614619c25e37cecaddf9bc513c852f46edd3
16ec69fdf8d34ebd0167fc35cc632d44fc20ba28
/C++/STL/STL/stdafx.cpp
2e547fda6f645fea7958bc56646b27563ad7e579
[]
no_license
elixir67/Sandbox
63dac0a914ca5c336538e7d4be044a722d435a1a
9d55f5f179ed607dc81151023e62388b048068ab
refs/heads/master
2020-04-06T12:13:53.649701
2016-09-27T05:33:33
2016-09-27T05:33:33
4,214,156
1
2
null
null
null
null
UTF-8
C++
false
false
282
cpp
// stdafx.cpp : source file that includes just the standard includes // STL.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file
[ "lind@SHACNG028WC4Y.ads.autodesk.com" ]
lind@SHACNG028WC4Y.ads.autodesk.com
e3cfbe62d8a5e31cde5f64efc2536b1c1c5cc1dd
3ff1fe3888e34cd3576d91319bf0f08ca955940f
/tcr/src/v20190924/model/DescribeImagePersonalRequest.cpp
38cc3100d5d23dee4704aad44208a176eeb61664
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-cpp
9f5df8220eaaf72f7eaee07b2ede94f89313651f
42a76b812b81d1b52ec6a217fafc8faa135e06ca
refs/heads/master
2023-08-30T03:22:45.269556
2023-08-30T00:45:39
2023-08-30T00:45:39
188,991,963
55
37
Apache-2.0
2023-08-17T03:13:20
2019-05-28T08:56:08
C++
UTF-8
C++
false
false
3,675
cpp
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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 <tencentcloud/tcr/v20190924/model/DescribeImagePersonalRequest.h> #include <tencentcloud/core/utils/rapidjson/document.h> #include <tencentcloud/core/utils/rapidjson/writer.h> #include <tencentcloud/core/utils/rapidjson/stringbuffer.h> using namespace TencentCloud::Tcr::V20190924::Model; using namespace std; DescribeImagePersonalRequest::DescribeImagePersonalRequest() : m_repoNameHasBeenSet(false), m_offsetHasBeenSet(false), m_limitHasBeenSet(false), m_tagHasBeenSet(false) { } string DescribeImagePersonalRequest::ToJsonString() const { rapidjson::Document d; d.SetObject(); rapidjson::Document::AllocatorType& allocator = d.GetAllocator(); if (m_repoNameHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "RepoName"; iKey.SetString(key.c_str(), allocator); d.AddMember(iKey, rapidjson::Value(m_repoName.c_str(), allocator).Move(), allocator); } if (m_offsetHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "Offset"; iKey.SetString(key.c_str(), allocator); d.AddMember(iKey, m_offset, allocator); } if (m_limitHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "Limit"; iKey.SetString(key.c_str(), allocator); d.AddMember(iKey, m_limit, allocator); } if (m_tagHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "Tag"; iKey.SetString(key.c_str(), allocator); d.AddMember(iKey, rapidjson::Value(m_tag.c_str(), allocator).Move(), allocator); } rapidjson::StringBuffer buffer; rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); d.Accept(writer); return buffer.GetString(); } string DescribeImagePersonalRequest::GetRepoName() const { return m_repoName; } void DescribeImagePersonalRequest::SetRepoName(const string& _repoName) { m_repoName = _repoName; m_repoNameHasBeenSet = true; } bool DescribeImagePersonalRequest::RepoNameHasBeenSet() const { return m_repoNameHasBeenSet; } int64_t DescribeImagePersonalRequest::GetOffset() const { return m_offset; } void DescribeImagePersonalRequest::SetOffset(const int64_t& _offset) { m_offset = _offset; m_offsetHasBeenSet = true; } bool DescribeImagePersonalRequest::OffsetHasBeenSet() const { return m_offsetHasBeenSet; } int64_t DescribeImagePersonalRequest::GetLimit() const { return m_limit; } void DescribeImagePersonalRequest::SetLimit(const int64_t& _limit) { m_limit = _limit; m_limitHasBeenSet = true; } bool DescribeImagePersonalRequest::LimitHasBeenSet() const { return m_limitHasBeenSet; } string DescribeImagePersonalRequest::GetTag() const { return m_tag; } void DescribeImagePersonalRequest::SetTag(const string& _tag) { m_tag = _tag; m_tagHasBeenSet = true; } bool DescribeImagePersonalRequest::TagHasBeenSet() const { return m_tagHasBeenSet; }
[ "tencentcloudapi@tenent.com" ]
tencentcloudapi@tenent.com
ad633ea9380a9f3328934d6556eb214db642991d
aedec0779dca9bf78daeeb7b30b0fe02dee139dc
/Modules/PointSet/src/CloseCellData.cc
1cdc950fd8f124a51b2fc5f047ba64eb7e2f0b6f
[ "LicenseRef-scancode-proprietary-license", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
BioMedIA/MIRTK
ca92f52b60f7db98c16940cd427a898a461f856c
973ce2fe3f9508dec68892dbf97cca39067aa3d6
refs/heads/master
2022-08-08T01:05:11.841458
2022-07-28T00:03:25
2022-07-28T10:18:00
48,962,880
171
78
Apache-2.0
2022-07-28T10:18:01
2016-01-03T22:25:55
C++
UTF-8
C++
false
false
2,731
cc
/* * Medical Image Registration ToolKit (MIRTK) * * Copyright 2016 Imperial College London * Copyright 2016 Andreas Schuh * * 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 "mirtk/CloseCellData.h" #include "mirtk/DilateCellData.h" #include "mirtk/ErodeCellData.h" namespace mirtk { // ============================================================================= // Construction/destruction // ============================================================================= // ----------------------------------------------------------------------------- void CloseCellData::CopyAttributes(const CloseCellData &other) { _Iterations = other._Iterations; } // ----------------------------------------------------------------------------- CloseCellData::CloseCellData() : _Iterations(1) { } // ----------------------------------------------------------------------------- CloseCellData::CloseCellData(const CloseCellData &other) : CellDataFilter(other) { CopyAttributes(other); } // ----------------------------------------------------------------------------- CloseCellData &CloseCellData::operator =(const CloseCellData &other) { if (this != &other) { CellDataFilter::operator =(other); CopyAttributes(other); } return *this; } // ----------------------------------------------------------------------------- CloseCellData::~CloseCellData() { } // ============================================================================= // Execution // ============================================================================= // ----------------------------------------------------------------------------- void CloseCellData::Initialize() { // Nothing to be done } // ----------------------------------------------------------------------------- void CloseCellData::Execute() { DilateCellData dilate; dilate.Input(_Input); dilate.InputData(_InputData); dilate.DataName(_DataName); dilate.Iterations(_Iterations); dilate.Run(); ErodeCellData erode; erode.Input(dilate.Output()); erode.InputData(dilate.OutputData()); erode.Iterations(_Iterations); erode.Run(); _Output = erode.Output(); _OutputData = erode.OutputData(); } } // namespace mirtk
[ "andreas.schuh.84@gmail.com" ]
andreas.schuh.84@gmail.com
51ee9fee20066e1476c6ae8f589d048df684db0f
45c70e9a492f929208d4bbb9d9efcb6992b38f2f
/Illuminatrix-Arduino/ino/.build/diecimila/src/sketch.cpp
393b4b28fab27273603014e334060291f01af01e
[]
no_license
docdawning/Illuminatrix
bc39e4ae1956578c131e15af52575f7aa2a5c1ee
7a057d6bae7c5116499d35232b82e4a7e7d95db3
refs/heads/master
2021-01-24T03:48:39.497324
2016-12-19T08:38:05
2016-12-19T08:38:05
48,871,111
18
8
null
null
null
null
UTF-8
C++
false
false
9,065
cpp
#include <Arduino.h> #include "LED.cpp" #include "Color.cpp" void refreshLEDs(); void setup(); void resetColorParameters(); void printLEDs(); void setLEDs(boolean state); char* findSpaceDelimitedSubstring(String input, int numberOfLeadingSpaces); void setLED(String input); void setColor(Color color); void cycleOn(); void interpretInput(String input); void setForWhiteCycle(); void setForSingleColorCycle(int ledNumber); void serviceInputIfNecessary(); bool isNotOkayToDescendFurther(bool preference); int getRandomLED(); void serviceHypnoOrbIfNecessary(); void loop(); #line 1 "src/sketch.ino" //**************************************************************// // Author: doc@dawning.ca //**************************************************************// using namespace std; //#include "LED.cpp" //#include "Color.cpp" //################################################################## //## Main Class #################################################### //################################################################## #define l_R 3 //PWM pin for RED #define l_G 5 //PWM pin for GREEN #define l_B 6 //PWM pin for BLUE #define BAUD_RATE 9600 #define NUMBER_OF_SPACES_BEFORE_PWM_IN_SET_CMD 2 #define NUMBER_OF_SPACES_BEFORE_STATUS_IN_SET_CMD 3 #define NUMBER_OF_SPACES_BEFORE_LED_NUMBER_IN_SET_CMD 1 #define DEFAULT_MIN_BRIGHTNESS 500 #define DEFAULT_MIN_BRIGHTNESS_FOR_SINGLE_COLOR_CYCLE 96 #define DEFAULT_CYCLES_PER_STEP 100 #define NAME_WHITE "WHITE" #define NAME_RED "RED" #define NAME_GREEN "GREEN" #define NAME_BLUE "BLUE" #define NAME_LIGHTBLUE "LIGHTBLUE" #define NAME_YELLOW "YELLOW" #define NAME_PURPLE "PURPLE" #define NAME_STANDBY "STANDBY" //Function Prototypes//// void refreshLEDs(); void refreshLEDState(LED led); //Globals//// LED LEDS[3]; Color WHITE; Color RED; Color GREEN; Color BLUE; Color LIGHTBLUE; Color YELLOW; Color PURPLE; Color OFF; Color STANDBY; String inputString; //HypnoOrb Components boolean hypnoOrb; boolean hypnoOrbAscending; LED* hypnoOrbDeltaSubject; int cyclesPerStep; int cyclesSinceLastStep; int minBrightness; int stepsSinceChange; int stepsPerHypnoOrbChange; //################################################################## //## Init functions ################################################ //################################################################## void refreshLEDs() { for(int i=0;i<3;i++) { LEDS[i].refreshLED(); } } //Arduino's firmware start of execution void setup() { //Create color constants WHITE.initialize(255, 255, 48); RED.initialize(255, 0, 0); GREEN.initialize(0, 255, 0); BLUE.initialize(0, 0, 255); LIGHTBLUE.initialize(0, 166, 255); YELLOW.initialize(255, 255, 0); PURPLE.initialize(255, 0, 255); OFF.initialize(0, 0 ,0); STANDBY.initialize(16, 0, 0); //Setup for each LED LEDS[0].initialize(NAME_RED, l_R, true, 0, 255, 0); LEDS[1].initialize(NAME_GREEN, l_G, true, 0, 255, 0); LEDS[2].initialize(NAME_BLUE, l_B, true, 0, 255, 180); Serial.begin(BAUD_RATE); resetColorParameters(); hypnoOrbAscending = true; hypnoOrbDeltaSubject = &LEDS[1]; cyclesSinceLastStep = 0; stepsSinceChange = 0; stepsPerHypnoOrbChange = 96; Serial.println("Illuminatrix greets you."); setForSingleColorCycle(2); } //end setup //################################################################## //## Functions ##################################################### //################################################################## void resetColorParameters() { cyclesPerStep = DEFAULT_CYCLES_PER_STEP; minBrightness = DEFAULT_MIN_BRIGHTNESS; hypnoOrb = false; for (int i=0;i<3;i++) { LEDS[i].minPWM = 0; LEDS[i].maxPWM = 255; LEDS[i].enable(); } } void printLEDs() { for(int i=0;i<3;i++) { Serial.print("LED # "); Serial.print(i); Serial.print(", value: "); Serial.print(LEDS[i].getValue()); Serial.print(", state: "); Serial.println(LEDS[i].activated); } } void setLEDs(boolean state){ Serial.println("LED state changed"); for (int i=0;i<3;i++) { LEDS[i].activated = state; } if (!state) { hypnoOrb = false; resetColorParameters(); } } char* findSpaceDelimitedSubstring(String input, int numberOfLeadingSpaces) { int start = 0; int end = 0; int spacesObserved = 0; //find the start of the substring for (int i=0;i<input.length();i++) { start++; if (input.charAt(i) == ' ') { spacesObserved++; if (spacesObserved >= numberOfLeadingSpaces) i = input.length(); } } //find the end of the substring end=start; for (int i=start;i<input.length();i++) { if (input.charAt(i) == ' ') { i=input.length(); } else { start++; } } char charBuf[input.length()]; input.substring(start,end).toCharArray(charBuf, input.length()); return charBuf; } void setLED(String input) { //SET LED# PWM-MOD ENABLE //"SET {0-2} {0-9} {0-1}" int mode = atoi(findSpaceDelimitedSubstring(input, NUMBER_OF_SPACES_BEFORE_PWM_IN_SET_CMD)); int ledNumber = atoi(findSpaceDelimitedSubstring(input, NUMBER_OF_SPACES_BEFORE_LED_NUMBER_IN_SET_CMD)); int status = atoi(findSpaceDelimitedSubstring(input, NUMBER_OF_SPACES_BEFORE_STATUS_IN_SET_CMD)); LED* led = &LEDS[ledNumber]; if (status > 0) led->enable(); else led->disable(); led->setValue(mode); Serial.print("Changed LED #"); Serial.print(ledNumber); Serial.print(", with mode "); Serial.print(mode); Serial.print(", and status "); Serial.println(status); } void setColor(Color color) { resetColorParameters(); for (int i=0;i<3;i++) { LED* led = &LEDS[i]; if (led->name.startsWith(NAME_RED)) led->setTarget(color.red); if (led->name.startsWith(NAME_GREEN)) led->setTarget(color.green); if (led->name.startsWith(NAME_BLUE)) led->setTarget(color.blue); led->enable(); } } void cycleOn() { resetColorParameters(); hypnoOrb=true; setLEDs(true); } void interpretInput(String input) { if (inputString.startsWith("ON")) setColor(BLUE); if (inputString.startsWith("OFF")) setColor(OFF); if (inputString.startsWith("SET")) setLED(inputString); if (inputString.startsWith(NAME_WHITE)) setColor(WHITE); if (inputString.startsWith(NAME_RED)) setColor(RED); if (inputString.startsWith(NAME_GREEN)) setColor(GREEN); if (inputString.startsWith(NAME_BLUE)) setColor(BLUE); if (inputString.startsWith(NAME_LIGHTBLUE)) setColor(LIGHTBLUE); if (inputString.startsWith(NAME_YELLOW)) setColor(YELLOW); if (inputString.startsWith(NAME_PURPLE)) setColor(PURPLE); if (inputString.startsWith(NAME_STANDBY)) setColor(STANDBY); if (inputString.startsWith("CYCLEON")) cycleOn(); if (inputString.startsWith("CYCLEOFF")) hypnoOrb=false; if (inputString.startsWith("CYCLEWHITE")) setForWhiteCycle(); if (inputString.startsWith("CYCLERED")) setForSingleColorCycle(0); if (inputString.startsWith("CYCLEGREEN")) setForSingleColorCycle(1); if (inputString.startsWith("CYCLEBLUE")) setForSingleColorCycle(2); printLEDs(); } void setForWhiteCycle() { resetColorParameters(); LEDS[0].minPWM = 128; LEDS[1].minPWM = 128; LEDS[2].minPWM = 96; hypnoOrb = true; } void setForSingleColorCycle(int ledNumber) { resetColorParameters(); //cyclesPerStep = 30; minBrightness = DEFAULT_MIN_BRIGHTNESS_FOR_SINGLE_COLOR_CYCLE; for (int i=0;i<3;i++) { if (i == ledNumber) { LEDS[i].minPWM = minBrightness; LEDS[i].maxPWM = 255; } else { LEDS[i].disable(); } } hypnoOrb = true; } void serviceInputIfNecessary() { char ch = ' '; if (Serial.available() > 0) { char ch = (char)Serial.read(); inputString += ch; Serial.print(ch); if (ch == '\r' || ch == ';') { Serial.print('\n'); interpretInput(inputString); inputString = ""; } } } //This function is intended to prevent all colours from ever going below the min threshold bool isNotOkayToDescendFurther(bool preference) { int brightnessSum = 0; for (int i=0;i<3;i++) { LED* led = &LEDS[i]; brightnessSum += led->getValue(); } if (brightnessSum <= minBrightness) { return true; } return preference; } //Grabs a suitable random LED, disregards inactive LEDs int getRandomLED() { int led = random(0,3); //gets a random int 0 <= led < 3 int tryLimit = 10; while (!LEDS[led].activated) { if (tryLimit < 0) break; tryLimit--; led = random(0,3); } return led; } void serviceHypnoOrbIfNecessary() { if (!hypnoOrb) return; if (stepsSinceChange > stepsPerHypnoOrbChange) { stepsSinceChange = 0; //int newLEDNumber = random(0,3); int newLEDNumber = getRandomLED(); int newDirection = random(0,2); hypnoOrbDeltaSubject = &LEDS[newLEDNumber]; hypnoOrbAscending = isNotOkayToDescendFurther((boolean)(newDirection)); } //Increment cycle counter if necessary if (cyclesSinceLastStep < cyclesPerStep) { cyclesSinceLastStep++; return; } stepsSinceChange++; //alter subject according to direction cyclesSinceLastStep = 0; int deltaValue = 0; if (hypnoOrbAscending) deltaValue = 1; else deltaValue = -1; hypnoOrbDeltaSubject->setValue(hypnoOrbDeltaSubject->getValue() + deltaValue); } //Main void loop() { refreshLEDs(); serviceInputIfNecessary(); serviceHypnoOrbIfNecessary(); }
[ "doc@dawning.ca" ]
doc@dawning.ca
4ce1ad61f28d8da273177fe6b344401cd827da7c
9ed6a9e2331999ee4cda5afca9965562dc813b1b
/libsrcs/angelscript/angelSVN/sdk/tests/test_performance/source/test_fib.cpp
56c88aa47cc89d7a1725e70bbe00a0df810b4c46
[]
no_license
kalhartt/racesow
20152e59c4dab85252b26b15960ffb75c2cc810a
7616bb7d98d2ef0933231c811f0ca81b5a130e8a
refs/heads/master
2021-01-16T22:28:27.663990
2013-12-20T13:23:30
2013-12-20T13:23:30
16,124,051
3
2
null
null
null
null
UTF-8
C++
false
false
2,849
cpp
// // Test author: Andreas Jonsson // #include "utils.h" namespace TestFib { #define TESTNAME "TestFib" static const char *script = "int fibR(int n) \n" "{ \n" " if (n < 2) return n; \n" " return (fibR(n-2) + fibR(n-1)); \n" "} \n" " \n" "int fibI(int n) \n" "{ \n" " int last = 0; \n" " int cur = 1; \n" " --n; \n" " while(n > 0) \n" " { \n" " --n; \n" " int tmp = cur; \n" " cur = last + cur; \n" " last = tmp; \n" " } \n" " return cur; \n" "} \n"; void Test() { printf("---------------------------------------------\n"); printf("%s\n\n", TESTNAME); printf("AngelScript 2.18.1 WIP : 2.25 secs\n"); printf("AngelScript 2.19.1 WIP : 2.09 secs\n"); printf("AS 2.20.0 (home) : 2.11 secs\n"); printf("AS 2.20.3 (home) : 1.97 secs\n"); printf("\nBuilding...\n"); asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetEngineProperty(asEP_BUILD_WITHOUT_LINE_CUES, true); COutStream out; engine->SetMessageCallback(asMETHOD(COutStream,Callback), &out, asCALL_THISCALL); asIScriptModule *mod = engine->GetModule(0, asGM_ALWAYS_CREATE); mod->AddScriptSection(TESTNAME, script, strlen(script), 0); mod->Build(); asIScriptContext *ctx = engine->CreateContext(); int fibI = mod->GetFunctionIdByDecl("int fibI(int)"); int fibR = mod->GetFunctionIdByDecl("int fibR(int)"); ctx->Prepare(fibR); ctx->SetArgDWord(0, 35); // 43 printf("Executing AngelScript version...\n"); double time = GetSystemTimer(); int r = ctx->Execute(); time = GetSystemTimer() - time; if( r != 0 ) { printf("Execution didn't terminate with asEXECUTION_FINISHED\n", TESTNAME); if( r == asEXECUTION_EXCEPTION ) { printf("Script exception\n"); asIScriptFunction *func = engine->GetFunctionDescriptorById(ctx->GetExceptionFunction()); printf("Func: %s\n", func->GetName()); printf("Line: %d\n", ctx->GetExceptionLineNumber()); printf("Desc: %s\n", ctx->GetExceptionString()); } } else printf("Time = %f secs\n", time); // Verify the result int fib = ctx->GetReturnDWord(); if( fib != 9227465 ) printf("Didn't get the expected fibonacci value, got %d\n", fib); ctx->Release(); engine->Release(); } } // namespace
[ "karl.glatzer@gmx.de" ]
karl.glatzer@gmx.de
9ac9288f6da22d1fb50c468d6258799ffa2f91a2
09930eb8ac588565bb6e784ddff344f351f2e89f
/hw/hw4/t1.cpp
48c49ab3505e2e294f2f5a5b4e952db30dbc5fb6
[]
no_license
gbhb/alg
a2adde5f477aa2ab9ac6c5671c28f896a06e389e
96723854ab99f8adf8be4282663b09ae4ac54e77
refs/heads/master
2023-05-06T11:00:05.170966
2021-06-02T04:19:38
2021-06-02T04:19:38
373,037,372
0
0
null
null
null
null
UTF-8
C++
false
false
4,948
cpp
#include <deque> #include <iostream> #include <sstream> #include <string> #define MAX 10001 using namespace std; typedef struct node { int value; struct node *left; struct node *right; node() { value = -1, left = NULL, right = NULL; } //預設tree node的值 } binaryNode; binaryNode *root; deque<binaryNode *> qu; //為了tree on the level bool cflag = true, dflag = true; void check(binaryNode *now) { //檢查樹是否有空節點,該有節點而未有節點 if (now->value == -1) cflag = false; //cflag為false表示有空節點 if (now->left != NULL) check(now->left); if (now->right != NULL) check(now->right); } void levelOrder(binaryNode *now) { //tree on the level qu.push_back(now); cout << qu.front()->value; //為了output時數字間的空白,先output第一個數字 if (qu.front()->left != NULL) qu.push_back(qu.front()->left); if (qu.front()->right != NULL) qu.push_back(qu.front()->right); qu.pop_front(); while (!qu.empty()) { cout << " " << qu.front()->value; if (qu.front()->left != NULL) qu.push_back(qu.front()->left); if (qu.front()->right != NULL) qu.push_back(qu.front()->right); qu.pop_front(); } cout << endl; } void buildTree(binaryNode *now, string pos, int spos, int num) { //建立tree,now為現在所在節點 if (pos == "") { //pos為節點所在位置字串,spos為目前在pos字串的哪一個字元,num為插入的值 if (now->value != -1) dflag = false; //dflag為false表示節點重複 else { now->value = num; } } if (pos.length() > spos) { if (pos[spos] == 'L') { //往左邊 if (now->left == NULL) { //未有節點則建立 binaryNode *bNode = new binaryNode; if (pos.length() == (spos + 1)) bNode->value = num; //判斷是否已到插入位置,若是則插入值 now->left = bNode; //插入新增節點到now的左邊 } else { if (pos.length() == (spos + 1)) { //判斷是否已到插入位置 if (now->left->value != -1) dflag = false; //該節點已經有了 dflag為false表示節點重複 else now->left->value = num; //更新結點值 } } buildTree(now->left, pos, spos + 1, num); //遞迴,看pos的第spos+1個字元是L還是R,決定左邊還右邊 } else if (pos[spos] == 'R') { //往右邊 if (now->right == NULL) { //未有節點則建立 binaryNode *bNode = new binaryNode; if (pos.length() == (spos + 1)) bNode->value = num; //判斷是否已到插入位置,若是則插入值 now->right = bNode; //插入新增節點到now的右邊 } else { if (pos.length() == (spos + 1)) { //判斷是否已到插入位置 if (now->right->value != -1) dflag = false; //該節點已經有了 dflag為false表示節點重複 else now->right->value = num; //更新結點值 } } buildTree(now->right, pos, spos + 1, num); //遞迴,看pos的第spos+1個字元是L還是R,決定左邊還右邊 } } } int main() { string s; string pa; int num, f, i, result, cresult; cin >> f; while (f > 0) { cin >> s; binaryNode *root = new binaryNode; do { if (s.length() == 2) break; //表示該組測資輸入結束 num = 0; for (i = 1; i < s.length() - 1; i++) { //讀取節點數值到num if (s[i] == ',') break; num = num * 10 + s[i] - '0'; } //cout <<num<<endl; pa = s.substr(i + 1, s.length() - i - 2); //取出節點位置字串到pa //cout << pa<<endl; buildTree(root, pa, 0, num); //每個節點,就呼叫一次buildTree } while (cin >> s); check(root); //樹建好了,檢查是否有空節點 if (dflag == false) { cout << "not complete" << endl; //node是否有重複 f--; } else if (cflag == false) { cout << "not complete" << endl; //tree是否有空節點 f--; } else { levelOrder(root); f--; } //level走訪 cflag = true, dflag = true; //為下一組測資準備 } return 0; }
[ "5221abcd@gmail.com" ]
5221abcd@gmail.com
8067676a6f573a11d1698996890dcc7e249f9160
fd3255bcbd1c0dc05e7bc62ef9be5de40e915cac
/Classes/myListView.h
17b909d419b0bec53ac5a6096e2cf80e64d11254
[]
no_license
JakubDziworski/BumpRace
e3a11540274d2aff8305d455fc34a26df32a3e11
7b57f81f4c620f39a90c0e5405a4d4ae27e93663
refs/heads/master
2021-01-19T00:57:34.059042
2016-07-31T18:27:20
2016-07-31T18:27:20
21,311,448
0
1
null
null
null
null
UTF-8
C++
false
false
360
h
#ifndef _MYSCROLL_H__ #define _MYSCROLL_H__ #include "ui/UILayout.h" #include "ui/UIPageView.h" #include "cocos2d.h" class PageViewController : public cocos2d::ui::Layout { private: cocos2d::ui::PageView *pageview; public: virtual bool init(); void setControlledpageView(cocos2d::ui::PageView*); CREATE_FUNC(PageViewController); }; #endif
[ "kuba@MacBook-Pro-kuba.local" ]
kuba@MacBook-Pro-kuba.local
1607d284a548f5a53a47e5ae29155d5450ccc3f6
f4fa14818f3d8b722e82e8562acf6b2740847633
/3rdparty/dcmtk-3.5.4/include/dcmtk/dcmsign/sicreapr.h
2ef9e4c2fba2c07844088a65592187a790073e55
[ "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "BSD-4.3TAHOE", "JasPer-2.0", "xlock", "IJG", "OFFIS", "LicenseRef-scancode-other-permissive" ]
permissive
bxgaillard/dicomsel
fafb5a87d56cf51e1abbf8bf9b5c7c768d85816d
711adabecc0fa4cebae6cb12ff27a3a9ef554c36
refs/heads/master
2020-03-14T17:58:43.740137
2006-11-17T08:51:21
2018-05-01T15:49:25
131,732,345
2
1
null
null
null
null
UTF-8
C++
false
false
2,217
h
/* * * Copyright (C) 1998-2005, OFFIS * * This software and supporting documentation were developed by * * Kuratorium OFFIS e.V. * Healthcare Information and Communication Systems * Escherweg 2 * D-26121 Oldenburg, Germany * * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. * * Module: dcmsign * * Author: Norbert Loxen, Marco Eichelberg * * Purpose: * classes: SiCreatorProfile * * Last Update: $Author: meichel $ * Update Date: $Date: 2005/12/08 16:04:35 $ * CVS/RCS Revision: $Revision: 1.5 $ * Status: $State: Exp $ * * CVS/RCS Log at end of file * */ #ifndef SICREAPR_H #define SICREAPR_H #include "dcmtk/config/osconfig.h" #include "dcmtk/dcmsign/sibrsapr.h" /* for SiBaseRSAProfile */ #ifdef WITH_OPENSSL /** Creator RSA Digital Signature Profile */ class SiCreatorProfile: public SiBaseRSAProfile { public: /// default constructor SiCreatorProfile() { } /// destructor virtual ~SiCreatorProfile() { } /** checks whether an attribute with the given tag is required to be signed * for the current security profile. * @param key tag key to be checked * @return true if required, false otherwise. */ virtual OFBool attributeRequired(const DcmTagKey& key) const; }; #endif #endif /* * $Log: sicreapr.h,v $ * Revision 1.5 2005/12/08 16:04:35 meichel * Changed include path schema for all DCMTK header files * * Revision 1.4 2003/06/04 14:21:03 meichel * Simplified include structure to avoid preprocessor limitation * (max 32 #if levels) on MSVC5 with STL. * * Revision 1.3 2001/11/16 15:50:50 meichel * Adapted digital signature code to final text of supplement 41. * * Revision 1.2 2001/06/01 15:50:48 meichel * Updated copyright header * * Revision 1.1 2000/11/07 16:48:54 meichel * Initial release of dcmsign module for DICOM Digital Signatures * * */
[ "git@benjamin.gaillard.name" ]
git@benjamin.gaillard.name
8cabf9d33d77739e9858f73b00c596cecc672fce
3965dbe726debbd1347ae5bf284fdcab899a1f43
/lab 11 (baru)/q3.cpp
b9649f8a27ca9790fa16e540ce15e4fc515f0451
[]
no_license
chamad14/Muchamad-Rizki-Fadillah_FOP2020
68c9b1135805af12baf1aa919df5ca178d279ff4
8ba6fa47c6e6ccea94d0786d836bf5ef98417715
refs/heads/master
2023-02-10T11:00:17.618604
2020-12-31T04:01:54
2020-12-31T04:01:54
294,573,818
0
0
null
null
null
null
UTF-8
C++
false
false
2,549
cpp
#include <iostream> #include <fstream> #include <cstdlib> #include <bits/stdc++.h> using namespace std; int main(){ ifstream input; input.open("lab11_grade.txt"); const int SizeArray = 40; string students_name[SizeArray]; double students_grade[SizeArray]; int i = 0; double average_grade = 0; string line; while(getline(input, line)){ int nameEndPos = line.find('-') - 1; students_name[i] = line.substr(0, nameEndPos); int gradeStartPos = line.find('-') + 1; int gradeEndPos = line.find('\n'); students_grade[i] = stod(line.substr(gradeStartPos, gradeEndPos)); ++i; } for(int i = 0; i < SizeArray; i++){ cout << students_name[i] << " = " << students_grade[i] << "\n"; } // Lowest string lowest_name = students_name[0]; double lowest = students_grade[0]; for(int i = 0; i < SizeArray; i++){ if (students_grade[i] < lowest){ lowest = students_grade[i]; lowest_name = students_name[i]; } } // Highest string highest_name = students_name[0]; double highest = students_grade[0]; for(int i = 0; i < SizeArray; i++){ if (students_grade[i] > highest){ highest = students_grade[i]; highest_name = students_name[i]; } } //average int sum = 0; for (int i = 0; i < SizeArray; i++){ sum += students_grade[i]; } int average = sum / SizeArray; cout << "Average = " << average << '\n'; // Under average // ua = under average string ua_name = students_name[0]; double ua = students_grade[0]; for(int i = 0; i < SizeArray; i++){ if (students_grade[i] < average){ ua = students_grade[i]; ua_name = students_name[i]; cout << "Under Average = " << ua_name << " - " << ua << '\n'; } } cout << endl; // Above average // aa = above average string aa_name = students_name[0]; double aa = students_grade[0]; for(int i = 0; i < SizeArray; i++){ if (students_grade[i] > average){ aa = students_grade[i]; aa_name = students_name[i]; cout << "Above Average = " << aa_name << " - " << aa << '\n'; } } //test, semoga bisa ya tuhan, Kalo bisa gua rajin solat ya tuhan double lowest2 = students_grade[0]; for (int i = 0; i < SizeArray; i++){ if(students_grade[i] < lowest2){ lowest2 = students_grade[i]; cout <<"test " << lowest2 << endl; lowest2 +=1; } } input.close(); cout << "Lowest = " << lowest_name << " - " << lowest << '\n'; cout << "Highest = " << highest_name << " - " << highest << '\n'; return 0; }
[ "replituser@example.com" ]
replituser@example.com
1604ce14b7ed172e62251e5b6e23d990c8fb1414
8812cddcaa19671817e2b9cc179d3f41f6c620b2
/MaxExporter/trunk/MaxInterface.cpp
10069f11e7abb9482e4d4e3cc5aaec20ccc6b005
[]
no_license
Hengle/airengine
7e6956a8a649ef0ca07fcf892c55ae2451ce993c
2f5fbfbfe83eb3f2d1d44af4401b3a48ae75cb24
refs/heads/master
2023-03-17T00:17:33.284538
2020-02-04T03:25:48
2020-02-04T03:25:48
null
0
0
null
null
null
null
GB18030
C++
false
false
5,802
cpp
#include "MaxInterface.h" #include "MaxNode.h" #include "decomp.h" DWORD WINAPI ProgressFunction(LPVOID arg) { return 0; } CMaxInterface::CMaxInterface() : m_pExpInterface(NULL), m_pInterface(NULL) { } CMaxInterface::~CMaxInterface() { } bool CMaxInterface::Create(ExpInterface *pExpInterface, Interface *pInterface) { m_pExpInterface = pExpInterface; m_pInterface = pInterface; return true; } CMaxNode* CMaxInterface::GetNode(const std::string& strName) { CMaxNode *pNode; pNode = new CMaxNode(); if(pNode == 0) { //theExporter.SetLastError("Memory allocation failed.", __FILE__, __LINE__); return 0; } // create the max node if(!pNode->Create(NULL, m_pInterface->GetINodeByName(strName.c_str()))) { delete pNode; return 0; } return pNode; } CMaxNode* CMaxInterface::GetSelectedNode(int nodeId) { // get the number of selected nodes int nodeCount; nodeCount = m_pInterface->GetSelNodeCount(); // if nothing is selected, we go with the scene root node if(nodeCount == 0) { // check if the given node id is valid if(nodeId == 0) { // allocate a new max node instance CMaxNode *pNode; pNode = new CMaxNode(); if(pNode == 0) { //theExporter.SetLastError("Memory allocation failed.", __FILE__, __LINE__); return 0; } // create the max node if(!pNode->Create(NULL, m_pInterface->GetRootNode())) { delete pNode; return 0; } return pNode; } // invalid node id requested! return 0; } // check if the given node id is valid if((nodeId < 0) || (nodeId >= m_pInterface->GetSelNodeCount())) { //theExporter.SetLastError("Invalid handle.", __FILE__, __LINE__); return 0; } // allocate a new max node instance CMaxNode *pNode; pNode = new CMaxNode(); if(pNode == 0) { //theExporter.SetLastError("Memory allocation failed.", __FILE__, __LINE__); return 0; } // create the max node if(!pNode->Create(NULL, m_pInterface->GetSelNode(nodeId))) { delete pNode; return 0; } return pNode; } int CMaxInterface::GetTime() { return m_pInterface->GetTime(); } CMaxMaterial* CMaxInterface::GetMaterial(int nMaterialID) { return NULL; } int CMaxInterface::GetMaterialCount() { int nMaterialCount = 0; return nMaterialCount; } void CMaxInterface::SetProgressInfo(int percentage) { m_pInterface->ProgressUpdate(percentage); } void CMaxInterface::SetTime(int nTime) { m_pInterface->SetTime(nTime); } void CMaxInterface::StartProgressInfo(char* szText) { m_pInterface->ProgressStart(szText, TRUE, ProgressFunction, NULL); } void CMaxInterface::StopProgressInfo() { m_pInterface->ProgressEnd(); } Matrix3 CMaxInterface::ConvertToDXMatrix(Matrix3& mat) { AffineParts localAff; Matrix3 newMat; decomp_affine(mat, &localAff); Point3 position = Point3(localAff.t.x, localAff.t.z, localAff.t.y); //ScaleValue(parts.k*parts.f, parts.u) Point3 scale = Point3(localAff.k.x, localAff.k.z, localAff.k.y); //localAff.u. //scale *= localAff.u; //Point3(localAff.k.x, localAff.k.z, localAff.k.y); ApplyScaling(newMat, ScaleValue(localAff.k * localAff.f, localAff.u)); Quat rotation(localAff.q.x, localAff.q.z, localAff.q.y, -localAff.q.w); //原来是-w,现在去掉,看看效果 Quat sRotation(localAff.u.x, localAff.u.z, localAff.u.y, -localAff.u.w); bool bMirror = IsMatrixMirrored(mat); rotation.MakeMatrix(newMat); newMat.SetRow(3, position); newMat.Scale(scale); //newMat.SetTranslate(position); Matrix3 srtm, rtm, ptm, stm, ftm; ftm = ScaleMatrix(Point3(localAff.f, localAff.f, localAff.f)); ptm.IdentityMatrix(); ptm.SetTrans(position); rotation.MakeMatrix(rtm); sRotation.MakeMatrix(srtm); stm = ScaleMatrix(scale); newMat = Inverse(srtm) * stm * srtm * rtm * ftm * ptm; return newMat; } Matrix3 CMaxInterface::ConvertToYUpMatrix(const Matrix3& mat) { AffineParts localAff; Matrix3 newMat; decomp_affine(mat, &localAff); Point3 position = Point3(-localAff.t.x, localAff.t.z, localAff.t.y); //ScaleValue(parts.k*parts.f, parts.u) Point3 scale = Point3(localAff.k.x, localAff.k.z, localAff.k.y); //localAff.u. //scale *= localAff.u; //Point3(localAff.k.x, localAff.k.z, localAff.k.y); ApplyScaling(newMat, ScaleValue(localAff.k * localAff.f, localAff.u)); Quat rotation(-localAff.q.x, localAff.q.z, localAff.q.y, localAff.q.w); //原来是-w,现在去掉,看看效果 Quat sRotation(-localAff.u.x, localAff.u.z, localAff.u.y, localAff.u.w); bool bMirror = IsMatrixMirrored(mat); rotation.MakeMatrix(newMat); newMat.SetRow(3, position); newMat.Scale(scale); //newMat.SetTranslate(position); Matrix3 srtm, rtm, ptm, stm, ftm; ftm = ScaleMatrix(Point3(localAff.f, localAff.f, localAff.f)); ptm.IdentityMatrix(); ptm.SetTrans(position); rotation.MakeMatrix(rtm); sRotation.MakeMatrix(srtm); stm = ScaleMatrix(scale); newMat = Inverse(srtm) * stm * srtm * rtm * ftm * ptm; return newMat; } void CMaxInterface::Clear() { m_pInterface->ReleaseInterface(); } bool CMaxInterface::IsMatrixMirrored(const Matrix3& tm) { Point3 r1, r2, r3, r12; float Mirror; r1 = tm.GetRow(0); r2 = tm.GetRow(1); r3 = tm.GetRow(2); r12 = CrossProd(r1, r2);//法向量计算 Mirror = DotProd(r12, r3);//角度计算 return Mirror < 0; }
[ "air_liang1212@163.com" ]
air_liang1212@163.com
2d4c6ff3000fa1c5703af15b2d065623cc137a54
5bc1574077bcc42ff95799ac56aefe94e9c22970
/517-7 C.cpp
c098c23a97d585c7f0c115afc5e81d4052e283a1
[ "MIT" ]
permissive
AndrewWayne/OI_Learning
2d641e8b5e4752c02549b67e201f0987f8ddce46
0fe8580066704c8d120a131f6186fd7985924dd4
refs/heads/master
2020-03-26T21:15:44.059884
2020-02-26T08:00:53
2020-02-26T08:00:53
145,377,729
0
0
null
null
null
null
UTF-8
C++
false
false
3,384
cpp
/* * Author: xiaohei_AWM * Date: * Motto: Face to the weakness, expect for the strength. */ #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<cstdlib> #include<ctime> #include<utility> #include<functional> #include<cmath> #include<vector> #include<assert.h> using namespace std; #define reg register #define endfile fclose(stdin);fclose(stdout); typedef long long ll; typedef unsigned long long ull; typedef double db; typedef std::pair<int,int> pii; typedef std::pair<ll,ll> pll; namespace IO{ char buf[1<<15],*S,*T; inline char gc(){ if (S==T){ T=(S=buf)+fread(buf,1,1<<15,stdin); if (S==T)return EOF; } return *S++; } inline int read(){ reg int x;reg bool f;reg char c; for(f=0;(c=gc())<'0'||c>'9';f=c=='-'); for(x=c^'0';(c=gc())>='0'&&c<='9';x=(x<<3)+(x<<1)+(c^'0')); return f?-x:x; } inline ll readll(){ reg ll x;reg bool f;reg char c; for(f=0;(c=gc())<'0'||c>'9';f=c=='-'); for(x=c^'0';(c=gc())>='0'&&c<='9';x=(x<<3)+(x<<1)+(c^'0')); return f?-x:x; } } using namespace IO; const int MAX_V = 100004; const long long llINF = 9223372036854775807; const int INF = 2147483647; /* ll mul(ll a, ll b, ll p){ asm( "mul %%ebx\n" "div %%ecx" : "=d"(a) : "a"(a), "b"(b), "c"(p) ); return a; } */ const int maxn = 1e5 + 10; int t, n, m, x, y, dad[maxn], sze[maxn], f[maxn]; int luck[maxn], top, ans, num[maxn]; int find(int x){return x == dad[x] ? x : dad[x] = find(dad[x]);} void unionn(int u, int v){ int fu = find(u), fv = find(v); if(fu == fv) return; dad[fu] = fv, sze[fv] += sze[fu]; } bool check(int x){ for(int i = x; i; i /= 10) if(i % 10 != 4 && i % 10 != 7) return false; return true; } int A[maxn]; inline void pack(int f[], int V, int k, int v, int c){// k是件数,v是体积,c是价值 V 是最大体积 int top = 0; if (k == 0 || c == 0) return; if(k*v >= V){ for(int j = v; j <= V; j++)//完全背包 f[j] = min(f[j], f[j-v] + c); }else{ for(int j = 1; j <= k; j <<= 1){ A[top++] = j; k -= j; } if(k) A[top++] = k; for(int a = 0; a < top; a++){//01背包 for(int b = V; b >= A[a] * v; b--) f[b] = min(f[b], f[b - v*A[a]] + c * A[a]); } } } int main(){ t = read(); for(int i = 1; i <= maxn-1; i++) if(check(i)) luck[++top] = i; cerr << endl; while(t--){ memset(num, 0, sizeof(num)); n = read(), m = read(); for(int i = 1; i <= n; i++) dad[i] = i, sze[i] = 1, f[i] = maxn; for(int i = 1; i <= m; i++) x = read(), y = read(), unionn(x, y); for(int i = 1; i <= n; i++){ if(dad[i] != i) sze[i] = 0; else num[sze[i]]++; } f[0] = 0; for(int i = 1; i <= n; i++){ if(num[i] == 0) continue; //cerr << i << ": " << num[i] << endl; pack(f, n, num[i], i, 1); } //for(int i = 1; i <= n; i++) cerr << f[i] << endl; ans = maxn; for(int i = 1; i <= top; i++) if(luck[i] <= n) ans = min(f[luck[i]]-1, ans); if(ans > n) printf("-1\n"); else printf("%d\n", ans); } return 0; }
[ "AndrewWayne2016@gmail.com" ]
AndrewWayne2016@gmail.com
64471acb3a672d537bc00650e8d4d6fb2629cc9f
d9f78cc6722c2c6d1af2af9e2aff0d9a78f5e7f3
/Cookie/PhysicsTask.h
a8bd7dcd87b050488b4cdc887c80ff112503c088
[]
no_license
MaximeWYZUJ/2019-CppNoEngine-SuperRacingGalaxy
74d0cd2b46f69b6c58c9ef52ab6bbfc23df592c6
c26fa7806bc54593ce74382743068dc3cc1dd847
refs/heads/master
2020-12-06T11:27:15.450156
2019-12-21T14:58:12
2019-12-21T14:58:12
232,447,666
0
0
null
null
null
null
UTF-8
C++
false
false
294
h
#pragma once #include "PhysicCollisionCallback.h" #include "PhysicsComponent.h" namespace Cookie { struct PhysicsTask { PhysicsComponent* taskOrigin; PhysicsComponent* taskDestination; PhysicsCollisionCallback* f; void job() const { (*f)(taskOrigin, taskDestination); } }; }
[ "36268562+Gloubii@users.noreply.github.com" ]
36268562+Gloubii@users.noreply.github.com
039087253cbcb8fd9511c91df78d41cfdf55dec3
7a3d678ddc527aa6f56adb6bce0b3d93aa53995f
/iree/tools/debugger/debug_prompt.cc
e257d6cd224f9a0c036bf4ecf434b7f65ed26d4d
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
aniket-daphale/iree
428d2be0abf3b7cf30a9eb7cc9910d3171fb9757
6fdbbf8656a20a5ce00c465bef99c01c16e33409
refs/heads/master
2020-08-06T06:12:36.813816
2019-10-04T17:17:12
2019-10-04T17:17:12
212,866,703
1
0
Apache-2.0
2019-10-04T17:16:36
2019-10-04T17:16:36
null
UTF-8
C++
false
false
2,506
cc
// Copyright 2019 Google LLC // // 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 // // https://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 "iree/tools/debugger/debug_prompt.h" #include "iree/base/status.h" #include "iree/vm/debug/debug_client.h" namespace iree { namespace vm { namespace debug { namespace { class DebugPrompt : private DebugClient::Listener { public: Status Connect(absl::string_view debug_service_uri) { // Connect to the debug service. ASSIGN_OR_RETURN(debug_client_, DebugClient::Connect(debug_service_uri, this)); return OkStatus(); } Status Run() { // Query commands, transmit requests, and dispatch responses. while (true) { RETURN_IF_ERROR(debug_client_->Poll()); // TODO(benvanik): ask for a command. // TODO(benvanik): display stuff. } } private: Status OnContextRegistered(const RemoteContext& context) override { // Ack. return debug_client_->MakeReady(); } Status OnContextUnregistered(const RemoteContext& context) override { // Ack. return debug_client_->MakeReady(); } Status OnModuleLoaded(const RemoteContext& context, const RemoteModule& module) override { // Ack. return debug_client_->MakeReady(); } Status OnFiberRegistered(const RemoteFiberState& fiber_state) override { // Ack. return debug_client_->MakeReady(); } Status OnFiberUnregistered(const RemoteFiberState& fiber_state) override { // Ack. return debug_client_->MakeReady(); } Status OnBreakpointHit(const RemoteBreakpoint& breakpoint, const RemoteFiberState& fiber_state) override { // Ack. return debug_client_->MakeReady(); } std::unique_ptr<DebugClient> debug_client_; }; } // namespace Status AttachDebugPrompt(absl::string_view debug_service_uri) { DebugPrompt debug_prompt; RETURN_IF_ERROR(debug_prompt.Connect(debug_service_uri)); return debug_prompt.Run(); } } // namespace debug } // namespace vm } // namespace iree
[ "ben.vanik@gmail.com" ]
ben.vanik@gmail.com
9f56336d40ecc66e8633a70fd2af180c588cddad
bffe9f6f5f9cd5ec6035cea617c1a236bd4b99e7
/datastructures/stackUsingLinkedList/stackUsingLinkedList.cpp
3fe8d98dc048ebd9270493c756c17ee1d0fe814c
[]
no_license
NagarajuPeduri/NCR-INTERN
0d1ee3edf4343ece378041343915e900f3c42931
eb5f4e7189aff5218595e47704f62051fbbbb709
refs/heads/master
2021-01-09T00:02:59.757180
2020-03-19T07:59:03
2020-03-19T07:59:03
242,111,640
0
0
null
null
null
null
UTF-8
C++
false
false
1,845
cpp
//pnr7 // stackUsingLinkedList.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> using namespace std; class Node { public: int data; Node* next; }; Node* createNode(int x) { Node* n = new Node; n->data = x; n->next = NULL; return n; } Node* insert(Node* head, int ele) { Node* newNode = createNode(ele); newNode->next = head; head = newNode; return head; } Node* deleteHead(Node* head) { cout << "\nPopped element: " << head->data << "\n\n"; Node* temp = head; head = head->next; free(temp); return head; } void display(Node* head) { cout << "\nStack elements: \n"; while (head != NULL) { cout << head->data << " "; head = head->next; } cout << "\n\n"; } int main() { int element, length=0; Node* head = NULL; while (true) { cout << "Enter 1 to push\nEnter 2 to pop\nEnter 3 to get size\nEnter 4 to display stack\nEnter 5 to exit\nEnter: "; int flag; cin >> flag; switch (flag) { case 1: //Pushing cout << "Enter: "; cin >> element; cout << "\n"; length++; head = insert(head, element); break; case 2: //popping if (length == 0) cout << "\nEmpty\n\n"; else { length--; head = deleteHead(head); } break; case 3: //size cout << "\nStack size is " << length << "\n\n"; break; case 4: //display if (length == 0) cout << "\nEmpty\n\n"; else display(head); break; case 5: //Exit return 0; } } }
[ "pedurinagaraju7@gmail.com" ]
pedurinagaraju7@gmail.com
87916c7ac7fba75ee75f1db09e4d148658da85e0
cadb836d9ac9c9e3b618cf44c936015a0aea24a8
/ge1200/LT1233_Remove_Sub-Folders_from_the_Filesystem.cpp
bff1198001dbfaf3cbe82b61ac973c46a935aca3
[]
no_license
checkoutb/LeetCodeCCpp
c6341a9fa5583a69046555a892bb41052624e83c
38832f7ccadf26b781cd8c9783c50916d1380554
refs/heads/master
2023-09-03T22:35:50.266523
2023-09-03T06:31:51
2023-09-03T06:31:51
182,722,336
0
1
null
null
null
null
UTF-8
C++
false
false
2,464
cpp
#include "../header/myheader.h" class LT1233 { public: // D D // 直接sort folder。。。可以的。字典顺序,保证了 父文件夹一定在 它的子文件夹之前。。 // for(string &s:folder) // if(res.empty() // ||s.rfind(res.back(), 0) != 0 // ||s[res.back().length()]!='/') // res.push_back(s); // 而且 父文件夹之间在前面,确实可以 res.back ...... //Arrays.sort(folder, Comparator.comparing(s -> s.length())); // 按长度也可以,不过 不能保证 父文件夹和子文件夹 连在一起。 // trie不必保存string, 只需要保存 bool 代表是否结束。 string 由父结点的 hashMap 的key 来表达。 //Runtime: 588 ms, faster than 21.04% of C++ online submissions for Remove Sub-Folders from the Filesystem. //Memory Usage: 62.4 MB, less than 5.57% of C++ online submissions for Remove Sub-Folders from the Filesystem. // trie? vector<string> lt1233a(vector<string>& folder) { // std::sort(begin(folder), end(folder), [](string& s1, string& s2){ return accumulate }) unordered_map<string, int> map2; for (string& s : folder) { map2[s] = std::accumulate(begin(s), end(s), 0, [](int v, char ch) { return v + (ch == '/'); }); } std::sort(begin(folder), end(folder), [&map2](string& s1, string& s2) { return map2[s1] < map2[s2]; }); // #ifdef __test // for (auto& p : map2) // cout<<p.first<<" : "<<p.second<<endl; // // for (string& s : folder) // cout<<s<<", "; // cout<<endl; // #endif // __test vector<string> ans; // unordered_set<string> set2; for (string& s : folder) { int st1 = 0; while ((st1 = s.find('/', st1 + 1)) != std::string::npos) { string subs = s.substr(0, st1); if (map2.find(subs) != map2.end()) { goto AAA; } } ans.push_back(s); AAA: continue; } return ans; } }; int main() { // vector<string> vs = {"/a","/a/b","/c/d","/c/d/e","/c/f"}; // vector<string> vs = {"/a","/a/b/c","/a/b/d"}; vector<string> vs = {"/a/b/c","/a/b/ca","/a/b/d"}; LT1233 lt; vector<string> ans = lt.lt1233a(vs); for (string& s : ans) cout<<s<<endl; return 0; }
[ "f12.628@hotmail.com" ]
f12.628@hotmail.com
132283c5ff94c63ba0bb2efb2d0def2e3b425297
711e5c8b643dd2a93fbcbada982d7ad489fb0169
/XPSP1/NT/termsrv/setup/nttype/nttype.cpp
ab8eec45dbdfe7e3d058117cadc3e5d8bd0aea0c
[]
no_license
aurantst/windows-XP-SP1
629a7763c082fd04d3b881e0d32a1cfbd523b5ce
d521b6360fcff4294ae6c5651c539f1b9a6cbb49
refs/heads/master
2023-03-21T01:08:39.870106
2020-09-28T08:10:11
2020-09-28T08:10:11
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,752
cpp
// Copyright (c) 1998 - 1999 Microsoft Corporation #include <windows.h> #include <iostream.h> #include <fstream.h> #include <strstrea.h> int #if !defined(_MIPS_) && !defined(_ALPHA_) && !defined(_PPC_) _cdecl #endif main( int /* argc */, char ** /* argv */) { OSVERSIONINFOEX osVersion; ZeroMemory(&osVersion, sizeof(OSVERSIONINFOEX)); osVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if (GetVersionEx((LPOSVERSIONINFO )&osVersion)) { cout << "Prodcut Type:" << endl; if (osVersion.wProductType == VER_NT_WORKSTATION) { cout << "VER_NT_WORKSTATION" << endl; } if (osVersion.wProductType == VER_NT_DOMAIN_CONTROLLER) { cout << "VER_NT_DOMAIN_CONTROLLER" << endl; } if (osVersion.wProductType == VER_NT_SERVER) { cout << "VER_NT_SERVER" << endl; } cout << "Suite:" << endl; if (osVersion.wSuiteMask & VER_SERVER_NT) { cout << "VER_SERVER_NT" << endl; } if (osVersion.wSuiteMask & VER_WORKSTATION_NT) { cout << "VER_WORKSTATION_NT" << endl; } if (osVersion.wSuiteMask & VER_SUITE_SMALLBUSINESS) { cout << "VER_SUITE_SMALLBUSINESS" << endl; } if (osVersion.wSuiteMask & VER_SUITE_ENTERPRISE) { cout << "VER_SUITE_ENTERPRISE" << endl; } if (osVersion.wSuiteMask & VER_SUITE_BACKOFFICE) { cout << "VER_SUITE_BACKOFFICE" << endl; } if (osVersion.wSuiteMask & VER_SUITE_COMMUNICATIONS) { cout << "VER_SUITE_COMMUNICATIONS" << endl; } if (osVersion.wSuiteMask & VER_SUITE_TERMINAL) { cout << "VER_SUITE_TERMINAL" << endl; } if (osVersion.wSuiteMask & VER_SUITE_SMALLBUSINESS_RESTRICTED) { cout << "VER_SUITE_SMALLBUSINESS_RESTRICTED" << endl; } if (osVersion.wSuiteMask & VER_SUITE_EMBEDDEDNT) { cout << "VER_SUITE_EMBEDDEDNT" << endl; } if (osVersion.wSuiteMask & VER_SUITE_DATACENTER) { cout << "VER_SUITE_DATACENTER" << endl; } if (osVersion.wSuiteMask & VER_SUITE_SINGLEUSERTS) { cout << "VER_SUITE_SINGLEUSERTS" << endl; } if (osVersion.wSuiteMask & VER_SUITE_PERSONAL) { cout << "VER_SUITE_PERSONAL" << endl; } } else { cout << "GetVersionEx failed, LastError = " << GetLastError() << endl; } }
[ "112426112@qq.com" ]
112426112@qq.com
ed5eeec0fa3be42eff33f7c35eecf4f86fc90eb9
567d8343721671734aebaaf7e401b746e27a6a35
/math/Basis.h
ed04b33f03ac09e61b83f6d31542dabe37c3e0d2
[]
no_license
Jon0/opengl-project
ef3a0c0a4ff1b9141fe854375f2b88034728be62
fda6b235791d5ef7af9437819fa5c07351c32795
refs/heads/master
2021-01-19T07:55:10.867134
2013-10-24T16:04:41
2013-10-24T16:04:41
12,919,805
1
0
null
null
null
null
UTF-8
C++
false
false
481
h
/* * Basis.h * * Created on: 22/09/2013 * Author: remnanjona */ #ifndef BASIS_H_ #define BASIS_H_ #include "Vec3D.h" namespace std { class GVertex; class Basis { public: Vec3D v[3]; Basis(); Basis(Vec3D a, Vec3D b, Vec3D c); virtual ~Basis(); void normalise(); void print(); Basis &operator=(const Basis &); Basis &operator+=(const Basis &); }; Basis textureBasis( GVertex *primary, GVertex *a, GVertex *b ); } /* namespace std */ #endif /* BASIS_H_ */
[ "jono4728@gmail.com" ]
jono4728@gmail.com
00c0ac2c9b2ee6257a1a00a9496ed38b7f78bd62
e695d0ddeffa22aed711e72aacdbd88a950a5abb
/图/图论500/最小生成树并查集/hdoj1232并查集图再加多少边联通.cpp
01b2c5871cac2fb65b97585ef1516336a44b5e68
[]
no_license
nNbSzxx/ACM
febe12eae960950bb4f03d0e14e72d54e66b4eee
e3994e292f2848b3fbe190b6273fdc30d69e887b
refs/heads/master
2020-03-23T22:08:11.582054
2019-02-07T12:45:27
2019-02-07T12:45:27
142,155,512
0
0
null
null
null
null
UTF-8
C++
false
false
630
cpp
#include <iostream> #include <cstring> #include <algorithm> #include <cstdio> using namespace std; const int MAX = 1005; int n,m,cnt; int father[MAX]; int find(int x) { while (x != father[x]) { father[x] = father[father[x]]; x = father[x]; } return x; } void unite(int a, int b) { a = find(a); b = find(b); if (a != b) { cnt --; father[a] = b; } return ; } int main() { while (scanf("%d",&n), n) { cnt = n - 1; scanf("%d",&m); for (int i = 1; i <= n; i ++) { father[i] = i; } int a,b; for (int i = 1; i <= m; i ++) { scanf("%d%d",&a,&b); unite(a,b); } printf("%d\n",cnt); } return 0; }
[ "hpzhuxiaoxie@163.com" ]
hpzhuxiaoxie@163.com
e587a44a9f9844b6a637ff53a734d41844233983
0585b7592670a84fc9627b5c0f40a98c1b68b0b5
/9 MOSSE/MosseFilters-C++/src/FeatureRX.h
79cc4db1cb420724bc61912c4cbdf84683766695
[]
no_license
loric0612/bisheing1
10a198868e603df9ed5b433cc4ec8e8b57520cd1
037f9fd444f176eb9abd8c6ad90d04a4377c3bff
refs/heads/master
2020-09-27T08:44:51.996268
2017-10-19T14:08:31
2017-10-19T14:08:31
226,477,376
1
0
null
2019-12-07T08:08:27
2019-12-07T08:08:27
null
UTF-8
C++
false
false
592
h
#ifndef __FEATURERX_H #define __FEATURERX_H // FeatureRX.h // The right eye location feature #include "Feature.h" class FeatureRX : public Feature { public: FeatureRX() : Feature(Feature::RX) { minVal = FLT_MAX; maxVal = FLT_MIN; } virtual ~FeatureRX() { } // the extract method is expected to be implemented in each derived class virtual double extract(FrameAnnotation* annotation) { double result = annotation->getRightIris().x; if (minVal > result) minVal = result; if (maxVal < result) maxVal = result; return result; } }; #endif
[ "wyuzyf@aliyun.com" ]
wyuzyf@aliyun.com
041bcfc5ddcbb06c7faa0b52fea896b2aacbc3b8
08aceda373c0bbf54660ec459581ea552e299ae4
/mainwindow.h
d3770722dc63058dacdd2933fb8856cdd11a4344
[]
no_license
Alleng909/Grade-GUI
5c63b6afdd9b59286e46ee84512663a99a214734
644a71cdfdb21022ebc97b8a89f41b9ec33be8db
refs/heads/master
2021-08-28T07:15:09.604873
2017-12-11T15:04:41
2017-12-11T15:04:41
113,872,613
0
0
null
null
null
null
UTF-8
C++
false
false
448
h
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: void on_pushButton_clicked(); void on_pushButton_2_clicked(); void on_OptionA_clicked(); void on_radioButton_2_clicked(); private: Ui::MainWindow *ui; }; #endif // MAINWINDOW_H
[ "alleng909@gmail.com" ]
alleng909@gmail.com
4ec19b49d3216acbcded5a19bd86744fe2a7f8bb
4f07dffbbc1dcf3c06c33219296eb72d99b08ab0
/components/arc/usb/usb_host_bridge.cc
111b9d8957c0bcf1eab3ce684ed539280d244aa8
[ "BSD-3-Clause" ]
permissive
zeyiwu/chromium
4815e89f8a9acd0e9e6957dc2be6e6d6f4995a52
2969192f368b295477a3348584160a854fd3316b
refs/heads/master
2023-02-21T20:39:29.821478
2018-05-22T02:04:26
2018-05-22T02:04:26
134,348,434
1
0
null
2018-05-22T02:16:57
2018-05-22T02:16:57
null
UTF-8
C++
false
false
11,752
cc
// Copyright 2017 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 "components/arc/usb/usb_host_bridge.h" #include <utility> #include "base/bind.h" #include "base/logging.h" #include "base/memory/singleton.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/permission_broker_client.h" #include "components/arc/arc_bridge_service.h" #include "components/arc/arc_browser_context_keyed_service_factory_base.h" #include "components/arc/arc_features.h" #include "components/arc/usb/usb_host_ui_delegate.h" #include "device/base/device_client.h" #include "device/usb/mojo/type_converters.h" #include "device/usb/usb_device_handle.h" #include "device/usb/usb_device_linux.h" #include "mojo/edk/embedder/embedder.h" #include "mojo/edk/embedder/scoped_platform_handle.h" namespace arc { namespace { // Singleton factory for ArcUsbHostBridge class ArcUsbHostBridgeFactory : public internal::ArcBrowserContextKeyedServiceFactoryBase< ArcUsbHostBridge, ArcUsbHostBridgeFactory> { public: // Factory name used by ArcBrowserContextKeyedServiceFactoryBase. static constexpr const char* kName = "ArcUsbHostBridgeFactory"; static ArcUsbHostBridgeFactory* GetInstance() { return base::Singleton<ArcUsbHostBridgeFactory>::get(); } private: friend base::DefaultSingletonTraits<ArcUsbHostBridgeFactory>; ArcUsbHostBridgeFactory() = default; ~ArcUsbHostBridgeFactory() override = default; }; void OnDeviceOpened(mojom::UsbHostHost::OpenDeviceCallback callback, base::ScopedFD fd) { if (!fd.is_valid()) { LOG(ERROR) << "Invalid USB device FD"; std::move(callback).Run(mojo::ScopedHandle()); return; } mojo::edk::ScopedPlatformHandle platform_handle{ mojo::edk::PlatformHandle(fd.release())}; MojoHandle wrapped_handle; MojoResult wrap_result = mojo::edk::CreatePlatformHandleWrapper( std::move(platform_handle), &wrapped_handle); if (wrap_result != MOJO_RESULT_OK) { LOG(ERROR) << "Failed to wrap device FD. Closing: " << wrap_result; std::move(callback).Run(mojo::ScopedHandle()); return; } mojo::ScopedHandle scoped_handle{mojo::Handle(wrapped_handle)}; std::move(callback).Run(std::move(scoped_handle)); } void OnDeviceOpenError(mojom::UsbHostHost::OpenDeviceCallback callback, const std::string& error_name, const std::string& error_message) { LOG(WARNING) << "Cannot open USB device: " << error_name << ": " << error_message; std::move(callback).Run(mojo::ScopedHandle()); } using CheckedCallback = base::RepeatingCallback<void(const std::string& guid, bool success)>; void OnGetDevicesComplete( const CheckedCallback& callback, const std::vector<scoped_refptr<device::UsbDevice>>& devices) { for (const scoped_refptr<device::UsbDevice>& device : devices) device->CheckUsbAccess(base::BindOnce(callback, device.get()->guid())); } } // namespace ArcUsbHostBridge* ArcUsbHostBridge::GetForBrowserContext( content::BrowserContext* context) { return ArcUsbHostBridgeFactory::GetForBrowserContext(context); } ArcUsbHostBridge::ArcUsbHostBridge(content::BrowserContext* context, ArcBridgeService* bridge_service) : arc_bridge_service_(bridge_service), usb_observer_(this), weak_factory_(this) { arc_bridge_service_->usb_host()->SetHost(this); arc_bridge_service_->usb_host()->AddObserver(this); usb_service_ = device::DeviceClient::Get()->GetUsbService(); if (usb_service_) usb_observer_.Add(usb_service_); } ArcUsbHostBridge::~ArcUsbHostBridge() { if (usb_service_) usb_service_->RemoveObserver(this); arc_bridge_service_->usb_host()->RemoveObserver(this); arc_bridge_service_->usb_host()->SetHost(nullptr); } BrowserContextKeyedServiceFactory* ArcUsbHostBridge::GetFactory() { return ArcUsbHostBridgeFactory::GetInstance(); } void ArcUsbHostBridge::RequestPermission(const std::string& guid, const std::string& package, bool interactive, RequestPermissionCallback callback) { if (guid.empty()) { HandleScanDeviceListRequest(package, std::move(callback)); return; } VLOG(2) << "USB RequestPermission " << guid << " package " << package; // Permission already requested. if (HasPermissionForDevice(guid, package)) { std::move(callback).Run(true); return; } // The other side was just checking, fail without asking the user. if (!interactive) { std::move(callback).Run(HasPermissionForDevice(guid, package)); return; } // Ask the authorization from the user. DoRequestUserAuthorization(guid, package, std::move(callback)); } void ArcUsbHostBridge::OpenDevice(const std::string& guid, const base::Optional<std::string>& package, OpenDeviceCallback callback) { if (!usb_service_ || !package) { std::move(callback).Run(mojo::ScopedHandle()); return; } device::UsbDeviceLinux* device = static_cast<device::UsbDeviceLinux*>(usb_service_->GetDevice(guid).get()); if (!device) { std::move(callback).Run(mojo::ScopedHandle()); return; } // The RequestPermission was never done, abort. if (!HasPermissionForDevice(guid, package.value())) { std::move(callback).Run(mojo::ScopedHandle()); return; } chromeos::PermissionBrokerClient* client = chromeos::DBusThreadManager::Get()->GetPermissionBrokerClient(); DCHECK(client) << "Could not get permission broker client."; auto repeating_callback = base::AdaptCallbackForRepeating(std::move(callback)); client->OpenPath(device->device_path(), base::Bind(&OnDeviceOpened, repeating_callback), base::Bind(&OnDeviceOpenError, repeating_callback)); } void ArcUsbHostBridge::GetDeviceInfo(const std::string& guid, GetDeviceInfoCallback callback) { if (!usb_service_) { std::move(callback).Run(std::string(), nullptr); return; } scoped_refptr<device::UsbDevice> device = usb_service_->GetDevice(guid); if (!device.get()) { LOG(WARNING) << "Unknown USB device " << guid; std::move(callback).Run(std::string(), nullptr); return; } device::mojom::UsbDeviceInfoPtr info = device::mojom::UsbDeviceInfo::From(*device); // b/69295049 the other side doesn't like optional strings. for (const device::mojom::UsbConfigurationInfoPtr& cfg : info->configurations) { cfg->configuration_name = cfg->configuration_name.value_or(base::string16()); for (const device::mojom::UsbInterfaceInfoPtr& iface : cfg->interfaces) { for (const device::mojom::UsbAlternateInterfaceInfoPtr& alt : iface->alternates) { alt->interface_name = alt->interface_name.value_or(base::string16()); } } } std::string path = static_cast<device::UsbDeviceLinux*>(device.get())->device_path(); std::move(callback).Run(path, std::move(info)); } // device::UsbService::Observer callbacks. void ArcUsbHostBridge::OnDeviceAdded(scoped_refptr<device::UsbDevice> device) { device->CheckUsbAccess(base::BindOnce(&ArcUsbHostBridge::OnDeviceChecked, weak_factory_.GetWeakPtr(), device.get()->guid())); } void ArcUsbHostBridge::OnDeviceRemoved( scoped_refptr<device::UsbDevice> device) { mojom::UsbHostInstance* usb_host_instance = ARC_GET_INSTANCE_FOR_METHOD( arc_bridge_service_->usb_host(), OnDeviceAdded); if (!usb_host_instance) { VLOG(2) << "UsbInstance not ready yet"; return; } usb_host_instance->OnDeviceRemoved( device.get()->guid(), GetEventReceiverPackages(device.get()->guid())); if (ui_delegate_) ui_delegate_->DeviceRemoved(device.get()->guid()); } // Notifies the observer that the UsbService it depends on is shutting down. void ArcUsbHostBridge::WillDestroyUsbService() { // Disconnect. arc_bridge_service_->usb_host()->SetHost(nullptr); } void ArcUsbHostBridge::OnConnectionReady() { if (!usb_service_) return; // Send the (filtered) list of already existing USB devices to the other side. usb_service_->GetDevices( base::Bind(&OnGetDevicesComplete, base::BindRepeating(&ArcUsbHostBridge::OnDeviceChecked, weak_factory_.GetWeakPtr()))); } void ArcUsbHostBridge::OnConnectionClosed() { if (ui_delegate_) ui_delegate_->ClearPermissionRequests(); } void ArcUsbHostBridge::Shutdown() { ui_delegate_ = nullptr; } void ArcUsbHostBridge::SetUiDelegate(ArcUsbHostUiDelegate* ui_delegate) { ui_delegate_ = ui_delegate; } std::vector<std::string> ArcUsbHostBridge::GetEventReceiverPackages( const std::string& guid) { scoped_refptr<device::UsbDevice> device = usb_service_->GetDevice(guid); if (!device.get()) { LOG(WARNING) << "Unknown USB device " << guid; return std::vector<std::string>(); } if (!ui_delegate_) return std::vector<std::string>(); std::unordered_set<std::string> receivers = ui_delegate_->GetEventPackageList( guid, device->serial_number(), device->vendor_id(), device->product_id()); return std::vector<std::string>(receivers.begin(), receivers.end()); } void ArcUsbHostBridge::OnDeviceChecked(const std::string& guid, bool allowed) { if (!base::FeatureList::IsEnabled(arc::kUsbHostFeature)) { VLOG(1) << "AndroidUSBHost: feature is disabled; ignoring"; return; } if (!allowed) return; mojom::UsbHostInstance* usb_host_instance = ARC_GET_INSTANCE_FOR_METHOD( arc_bridge_service_->usb_host(), OnDeviceAdded); if (!usb_host_instance) return; usb_host_instance->OnDeviceAdded(guid, GetEventReceiverPackages(guid)); } void ArcUsbHostBridge::DoRequestUserAuthorization( const std::string& guid, const std::string& package, RequestPermissionCallback callback) { if (!ui_delegate_) { std::move(callback).Run(false); return; } if (!usb_service_) { std::move(callback).Run(false); return; } scoped_refptr<device::UsbDevice> device = usb_service_->GetDevice(guid); if (!device.get()) { LOG(WARNING) << "Unknown USB device " << guid; std::move(callback).Run(false); return; } ui_delegate_->RequestUsbAccessPermission( package, guid, device->serial_number(), device->manufacturer_string(), device->product_string(), device->vendor_id(), device->product_id(), std::move(callback)); } bool ArcUsbHostBridge::HasPermissionForDevice(const std::string& guid, const std::string& package) { if (!ui_delegate_) return false; if (!usb_service_) return false; scoped_refptr<device::UsbDevice> device = usb_service_->GetDevice(guid); if (!device.get()) { LOG(WARNING) << "Unknown USB device " << guid; return false; } return ui_delegate_->HasUsbAccessPermission( package, guid, device->serial_number(), device->vendor_id(), device->product_id()); } void ArcUsbHostBridge::HandleScanDeviceListRequest( const std::string& package, RequestPermissionCallback callback) { if (!ui_delegate_) { std::move(callback).Run(false); return; } VLOG(2) << "USB Request USB scan devicelist permission " << "package: " << package; ui_delegate_->RequestUsbScanDeviceListPermission(package, std::move(callback)); } } // namespace arc
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
fab4eccedcd2682e406c2b21c3283f2324116254
3593129f78daf47423c04aa2bdcb52d4b4e7e331
/src/include/AST/print.hpp
7374ab5b2d2240b38c8d82acfa3201fd737ad9f9
[ "MIT" ]
permissive
allen880117/NCTU-compiler-f19-hw3
15bc89f3e512fe3a6ad0699510bf189fb0d858be
a8ab821ae4c2c3ba70ccff19d8aced6f8ea7c008
refs/heads/master
2022-04-06T13:25:26.111384
2020-02-12T12:35:02
2020-02-12T12:35:02
235,930,243
8
6
null
null
null
null
UTF-8
C++
false
false
461
hpp
#pragma once #include "AST/ast.hpp" #include "visitor/visitor.hpp" class PrintNode : public ASTNodeBase { public: int line_number; // print int col_number; // print Node expression_node; // Target public: PrintNode( int _line_number, int _col_number, Node _expression_node); ~PrintNode(); void accept(ASTVisitorBase &v) {v.visit(this); } void print(); };
[ "wangallen880117@gmail.com" ]
wangallen880117@gmail.com
24c419e265ff21fad2cd1ee1b497a3308c014e64
d2260a6d52ed839ce407eb8326a7fb06ab1276e9
/Experiment02/Banker.cpp
4179d1920673ef597e33170cd355bd379ef91290
[]
no_license
caihongye/OperatingSystem
434ff593d16c8cf7068a12f0802fd5c2de8e9d8e
5da51aa210d6558178dbcab28739e58f1ba3c534
refs/heads/master
2021-08-19T07:54:24.833906
2017-11-25T09:38:46
2017-11-25T09:38:46
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,727
cpp
// // Created by chy on 17-11-16. // #include "Banker.h" Banker::Banker(int rn, int pn) { resourceNum = rn; processNum = pn; total = new int[rn]; available = new int[rn]; available_t = new int[rn]; process = new Process *[pn]; for (int i = 0; i < pn; i++) { process[i] = new Process; process[i]->Init(rn, i + 1); } InitData(); } Banker::~Banker() { for (int i = 0; i < resourceNum; i++) { delete process[i]; } delete[] total; delete[] available; delete[] available_t; delete[] process; } bool Banker::InitData() { bool isInitOK = false; printf("初始化数据\n"); while (!isInitOK) { for (int i = 0; i < processNum; i++) { process[i]->isFinish = false; } srand(time(NULL)); for (int i = 0; i < resourceNum; i++) { total[i] = rand() % (REC_RANGE_MAX - REC_RANGE_MIN) + REC_RANGE_MIN; available[i] = total[i]; } for (int i = 0; i < processNum; i++) { for (int j = 0; j < resourceNum; j++) { process[i]->max[j] = (rand() % total[j]) / PROCESS_REC_RATE; int randX = process[i]->max[j] / GIVE_RATE; process[i]->allocation[j] = rand() % (randX > 0 ? randX : 1); if (process[i]->allocation[j] > available[j]) { process[i]->allocation[j] = available[j]; available[j] = 0; } else { process[i]->need[j] = process[i]->max[j] - process[i]->allocation[j]; available[j] = available[j] - process[i]->allocation[j]; } } } for (int i = 0; i < resourceNum; i++) { available_t[i] = available[i]; } isInitOK = Check(false); if (!isInitOK) { } else { for (int i = 0; i < resourceNum; i++) { available[i] = available_t[i]; } } } printf("初始化数据成功\n"); PrintData(); //printf("sort ans:%d\n", ProcessSort(0)); //PrintData(); return true; } void Banker::PrintData() { printf("系统拥有的资源:"); for (int i = 0; i < resourceNum; i++) { printf("\t%d", total[i]); } printf("\n"); printf("系统剩余的资源:"); for (int i = 0; i < resourceNum; i++) { printf("\t%d", available[i]); } printf("\n-进程--------最大需求-----------------------已获得-----------------------仍需要-----------需要总数"); printf("\n"); //printf("prodata\t\t\t\t allocation\t\t\t\tneed\n"); for (int i = 0; i < processNum; i++) { printf("进程%d:", process[i]->pid); for (int j = 0; j < resourceNum; j++) { int index = i * resourceNum + j; printf("\t%d ", process[i]->max[j]); } printf("\t\t"); for (int j = 0; j < resourceNum; j++) { int index = i * resourceNum + j; printf("\t%d", process[i]->allocation[j]); } printf("\t\t"); for (int j = 0; j < resourceNum; j++) { int index = i * resourceNum + j; printf("\t%d", process[i]->need[j]); } printf("\t"); printf("\n"); } } bool Banker::Check(bool isShow) { int p = processNum; bool isOK = false; for (int i = 0; i < processNum; i++) { process[i]->isFinish = false; } while (p > 0) { isOK = false; for (int j = 0; j < processNum; j++) { if (IsGive(j) && !process[j]->isFinish) { //printf("优先分配进程%d\n", process[j]->pid); p--; process[j]->isFinish = true; for (int i = 0; i < resourceNum; i++) { available[i] += process[j]->need[i]; } isOK = true; if (isShow) { //printf("%d:", j); } for (int k = 0; k < resourceNum; k++) { if (isShow){ //printf("%d ", process[j]->need[k]); } } if (isShow){ //printf("\n"); } } } if (!isOK && p > 0) { //printf("dead lock\n"); return false; } } //printf("ok\n"); return true; } bool Banker::IsGive(int j) { for (int i = 0; i < resourceNum; i++) { if (process[j]->need[i] > available[i]) { return false; } } return true; } bool Banker::Run(int n) { for (int i = 0; i < processNum; i++) { process[i]->isFinish = false; } int start=0; int pre_start=0; while(start<processNum-1){ pre_start=start; start=ProcessSort(start); //printf("排序结果%d\n",start); for(int i=pre_start;i<start;i++){ Recycle(i); printf("回收%d\n",process[i]->pid); //PrintData(); } //break; } } int Banker::GetNoFinishNum() { int ans = 0; for (int i = 0; i < processNum; i++) { if (process[i]->isFinish) ans++; } return ans; } bool Banker::Recycle(int i){ process[i]->isFinish=true; for (int j = 0; j < resourceNum; j++) { available[j]+=process[i]->allocation[j]; } return true; } int Banker::ProcessSort(int n) { int ans=n; if (n >= processNum - 1) { return ans; } for (int i = n; i < processNum - 1; i++) { for (int j = n+1; j < processNum - i; j++) { //printf("%d %d\n",j - 1, j); if (!SortCheck(j - 1, j)) { Process *p = process[j - 1]; process[j - 1] = process[j]; process[j] = p; } } } for(int i=n;i<processNum;i++){ if(IsGive(i)){ ans++; } } return ans; } //第一个优先的返回true bool Banker::SortCheck(int i, int j) { //printf("比较%d和%d\n",i,j); process[i]->value = process[j]->value = 0; for (int k = 0; k < resourceNum; k++) { if (process[i]->need[k] > available[k]) { //printf("结果是:%d\n", false); return false; } if (process[j]->need[k] > available[k]) { //printf("结果是:%d\n", true); return true; } process[i]->value += process[i]->need[k]; process[j]->value += process[j]->need[k]; } //printf("结果是:%d\n", process[i]->value < process[j]->value ? true : false); return process[i]->value < process[j]->value ? true : false; }
[ "466071353@qq.com" ]
466071353@qq.com
84cca426bc07b79d68de1032ddb73772fddc868a
57ca39d53d448d8645add6b7e077535f057c17cd
/src/include/mallocMC/distributionPolicies/XMallocSIMD_impl.hpp
f80db7aad584785353d274cd92a865f1e7295fef
[ "MIT" ]
permissive
BenjaminW3/mallocMC
776f15894b53841e03cdfafee16cfc41e61212ce
ee60581d1f5011f1c34f418c337eb5fb9cbe8b28
refs/heads/dev
2020-12-29T00:25:04.150122
2015-06-03T13:17:31
2015-06-03T13:17:31
37,183,363
0
0
null
2015-06-10T07:54:30
2015-06-10T07:54:30
null
UTF-8
C++
false
false
4,802
hpp
/* mallocMC: Memory Allocator for Many Core Architectures. http://www.icg.tugraz.at/project/mvp Copyright (C) 2012 Institute for Computer Graphics and Vision, Graz University of Technology Copyright (C) 2014 Institute of Radiation Physics, Helmholtz-Zentrum Dresden - Rossendorf Author(s): Markus Steinberger - steinberger ( at ) icg.tugraz.at Rene Widera - r.widera ( at ) hzdr.de Axel Huebl - a.huebl ( at ) hzdr.de Carlchristian Eckert - c.eckert ( at ) hzdr.de 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. */ #pragma once #include <boost/cstdint.hpp> #include <boost/static_assert.hpp> #include <limits> #include <string> #include <sstream> #include "../mallocMC_utils.hpp" #include "../mallocMC_prefixes.hpp" #include "XMallocSIMD.hpp" namespace mallocMC{ namespace DistributionPolicies{ template<class T_Config> class XMallocSIMD { private: typedef boost::uint32_t uint32; bool can_use_coalescing; uint32 warpid; uint32 myoffset; uint32 threadcount; uint32 req_size; public: typedef T_Config Properties; private: /** Allow for a hierarchical validation of parameters: * * shipped default-parameters (in the inherited struct) have lowest precedence. * They will be overridden by a given configuration struct. However, even the * given configuration struct can be overridden by compile-time command line * parameters (e.g. -D MALLOCMC_DP_XMALLOCSIMD_PAGESIZE 1024) * * default-struct < template-struct < command-line parameter */ #ifndef MALLOCMC_DP_XMALLOCSIMD_PAGESIZE #define MALLOCMC_DP_XMALLOCSIMD_PAGESIZE Properties::pagesize::value #endif static const uint32 pagesize = MALLOCMC_DP_XMALLOCSIMD_PAGESIZE; //all the properties must be unsigned integers > 0 BOOST_STATIC_ASSERT(!std::numeric_limits<typename Properties::pagesize::type>::is_signed); BOOST_STATIC_ASSERT(static_cast<uint32>(pagesize) > 0); public: static const uint32 _pagesize = pagesize; MAMC_ACCELERATOR uint32 collect(uint32 bytes){ can_use_coalescing = false; warpid = mallocMC::warpid(); myoffset = 0; threadcount = 0; //init with initial counter __shared__ uint32 warp_sizecounter[32]; warp_sizecounter[warpid] = 16; //second half: make sure that all coalesced allocations can fit within one page //necessary for offset calculation bool coalescible = bytes > 0 && bytes < (pagesize / 32); threadcount = __popc(__ballot(coalescible)); if (coalescible && threadcount > 1) { myoffset = atomicAdd(&warp_sizecounter[warpid], bytes); can_use_coalescing = true; } req_size = bytes; if (can_use_coalescing) req_size = (myoffset == 16) ? warp_sizecounter[warpid] : 0; return req_size; } MAMC_ACCELERATOR void* distribute(void* allocatedMem){ __shared__ char* warp_res[32]; char* myalloc = (char*) allocatedMem; if (req_size && can_use_coalescing) { warp_res[warpid] = myalloc; if (myalloc != 0) *(uint32*)myalloc = threadcount; } __threadfence_block(); void *myres = myalloc; if(can_use_coalescing) { if(warp_res[warpid] != 0) myres = warp_res[warpid] + myoffset; else myres = 0; } return myres; } MAMC_HOST static std::string classname(){ std::stringstream ss; ss << "XMallocSIMD[" << pagesize << "]"; return ss.str(); } }; } //namespace DistributionPolicies } //namespace mallocMC
[ "c.eckert@hzdr.de" ]
c.eckert@hzdr.de
8c0d7e270c6574040dcf7cea8964951ba20e50e2
1c8e5a1fc7f9dfee4969194c1bd77918eea73095
/Source/AllProjects/CIDLib/CIDLib_UTFConverter.cpp
cbf81b0f8f09151e53f0d2f1a13d111823c51a19
[]
no_license
naushad-rahman/CIDLib
bcb579a6f9517d23d25ad17a152cc99b7508330e
577c343d33d01e0f064d76dfc0b3433d1686f488
refs/heads/master
2020-04-28T01:08:35.084154
2019-03-10T02:03:20
2019-03-10T02:03:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
30,367
cpp
// // FILE NAME: CIDLib_UTFConverter.cpp // // AUTHOR: Dean Roddey // // CREATED: 02/17/1999 // // COPYRIGHT: $_CIDLib_CopyRight_$ // // $_CIDLib_CopyRight2_$ // // DESCRIPTION: // // This file implements the TUTFConverter class, which handles converting // the UTF-8/16 family of encodings to/from the internal UTF-16 LE format. // // CAVEATS/GOTCHAS: // // LOG: // // $_CIDLib_Log_$ // // --------------------------------------------------------------------------- // Facility specific includes // --------------------------------------------------------------------------- #include "CIDLib_.hpp" // --------------------------------------------------------------------------- // Magic RTTI macros. We support advanced RTTI so that converters can be // created by class name. // --------------------------------------------------------------------------- AdvRTTIDecls(TUTFConverter,TTextConverter) AdvRTTIDecls(TUSASCIIConverter,TUTFConverter) AdvRTTIDecls(TUTF16BEConverter,TUTFConverter) AdvRTTIDecls(TUTF16LEConverter,TUTFConverter) AdvRTTIDecls(TUTF8Converter,TUTFConverter) namespace CIDLib_UTFConverter { // ----------------------------------------------------------------------- // Local data // // ac1FirstByteMark // A mask to mask onto the first byte of an encoded UTF-8 sequence. // Its indexed by the number of bytes required to encode it. // // ac1UTFBytes // This is an array of values that are indexed by the first encoded // char of a UTF-8 encoded char, resulting in the number of bytes it // uses to encode the UTF-16 char. // // ac4UTFOffsets // This array is indexed by the count of bytes required to encode // the value. Its provides an amount to offset the decoded UTF-16 // value by. // // eDefEncoding // The default encoding of a TCh value for this host workstation. // Byte knowing this value, we can optimize when the source and // target encodings are the same. And its used in the default ctor, // to create a converter with those characteristics. // // apszEncodings // Strings that represent the descriptions of the EEncodings type. // ----------------------------------------------------------------------- const tCIDLib::TCard1 ac1FirstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; const tCIDLib::TCard4 ac4UTFOffsets[6] = { 0, 0x3080, 0xE2080, 0x3C82080, 0xFA082080, 0x82082080 }; const tCIDLib::TCard1 ac1UTFBytes[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 , 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5 }; const tCIDLib::TCh* const apszEncodingVals[] = { L"US-ASCII" , L"UTF-8" , L"UTF-16LE" , L"UTF-16BE" }; TEArray<const tCIDLib::TCh*, TUTFConverter::EEncodings, TUTFConverter::EEncodings::Count> apszEncodings(apszEncodingVals); } // --------------------------------------------------------------------------- // TUTFConverter: Constructors and Destructor // --------------------------------------------------------------------------- TUTFConverter::TUTFConverter(const EEncodings eEncoding) : TTextConverter(CIDLib_UTFConverter::apszEncodings[eEncoding]) , m_eEncoding(eEncoding) { } TUTFConverter::TUTFConverter(const TUTFConverter& tcvtSrc) : TTextConverter(tcvtSrc) , m_eEncoding(tcvtSrc.m_eEncoding) { } TUTFConverter::~TUTFConverter() { } // --------------------------------------------------------------------------- // TUTFConverter: Constructors and Destructor // --------------------------------------------------------------------------- TUTFConverter& TUTFConverter::operator=(const TUTFConverter& tcvtSrc) { if (this == &tcvtSrc) return *this; TParent::operator=(tcvtSrc); m_eEncoding = tcvtSrc.m_eEncoding; return *this; } // --------------------------------------------------------------------------- // TUTFConverter: Public, inherited methods // --------------------------------------------------------------------------- tCIDLib::EBaseTextFmts TUTFConverter::eBaseFmt() const { if (m_eEncoding == EEncodings::USASCII) return tCIDLib::EBaseTextFmts::SingleByte; else if (m_eEncoding == EEncodings::UTF8) return tCIDLib::EBaseTextFmts::MultiByte; else if (m_eEncoding == EEncodings::UTF16_LE) return tCIDLib::EBaseTextFmts::TwoByte_LE; else if (m_eEncoding == EEncodings::UTF16_BE) return tCIDLib::EBaseTextFmts::TwoByte_BE; facCIDLib().ThrowErr ( CID_FILE , CID_LINE , kCIDErrs::errcGen_BadEnumValue , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::AppError , TInteger(tCIDLib::i4EnumOrd(m_eEncoding)) , TString(L"TUTFConverter::EEncodings") ); return tCIDLib::EBaseTextFmts::Count; } TUTFConverter::EEncodings TUTFConverter::eEncoding() const { return m_eEncoding; } tCIDLib::TVoid TUTFConverter::Reset() { // Its a no-op for us } // --------------------------------------------------------------------------- // TUTFConverter: Private, inherited methods // --------------------------------------------------------------------------- tCIDLib::TCard4 TUTFConverter::c4BlockFrom( const tCIDLib::TCard1* const pc1Src , const tCIDLib::TCard4 c4SrcBytes , tCIDLib::TCh* const pszToFill , const tCIDLib::TCard4 c4MaxChars , tCIDLib::TCard4& c4OutChars , tCIDLib::TBoolean& bStop) { const tCIDLib::TCh chRep = chRepChar(); const tCIDLib::ETCvtActions eAct = eErrorAction(); // // Do the required work according to the specific encoding. Initialize // output chars parm to zero so we can use it as an index below, and // just run it up as we go // bStop = kCIDLib::False; tCIDLib::TCard4 c4Bytes = 0; c4OutChars = 0; switch(m_eEncoding) { case EEncodings::USASCII : { // // This one just requires a tight loop to clip the high bytes of // each char and put it into a byte in the output array. The // chars consumed and bytes output are the same, so we use the chars // as the index and set the bytes to the same when done. // const tCIDLib::TCard4 c4MaxCnt = tCIDLib::MinVal(c4SrcBytes, c4MaxChars); for (; c4OutChars < c4MaxCnt; c4OutChars++) { if (!pc1Src[c4OutChars] || (pc1Src[c4OutChars] > 0x7F)) { // It's a bad char if ((eAct == tCIDLib::ETCvtActions::StopThenThrow) && c4OutChars) { bStop = kCIDLib::True; break; } if (eAct == tCIDLib::ETCvtActions::Replace) { pszToFill[c4OutChars] = chRep; } else { facCIDLib().ThrowErr ( CID_FILE , CID_LINE , kCIDErrs::errcTCvt_BadSource , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::Format , strEncodingName() ); } } else { pszToFill[c4OutChars] = tCIDLib::TCh(pc1Src[c4OutChars]); } } c4Bytes = c4OutChars; break; } case EEncodings::UTF8 : { const tCIDLib::TCard1* pc1SrcPtr = pc1Src; const tCIDLib::TCard1* pc1SrcEnd = pc1Src + c4SrcBytes; tCIDLib::TCh* pchOutPtr = pszToFill; tCIDLib::TCh* pchOutEnd = pszToFill + c4MaxChars; while ((pc1SrcPtr < pc1SrcEnd) && (pchOutPtr < pchOutEnd)) { // // Get the first byte and optimize if its < 0x80, since it // can be taken as is. // const tCIDLib::TCard1 c1First = *pc1SrcPtr; if (c1First <= 0x7F) { *pchOutPtr++ = tCIDLib::TCh(c1First); pc1SrcPtr++; continue; } // Not the common case, so see how many encoded bytes we need const tCIDLib::TCard4 c4EncBytes = CIDLib_UTFConverter::ac1UTFBytes[c1First]; // // See if we have enough bytes in the source to do a whole // car. If not, then break out and leave it for the next // time. // if (pc1SrcPtr + c4EncBytes >= pc1SrcEnd) break; // Looks ok, so lets build up the value tCIDLib::TCard4 c4Val = 0; const tCIDLib::TCard1* pc1Tmp = pc1SrcPtr; switch(c4EncBytes) { case 5 : c4Val += *pc1Tmp++; c4Val <<= 6; case 4 : c4Val += *pc1Tmp++; c4Val <<= 6; case 3 : c4Val += *pc1Tmp++; c4Val <<= 6; case 2 : c4Val += *pc1Tmp++; c4Val <<= 6; case 1 : c4Val += *pc1Tmp++; c4Val <<= 6; case 0 : c4Val += *pc1Tmp++; } c4Val -= CIDLib_UTFConverter::ac4UTFOffsets[c4EncBytes]; // // If it will fit into a single char, then put it in. // Otherwise encode it as a surrogate pair. // if (!(c4Val & 0xFFFF0000)) { // Not invalid, so move up the source pointer pc1SrcPtr += (c4EncBytes + 1); *pchOutPtr++ = tCIDLib::TCh(c4Val); } else if (c4Val > 0x10FFFF) { // Its a bad char. We don't move up the source pointer here if ((eAct == tCIDLib::ETCvtActions::StopThenThrow) && (pc1SrcPtr != pc1Src)) { bStop = kCIDLib::True; break; } if (eAct == tCIDLib::ETCvtActions::Replace) { // We are recoverings, so eat the src bytes pc1SrcPtr += c4EncBytes + 1; *pchOutPtr++ = chRep; } else { facCIDLib().ThrowErr ( CID_FILE , CID_LINE , kCIDErrs::errcTCvt_BadSource , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::Format , strEncodingName() ); } } else { // // The pre-loop above didn't check for this, since we our // outputting two chars instead of one, so see if we have // the extra space. // if (pchOutPtr + 1 >= pchOutEnd) break; // Not invalid, so move up the source pointer pc1SrcPtr += (c4EncBytes + 1); c4Val -= 0x10000; *pchOutPtr++ = tCIDLib::TCh((c4Val >> 10) + 0xD800); *pchOutPtr++ = tCIDLib::TCh((c4Val & 0x3FF) + 0xDC00); } } c4OutChars = pchOutPtr - pszToFill; c4Bytes = pc1SrcPtr - pc1Src; break; } case EEncodings::UTF16_LE : case EEncodings::UTF16_BE : { // // Calculate the max chars we can process. Its the smaller of the // target length and the max input bytes divided by the char size. // c4OutChars = tCIDLib::MinVal ( c4MaxChars , c4SrcBytes / kCIDLib::c4UniBytes ); // And calculate the bytes that represents c4Bytes = c4OutChars * kCIDLib::c4UniBytes; // // Determine if we need to flip the byte order up front, to // simplify the logic below. // tCIDLib::TBoolean bFlip = kCIDLib::False; #if defined(CIDLIB_LITTLEENDIAN) if (m_eEncoding == EEncodings::UTF16_BE) bFlip = kCIDLib::True; #else if (m_eEncoding == EEncodings::UTF16_LE) bFlip = kCIDLib::True; #endif // Look at the source as UTF-16 chars const tCIDLib::TUniCh* pszTmp = reinterpret_cast<const tCIDLib::TUniCh*>(pc1Src); #if defined(CIDLIB_WCISUTF16) // // The char sizes are the same internally and externally, so just // copy over the required number of bytes. Flip them if required. // if (bFlip) { // We need to flip them as we store them for (tCIDLib::TCard4 c4Index = 0; c4Index < c4OutChars; c4Index++) pszToFill[c4Index] = TRawBits::c2SwapBytes(*pszTmp++); } else { // We can do the optimal buffer copy in this case TRawMem::CopyMemBuf(pszToFill, pc1Src, c4Bytes); } #else // // The internal char size is 32 bit, so we have to up cast the char // data and potentially byte swap it. We have to be sure to do it // in the correct order. It must be swapped to native order first, // then upcast. If no flip is required, we just have to upconvert // the bytes as is. // if (bFlip) { for (tCIDLib::TCard4 c4Index = 0; c4Index < c4OutChars; c4Index++) { const tCIDLib::TUniCh uchTmp = TRawBits::c2SwapBytes(*pszTmp++); pszToFill[c4Index] = tCIDLib::TCh(uchTmp); } } else { for (tCIDLib::TCard4 c4Index = 0; c4Index < c4OutChars; c4Index++) pszToFill[c4Index] = tCIDLib::TCh(*pszTmp++); } #endif break; } default : // This is way bad facCIDLib().ThrowErr ( CID_FILE , CID_LINE , kCIDErrs::errcGen_BadEnumValue , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::AppError , TInteger(tCIDLib::i4EnumOrd(m_eEncoding)) , TString(L"TUTFConverter::EEncodings") ); } return c4Bytes; } tCIDLib::TCard4 TUTFConverter::c4BlockTo(const tCIDLib::TCh* const pszSrc , const tCIDLib::TCard4 c4SrcChars , tCIDLib::TCard1* const pc1ToFill , const tCIDLib::TCard4 c4MaxBytes , tCIDLib::TCard4& c4OutBytes , tCIDLib::TBoolean& bStop) { // // Do the required work according to the specific encoding. Some of // these can be done very quickly as tight loops. // tCIDLib::TCard4 c4Chars = 0; tCIDLib::TCard4 c4Bytes = 0; bStop = kCIDLib::False; switch(m_eEncoding) { case EEncodings::USASCII : { // // This one just requires a tight loop to clip the high bytes of // each char and put it into a byte in the output array. The // chars consumed and bytes output are the same. // const tCIDLib::TCard4 c4Max = tCIDLib::MinVal(c4SrcChars, c4MaxBytes); for (; c4Chars < c4Max; c4Chars++) { const tCIDLib::TCh chCur = pszSrc[c4Chars]; if (chCur > 0x7F) { if ((eErrorAction() == tCIDLib::ETCvtActions::StopThenThrow) && c4Chars) { bStop = kCIDLib::True; break; } tCIDLib::TCh szTmp[2]; szTmp[0] = chCur; szTmp[1] = kCIDLib::chNull; facCIDLib().ThrowErr ( CID_FILE , CID_LINE , kCIDErrs::errcTCvt_Unrepresentable , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::CantDo , TString(szTmp) , strEncodingName() ); } else { pc1ToFill[c4Chars] = tCIDLib::TCard1(chCur); } } // Bytes and chars are the same here c4Bytes = c4Chars; break; } case EEncodings::UTF8 : { // // This one requires a more complex loop, to encode the chars as // UTF-8 byte sequences. // const tCIDLib::TCh* pchSrcPtr = pszSrc; const tCIDLib::TCh* pchSrcEnd = pszSrc + c4SrcChars; tCIDLib::TCard1* pc1OutPtr = pc1ToFill; tCIDLib::TCard1* pc1OutEnd = pc1ToFill + c4MaxBytes; while (pchSrcPtr < pchSrcEnd) { // // Get the next char out into a 32 bit value. If its a // leading char, get the trailing char and put that in. If // the next char is not in there, then save it for the next // time. // tCIDLib::TCard4 c4Val = *pchSrcPtr; tCIDLib::TCard4 c4SrcUsed = 1; if ((c4Val >= 0xD800) && (c4Val <= 0xDBFF)) { if (pchSrcPtr + 1 >= pchSrcEnd) break; // Create the composite surrogate pair c4Val = ((c4Val - 0xD800) << 10) + ((*(pchSrcPtr + 1) - 0xDC00) + 0x10000); c4SrcUsed++; } // Figure out how many bytes we need tCIDLib::TCard4 c4EncBytes; if (c4Val < 0x80) c4EncBytes = 1; else if (c4Val < 0x800) c4EncBytes = 2; else if (c4Val < 0x10000) c4EncBytes = 3; else if (c4Val < 0x200000) c4EncBytes = 4; else if (c4Val < 0x4000000) c4EncBytes = 5; else if (c4Val <= 0x7FFFFFFF) c4EncBytes = 6; else { if ((eErrorAction() == tCIDLib::ETCvtActions::StopThenThrow) && (pc1OutPtr != pc1ToFill)) { break; } facCIDLib().ThrowErr ( CID_FILE , CID_LINE , kCIDErrs::errcTCvt_Unrepresentable , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::CantDo , TCardinal(c4Val) , strEncodingName() ); break; } // // If we cannot fully get this char into the output buffer, // then leave it for the next time. // if (pc1OutPtr + c4EncBytes > pc1OutEnd) break; // We can do it, so update the source index pchSrcPtr += c4SrcUsed; // And spit out the bytes pc1OutPtr += c4EncBytes; switch(c4EncBytes) { case 6 : *--pc1OutPtr = tCIDLib::TCard1((c4Val | 0x80UL) & 0xBFUL); c4Val >>= 6; case 5 : *--pc1OutPtr = tCIDLib::TCard1((c4Val | 0x80UL) & 0xBFUL); c4Val >>= 6; case 4 : *--pc1OutPtr = tCIDLib::TCard1((c4Val | 0x80UL) & 0xBFUL); c4Val >>= 6; case 3 : *--pc1OutPtr = tCIDLib::TCard1((c4Val | 0x80UL) & 0xBFUL); c4Val >>= 6; case 2 : *--pc1OutPtr = tCIDLib::TCard1((c4Val | 0x80UL) & 0xBFUL); c4Val >>= 6; case 1 : *--pc1OutPtr = tCIDLib::TCard1 ( c4Val | CIDLib_UTFConverter::ac1FirstByteMark[c4EncBytes] ); } // Add the encoded bytes back in again pc1OutPtr += c4EncBytes; } c4Chars = pchSrcPtr - pszSrc; c4Bytes = pc1OutPtr - pc1ToFill; break; } case EEncodings::UTF16_LE : case EEncodings::UTF16_BE : { // // Calculate the max chars we can process. Its the smaller of // the source length and the UTF-16 chars we can fit in the // output buffer. // c4Chars = tCIDLib::MinVal ( c4SrcChars , c4MaxBytes / kCIDLib::c4UniBytes ); // And calculate the bytes that represents c4Bytes = c4Chars * kCIDLib::c4UniBytes; // // Determine if we need to flip the byte order up front, to // simplify the logic below. // tCIDLib::TBoolean bFlip = kCIDLib::False; #if defined(CIDLIB_LITTLEENDIAN) if (m_eEncoding == EEncodings::UTF16_BE) bFlip = kCIDLib::True; #else if (m_eEncoding == EEncodings::UTF16_LE) bFlip = kCIDLib::True; #endif // Look at the target as UTF-16 chars tCIDLib::TUniCh* pszTmp = reinterpret_cast<tCIDLib::TUniCh*>(pc1ToFill); #if defined(CIDLIB_WCISUTF16) // // The char sizes are the same internally and externally, so just // copy over the required number of bytes. Flip them if required. // if (bFlip) { // We have to flip each char as we store it. for (tCIDLib::TCard4 c4Index = 0; c4Index < c4Chars; c4Index++) *pszTmp++ = TRawBits::c2SwapBytes(pszSrc[c4Index]); } else { // We can do the optimal memory buffer copy as is TRawMem::CopyMemBuf(pc1ToFill, pszSrc, c4Bytes); } #else // // The internal char size is 32 bit, so we have to down cast the // char data and potentially byte swap it. This is a little // tricky. We have to get the relevant 16 bits out by downcasting // it first. Then we flip if required. // if (bFlip) { // // For this one, we have to first get the 16 bits that we care // about out of the wide char, then we swap that. // for (tCIDLib::TCard4 c4Index = 0; c4Index < c4Chars; c4Index++) { *pszTmp++ = TRawBits::c2SwapBytes ( tCIDLib::TUniCh(pszSrc[c4Index]) ); } } else { // In this case, we just need to down cast the chars for (tCIDLib::TCard4 c4Index = 0; c4Index < c4Chars; c4Index++) *pszTmp++ = tCIDLib::TUniCh(pszSrc[c4Index]); } #endif break; } default : // This is obviously bad facCIDLib().ThrowErr ( CID_FILE , CID_LINE , kCIDErrs::errcGen_BadEnumValue , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::AppError , TInteger(tCIDLib::i4EnumOrd(m_eEncoding)) , TString(L"TUTFConverter::EEncodings") ); } c4OutBytes = c4Bytes; return c4Chars; } // --------------------------------------------------------------------------- // CLASS: TUSASCIIConverter // PREFIX: tcvt // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // TUSASCIIConverter: Constructors and Destructor // --------------------------------------------------------------------------- TUSASCIIConverter::TUSASCIIConverter() : TUTFConverter(TUTFConverter::EEncodings::USASCII) { } TUSASCIIConverter::TUSASCIIConverter(const TUSASCIIConverter& tcvtSrc) : TUTFConverter(tcvtSrc) { } TUSASCIIConverter::~TUSASCIIConverter() { } // --------------------------------------------------------------------------- // TUSASCIIConverter: Public operators // --------------------------------------------------------------------------- TUSASCIIConverter& TUSASCIIConverter::operator=(const TUSASCIIConverter& tcvtSrc) { if (this != &tcvtSrc) TParent::operator=(tcvtSrc); return *this; } // --------------------------------------------------------------------------- // CLASS: TUTF16LEConverter // PREFIX: tcvt // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // TUTF16LEConverter: Constructors and Destructor // --------------------------------------------------------------------------- TUTF16LEConverter::TUTF16LEConverter() : TUTFConverter(TUTFConverter::EEncodings::UTF16_LE) { } TUTF16LEConverter::TUTF16LEConverter(const TUTF16LEConverter& tcvtSrc) : TUTFConverter(tcvtSrc) { } TUTF16LEConverter::~TUTF16LEConverter() { } // --------------------------------------------------------------------------- // TUTF16LEConverter: Public operators // --------------------------------------------------------------------------- TUTF16LEConverter& TUTF16LEConverter::operator=(const TUTF16LEConverter& tcvtSrc) { if (this != &tcvtSrc) TParent::operator=(tcvtSrc); return *this; } // --------------------------------------------------------------------------- // CLASS: TUTF16BEConverter // PREFIX: tcvt // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // TUTF16BEConverter: Constructors and Destructor // --------------------------------------------------------------------------- TUTF16BEConverter::TUTF16BEConverter() : TUTFConverter(TUTFConverter::EEncodings::UTF16_BE) { } TUTF16BEConverter::TUTF16BEConverter(const TUTF16BEConverter& tcvtSrc) : TUTFConverter(tcvtSrc) { } TUTF16BEConverter::~TUTF16BEConverter() { } // --------------------------------------------------------------------------- // TUTF16BEConverter: Public operators // --------------------------------------------------------------------------- TUTF16BEConverter& TUTF16BEConverter::operator=(const TUTF16BEConverter& tcvtSrc) { if (this != &tcvtSrc) TParent::operator=(tcvtSrc); return *this; } // --------------------------------------------------------------------------- // CLASS: TUTF8Converter // PREFIX: tcvt // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // TUTF8Converter: Constructors and Destructor // --------------------------------------------------------------------------- TUTF8Converter::TUTF8Converter() : TUTFConverter(TUTFConverter::EEncodings::UTF8) { } TUTF8Converter::TUTF8Converter(const TUTF8Converter& tcvtSrc) : TUTFConverter(tcvtSrc) { } TUTF8Converter::~TUTF8Converter() { } // --------------------------------------------------------------------------- // TUTF8Converter: Public operators // --------------------------------------------------------------------------- TUTF8Converter& TUTF8Converter::operator=(const TUTF8Converter& tcvtSrc) { if (this != &tcvtSrc) TParent::operator=(tcvtSrc); return *this; }
[ "droddey@charmedquark.com" ]
droddey@charmedquark.com
56a5e5e407c62d644b937f5a1f9abf3eb8202ea4
38ab92fca23c1f3ff664af568121af0e016b946d
/Lab4/keyed_bag.cpp
aa4a8f6e05acfdcef3ac373893920433c4b6da3f
[]
no_license
Lleeshen/COEN-79
4a97b74ccc115768eb44a66990db28229b03cb67
03951326b6cfb49eaea73f209e94e8821b77723d
refs/heads/master
2020-03-13T09:47:37.912076
2018-04-26T23:17:15
2018-04-26T23:17:15
131,071,498
0
0
null
null
null
null
UTF-8
C++
false
false
2,507
cpp
/* Lyman Shen, October 21 2017 FILE: keyed_bag.cpp CLASS implemented: keyed_bag (see keyed_bag.h for documentation) INVARIANT for the sequence class: 1. The number of items in the keyed_bag is in the member variable used; 2. For an empty keyed bag, we do not care what is stored in any of data; for a non-empty keyed bag, the items in the keyed bag are stored in data[0] through data[used-1], and we don't care what's in the rest of the data 2. For an empty keyed bag, we do not care what is stored in any of keys; for a non-empty keyed bag, the keys in the keyed bag are stored in keys[0] through keys[used-1], and we don't care what's in the rest of the data */ #include <algorithm> #include <cassert> #include "keyed_bag.h" namespace coen79_lab4 { bool keyed_bag::erase(const key_type& key) { bool erased = false; size_type i = 0; while(i < used) { if (keys[i] == key) { used--; keys[i] = keys[used]; data[i] = data[used]; erased = true; } else { i++; } } return erased; } void keyed_bag::insert(const value_type& entry, const key_type& key) { assert((size() < CAPACITY) && (!has_key(key))); keys[used] = key; data[used] = entry; used++; } void keyed_bag::operator +=(const keyed_bag& addend) { assert((size() + addend.size() < CAPACITY) && (!hasDuplicateKey(addend))); std::copy(addend.data, addend.data + used, data); std::copy(addend.keys, addend.keys + used, keys); used += addend.used; } bool keyed_bag::has_key(const key_type& key) const { size_type i = 0; while(i < used) { if(keys[i] == key) { return true; } i++; } return false; } keyed_bag::value_type keyed_bag::get(const key_type& key) const { size_type i = 0; value_type value; assert(has_key(key)); while(i < used) { if(keys[i] == key) { value = data[i]; break; } i++; } return value; } bool keyed_bag::hasDuplicateKey(const keyed_bag& otherBag) const { key_type orig; size_type i; for(i = 0; i < used; i++) { orig = keys[i]; if(otherBag.has_key(orig)) { return true; } } return false; } keyed_bag::size_type keyed_bag::count(const value_type& target) const { size_type i, count; count = 0; i = 0; while(i < used) { if(data[i] == target) { count++; } i++; } return count; } keyed_bag operator +(const keyed_bag& b1, const keyed_bag& b2) { keyed_bag b3(b1); b3 += b2; return b3; } }
[ "lshen@linux60810.dc.engr.scu.edu" ]
lshen@linux60810.dc.engr.scu.edu
91d8b30c8dad63db062fc16fe4f1900fde42d03f
39afb3724b3d2e7ebc0ae7959e6f19103e639128
/Classes/models/objects/other/level9/destroying_weapons/Bullet.cpp
0a128cf3846eb3aec403ee318f17bd903d92f811
[]
no_license
tungnguyenvan/MyGame_ios
36f80464fcee8d9b30126b9d3ef47fbb7ff163d6
04f19685fe7771c3359cb4b7e22e4e000321d077
refs/heads/master
2020-06-03T01:20:14.484028
2019-06-11T13:16:23
2019-06-11T13:16:23
191,374,758
0
0
null
null
null
null
UTF-8
C++
false
false
1,741
cpp
#include "Bullet.h" #include "../../../../../common/Definition.h" #include "../../../../../common/definitionlevels/DefinitionLevel9.h" Bullet::Bullet(cocos2d::Scene* scene, const std::string& name) : DestroyingWeapon(name) { // The core sprite // mCoreSprite = cocos2d::Sprite::create("sprites/gameplay/level9/destroying weapons/bullet.png"); scene->addChild(mCoreSprite, 3); // Set tag for the core sprite // mCoreSprite->setTag(OBSTACLES_TAG); // Set the physics body for the core sprite // mCorePhysicsBody = cocos2d::PhysicsBody::createCircle(mCoreSprite->getContentSize().width / 2); mCorePhysicsBody->setDynamic(false); mCorePhysicsBody->setCollisionBitmask(OBSTACLES_COLLISION_BITMASK); mCorePhysicsBody->setContactTestBitmask(true); mCoreSprite->setPhysicsBody(mCorePhysicsBody); // Deactivate all related attributes at first // this->SetActive(false); } void Bullet::StartOperating(const cocos2d::Vec2& originPosition, const cocos2d::Vec2& destinationPosition) { // Show the sprite // this->SetActive(true); // Set the departing position // this->SetPosition(originPosition + (destinationPosition - originPosition).getNormalized() * BULLET_POSITION_OFFSET_NORMALIZE); // Traveling action // auto travelingAction = cocos2d::MoveTo::create (1.0F/originPosition.getDistance(destinationPosition) * BULLET_TRAVELING_TIME_DURATION_MULTIPLIER, originPosition + (destinationPosition - originPosition).getNormalized() * BULLET_TRAVELING_PATH_NORMALIZE); // Callback for setting back to inactive // auto callbackFinishedTraveling = cocos2d::CallFunc::create([=]() { this->SetActive(false); }); mCoreSprite->runAction(cocos2d::Sequence::create(travelingAction, callbackFinishedTraveling, nullptr)); }
[ "nguyentungtungtungnguyen@gmail.com" ]
nguyentungtungtungnguyen@gmail.com
40cb6c1a215169bbb644f3bbcdb26a56ac78e5ab
755f9e1bbc82a8beb0471c0cb932181a6f83dce3
/surfaceflinger/SurfaceFlinger.cpp
32928bf6b257d2ca9366c30b8b2211a6b10f8573
[]
no_license
wjfsanhe/AndroidM_SF
f52d3bba070ce7c9c59c3f18749cecdcb43c5dd9
426e4bfa15e44fe8d96f416eb0e404ba84172d30
refs/heads/master
2020-06-23T12:33:10.479615
2017-02-17T03:18:12
2017-02-17T03:18:12
74,648,648
1
0
null
null
null
null
UTF-8
C++
false
false
137,391
cpp
/* * Copyright (C) 2007 The Android Open Source Project * * 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. */ #define ATRACE_TAG ATRACE_TAG_GRAPHICS #include <stdint.h> #include <sys/types.h> #include <errno.h> #include <math.h> #include <dlfcn.h> #include <inttypes.h> #include <stdatomic.h> #include <EGL/egl.h> #include <cutils/log.h> #include <cutils/properties.h> #include <binder/IPCThreadState.h> #include <binder/IServiceManager.h> #include <binder/MemoryHeapBase.h> #include <binder/PermissionCache.h> #include <ui/DisplayInfo.h> #include <ui/DisplayStatInfo.h> #include <gui/BitTube.h> #include <gui/BufferQueue.h> #include <gui/GuiConfig.h> #include <gui/IDisplayEventConnection.h> #include <gui/Surface.h> #include <gui/GraphicBufferAlloc.h> #include <ui/GraphicBufferAllocator.h> #include <ui/PixelFormat.h> #include <ui/UiConfig.h> #include <utils/misc.h> #include <utils/String8.h> #include <utils/String16.h> #include <utils/StopWatch.h> #include <utils/Trace.h> #include <private/android_filesystem_config.h> #include <private/gui/SyncFeatures.h> #include "Client.h" #include "clz.h" #include "Colorizer.h" #include "DdmConnection.h" #include "DisplayDevice.h" #include "DispSync.h" #include "EventControlThread.h" #include "EventThread.h" #include "Layer.h" #include "LayerDim.h" #include "SurfaceFlinger.h" #include "DisplayHardware/FramebufferSurface.h" #include "DisplayHardware/HWComposer.h" #include "ExSurfaceFlinger/ExHWComposer.h" #include "DisplayHardware/VirtualDisplaySurface.h" #include "Effects/Daltonizer.h" #include "RenderEngine/RenderEngine.h" #include <cutils/compiler.h> #include <string.h> #include "DisplayUtils.h" #include "sdk/TrackerThread.h" #include "sdk/HeadTrackInputEventThread.h" #include "./sdk/VrService.h" #define DISPLAY_COUNT 1 /* * DEBUG_SCREENSHOTS: set to true to check that screenshots are not all * black pixels. */ #define DEBUG_SCREENSHOTS false EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); namespace android { // This is the phase offset in nanoseconds of the software vsync event // relative to the vsync event reported by HWComposer. The software vsync // event is when SurfaceFlinger and Choreographer-based applications run each // frame. // // This phase offset allows adjustment of the minimum latency from application // wake-up (by Choregographer) time to the time at which the resulting window // image is displayed. This value may be either positive (after the HW vsync) // or negative (before the HW vsync). Setting it to 0 will result in a // minimum latency of two vsync periods because the app and SurfaceFlinger // will run just after the HW vsync. Setting it to a positive number will // result in the minimum latency being: // // (2 * VSYNC_PERIOD - (vsyncPhaseOffsetNs % VSYNC_PERIOD)) // // Note that reducing this latency makes it more likely for the applications // to not have their window content image ready in time. When this happens // the latency will end up being an additional vsync period, and animations // will hiccup. Therefore, this latency should be tuned somewhat // conservatively (or at least with awareness of the trade-off being made). static const int64_t vsyncPhaseOffsetNs = VSYNC_EVENT_PHASE_OFFSET_NS; // This is the phase offset at which SurfaceFlinger's composition runs. static const int64_t sfVsyncPhaseOffsetNs = SF_VSYNC_EVENT_PHASE_OFFSET_NS; // --------------------------------------------------------------------------- const String16 sHardwareTest("android.permission.HARDWARE_TEST"); const String16 sAccessSurfaceFlinger("android.permission.ACCESS_SURFACE_FLINGER"); const String16 sReadFramebuffer("android.permission.READ_FRAME_BUFFER"); const String16 sDump("android.permission.DUMP"); // --------------------------------------------------------------------------- SurfaceFlinger::SurfaceFlinger() : BnSurfaceComposer(), mTransactionFlags(0), mTransactionPending(false), mAnimTransactionPending(false), mLayersRemoved(false), mRepaintEverything(0), mRenderEngine(NULL), mBootTime(systemTime()), mVisibleRegionsDirty(false), mHwWorkListDirty(false), mAnimCompositionPending(false), mDebugRegion(0), mDebugDDMS(0), mDebugDisableHWC(0), mDebugDisableTransformHint(0), mDebugInSwapBuffers(0), mLastSwapBufferTime(0), mDebugInTransaction(0), mLastTransactionTime(0), mBootFinished(false), mForceFullDamage(false), mPrimaryHWVsyncEnabled(false), mHWVsyncAvailable(false), mDaltonize(false), mHasColorMatrix(false), mHasPoweredOff(false), mFrameBuckets(), mTotalTime(0), mLastSwapTime(0) { ALOGI("SurfaceFlinger is starting"); // debugging stuff... char value[PROPERTY_VALUE_MAX]; property_get("ro.bq.gpu_to_cpu_unsupported", value, "0"); mGpuToCpuSupported = !atoi(value); property_get("debug.sf.drop_missed_frames", value, "0"); mDropMissedFrames = atoi(value); property_get("debug.sf.showupdates", value, "0"); mDebugRegion = atoi(value); property_get("debug.sf.ddms", value, "0"); mDebugDDMS = atoi(value); if (mDebugDDMS) { if (!startDdmConnection()) { // start failed, and DDMS debugging not enabled mDebugDDMS = 0; } } ALOGI_IF(mDebugRegion, "showupdates enabled"); ALOGI_IF(mDebugDDMS, "DDMS debugging enabled"); } void SurfaceFlinger::onFirstRef() { mEventQueue.init(this); } SurfaceFlinger::~SurfaceFlinger() { EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglTerminate(display); } void SurfaceFlinger::binderDied(const wp<IBinder>& /* who */) { // the window manager died on us. prepare its eulogy. // restore initial conditions (default device unblank, etc) initializeDisplays(); // restart the boot-animation startBootAnim(); } sp<ISurfaceComposerClient> SurfaceFlinger::createConnection() { sp<ISurfaceComposerClient> bclient; sp<Client> client(new Client(this)); status_t err = client->initCheck(); if (err == NO_ERROR) { bclient = client; } return bclient; } sp<IBinder> SurfaceFlinger::createDisplay(const String8& displayName, bool secure) { class DisplayToken : public BBinder { sp<SurfaceFlinger> flinger; virtual ~DisplayToken() { // no more references, this display must be terminated Mutex::Autolock _l(flinger->mStateLock); flinger->mCurrentState.displays.removeItem(this); flinger->setTransactionFlags(eDisplayTransactionNeeded); } public: DisplayToken(const sp<SurfaceFlinger>& flinger) : flinger(flinger) { } }; sp<BBinder> token = new DisplayToken(this); Mutex::Autolock _l(mStateLock); DisplayDeviceState info(DisplayDevice::DISPLAY_VIRTUAL); info.displayName = displayName; info.isSecure = secure; mCurrentState.displays.add(token, info); return token; } void SurfaceFlinger::destroyDisplay(const sp<IBinder>& display) { Mutex::Autolock _l(mStateLock); ssize_t idx = mCurrentState.displays.indexOfKey(display); if (idx < 0) { ALOGW("destroyDisplay: invalid display token"); return; } const DisplayDeviceState& info(mCurrentState.displays.valueAt(idx)); if (!info.isVirtualDisplay()) { ALOGE("destroyDisplay called for non-virtual display"); return; } mCurrentState.displays.removeItemsAt(idx); setTransactionFlags(eDisplayTransactionNeeded); } void SurfaceFlinger::createBuiltinDisplayLocked(DisplayDevice::DisplayType type) { ALOGW_IF(mBuiltinDisplays[type], "Overwriting display token for display type %d", type); mBuiltinDisplays[type] = new BBinder(); DisplayDeviceState info(type); // All non-virtual displays are currently considered secure. info.isSecure = true; mCurrentState.displays.add(mBuiltinDisplays[type], info); } sp<IBinder> SurfaceFlinger::getBuiltInDisplay(int32_t id) { if (uint32_t(id) >= DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) { ALOGE("getDefaultDisplay: id=%d is not a valid default display id", id); return NULL; } return mBuiltinDisplays[id]; } sp<IGraphicBufferAlloc> SurfaceFlinger::createGraphicBufferAlloc() { sp<GraphicBufferAlloc> gba(new GraphicBufferAlloc()); return gba; } void SurfaceFlinger::bootFinished() { const nsecs_t now = systemTime(); const nsecs_t duration = now - mBootTime; ALOGI("Boot is finished (%ld ms)", long(ns2ms(duration)) ); mBootFinished = true; // wait patiently for the window manager death const String16 name("window"); sp<IBinder> window(defaultServiceManager()->getService(name)); if (window != 0) { window->linkToDeath(static_cast<IBinder::DeathRecipient*>(this)); } // stop boot animation // formerly we would just kill the process, but we now ask it to exit so it // can choose where to stop the animation. property_set("service.bootanim.exit", "1"); } void SurfaceFlinger::deleteTextureAsync(uint32_t texture) { class MessageDestroyGLTexture : public MessageBase { RenderEngine& engine; uint32_t texture; public: MessageDestroyGLTexture(RenderEngine& engine, uint32_t texture) : engine(engine), texture(texture) { } virtual bool handler() { engine.deleteTextures(1, &texture); return true; } }; postMessageAsync(new MessageDestroyGLTexture(getRenderEngine(), texture)); } class DispSyncSource : public VSyncSource, private DispSync::Callback { public: DispSyncSource(DispSync* dispSync, nsecs_t phaseOffset, bool traceVsync, const char* label) : mValue(0), mTraceVsync(traceVsync), mVsyncOnLabel(String8::format("VsyncOn-%s", label)), mVsyncEventLabel(String8::format("VSYNC-%s", label)), mDispSync(dispSync), mCallbackMutex(), mCallback(), mVsyncMutex(), mPhaseOffset(phaseOffset), mEnabled(false) {} virtual ~DispSyncSource() {} virtual void setVSyncEnabled(bool enable) { Mutex::Autolock lock(mVsyncMutex); if (enable) { status_t err = mDispSync->addEventListener(mPhaseOffset, static_cast<DispSync::Callback*>(this)); if (err != NO_ERROR) { ALOGE("error registering vsync callback: %s (%d)", strerror(-err), err); } //ATRACE_INT(mVsyncOnLabel.string(), 1); } else { status_t err = mDispSync->removeEventListener( static_cast<DispSync::Callback*>(this)); if (err != NO_ERROR) { ALOGE("error unregistering vsync callback: %s (%d)", strerror(-err), err); } //ATRACE_INT(mVsyncOnLabel.string(), 0); } mEnabled = enable; } virtual void setCallback(const sp<VSyncSource::Callback>& callback) { Mutex::Autolock lock(mCallbackMutex); mCallback = callback; } virtual void setPhaseOffset(nsecs_t phaseOffset) { Mutex::Autolock lock(mVsyncMutex); // Normalize phaseOffset to [0, period) auto period = mDispSync->getPeriod(); phaseOffset %= period; if (phaseOffset < 0) { // If we're here, then phaseOffset is in (-period, 0). After this // operation, it will be in (0, period) phaseOffset += period; } mPhaseOffset = phaseOffset; // If we're not enabled, we don't need to mess with the listeners if (!mEnabled) { return; } // Remove the listener with the old offset status_t err = mDispSync->removeEventListener( static_cast<DispSync::Callback*>(this)); if (err != NO_ERROR) { ALOGE("error unregistering vsync callback: %s (%d)", strerror(-err), err); } // Add a listener with the new offset err = mDispSync->addEventListener(mPhaseOffset, static_cast<DispSync::Callback*>(this)); if (err != NO_ERROR) { ALOGE("error registering vsync callback: %s (%d)", strerror(-err), err); } } private: virtual void onDispSyncEvent(nsecs_t when) { sp<VSyncSource::Callback> callback; { Mutex::Autolock lock(mCallbackMutex); callback = mCallback; if (mTraceVsync) { mValue = (mValue + 1) % 2; ATRACE_INT(mVsyncEventLabel.string(), mValue); } } if (callback != NULL) { callback->onVSyncEvent(when); } } int mValue; const bool mTraceVsync; const String8 mVsyncOnLabel; const String8 mVsyncEventLabel; DispSync* mDispSync; Mutex mCallbackMutex; // Protects the following sp<VSyncSource::Callback> mCallback; Mutex mVsyncMutex; // Protects the following nsecs_t mPhaseOffset; bool mEnabled; }; void SurfaceFlinger::init() { ALOGI( "SurfaceFlinger's main thread ready to run. " "Initializing graphics H/W..."); Mutex::Autolock _l(mStateLock); // initialize EGL for the default display mEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(mEGLDisplay, NULL, NULL); // start the EventThread if (vsyncPhaseOffsetNs != sfVsyncPhaseOffsetNs) { sp<VSyncSource> vsyncSrc = new DispSyncSource(&mPrimaryDispSync, vsyncPhaseOffsetNs, true, "app"); mEventThread = new EventThread(vsyncSrc); sp<VSyncSource> sfVsyncSrc = new DispSyncSource(&mPrimaryDispSync, sfVsyncPhaseOffsetNs, true, "sf"); mSFEventThread = new EventThread(sfVsyncSrc); mEventQueue.setEventThread(mSFEventThread); } else { sp<VSyncSource> vsyncSrc = new DispSyncSource(&mPrimaryDispSync, vsyncPhaseOffsetNs, true, "sf-app"); mEventThread = new EventThread(vsyncSrc); mEventQueue.setEventThread(mEventThread); } // Initialize the H/W composer object. There may or may not be an // actual hardware composer underneath. mHwc = DisplayUtils::getInstance()->getHWCInstance(this, *static_cast<HWComposer::EventHandler *>(this)); // get a RenderEngine for the given display / config (can't fail) mRenderEngine = RenderEngine::create(mEGLDisplay, mHwc->getVisualID()); // retrieve the EGL context that was selected/created mEGLContext = mRenderEngine->getEGLContext(); LOG_ALWAYS_FATAL_IF(mEGLContext == EGL_NO_CONTEXT, "couldn't create EGLContext"); // initialize our non-virtual displays for (size_t i=0 ; i<DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES ; i++) { DisplayDevice::DisplayType type((DisplayDevice::DisplayType)i); // set-up the displays that are already connected if (mHwc->isConnected(i) || type==DisplayDevice::DISPLAY_PRIMARY) { // All non-virtual displays are currently considered secure. bool isSecure = true; createBuiltinDisplayLocked(type); wp<IBinder> token = mBuiltinDisplays[i]; sp<IGraphicBufferProducer> producer; sp<IGraphicBufferConsumer> consumer; BufferQueue::createBufferQueue(&producer, &consumer, new GraphicBufferAlloc()); sp<FramebufferSurface> fbs = new FramebufferSurface(*mHwc, i, consumer); int32_t hwcId = allocateHwcDisplayId(type); sp<DisplayDevice> hw = new DisplayDevice(this, type, hwcId, mHwc->getFormat(hwcId), isSecure, token, fbs, producer, mRenderEngine->getEGLConfig()); if (i > DisplayDevice::DISPLAY_PRIMARY) { // FIXME: currently we don't get blank/unblank requests // for displays other than the main display, so we always // assume a connected display is unblanked. ALOGD("marking display %zu as acquired/unblanked", i); hw->setPowerMode(HWC_POWER_MODE_NORMAL); } // When a non-virtual display device is added at boot time, // update the active config by querying HWC otherwise the // default config (config 0) will be used. int activeConfig = mHwc->getActiveConfig(hwcId); if (activeConfig >= 0) { hw->setActiveConfig(activeConfig); } mDisplays.add(token, hw); } } // make the GLContext current so that we can create textures when creating Layers // (which may happens before we render something) getDefaultDisplayDevice()->makeCurrent(mEGLDisplay, mEGLContext); mEventControlThread = new EventControlThread(this); mEventControlThread->run("EventControl", PRIORITY_URGENT_DISPLAY); mTrackerThread = new TrackerThread(this); mTrackerThread->setLuciferMode(true); mVrService = new VrService(this); //mVrService->setServerPort(mTrackerThread->getServerPort()); mHeadTrackInputEventThread = new HeadTrackInputEventThread(); // set a fake vsync period if there is no HWComposer if (mHwc->initCheck() != NO_ERROR) { mPrimaryDispSync.setPeriod(16666667); } // initialize our drawing state mDrawingState = mCurrentState; // set initial conditions (e.g. unblank default device) initializeDisplays(); // start boot animation startBootAnim(); } int32_t SurfaceFlinger::allocateHwcDisplayId(DisplayDevice::DisplayType type) { return (uint32_t(type) < DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) ? type : mHwc->allocateDisplayId(); } void SurfaceFlinger::startBootAnim() { // start boot animation property_set("service.bootanim.exit", "0"); property_set("ctl.start", "bootanim"); } size_t SurfaceFlinger::getMaxTextureSize() const { return mRenderEngine->getMaxTextureSize(); } size_t SurfaceFlinger::getMaxViewportDims() const { return mRenderEngine->getMaxViewportDims(); } bool SurfaceFlinger::isBootFinished(){ return mBootFinished; } // ---------------------------------------------------------------------------- bool SurfaceFlinger::authenticateSurfaceTexture( const sp<IGraphicBufferProducer>& bufferProducer) const { Mutex::Autolock _l(mStateLock); sp<IBinder> surfaceTextureBinder(IInterface::asBinder(bufferProducer)); return mGraphicBufferProducerList.indexOf(surfaceTextureBinder) >= 0; } status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, Vector<DisplayInfo>* configs) { if ((configs == NULL) || (display.get() == NULL)) { return BAD_VALUE; } if (!display.get()) return NAME_NOT_FOUND; int32_t type = NAME_NOT_FOUND; for (int i=0 ; i<DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES ; i++) { if (display == mBuiltinDisplays[i]) { type = i; break; } } if (type < 0) { return type; } // TODO: Not sure if display density should handled by SF any longer class Density { static int getDensityFromProperty(char const* propName) { char property[PROPERTY_VALUE_MAX]; int density = 0; if (property_get(propName, property, NULL) > 0) { density = atoi(property); } return density; } public: static int getEmuDensity() { return getDensityFromProperty("qemu.sf.lcd_density"); } static int getBuildDensity() { return getDensityFromProperty("ro.sf.lcd_density"); } }; configs->clear(); const Vector<HWComposer::DisplayConfig>& hwConfigs = getHwComposer().getConfigs(type); for (size_t c = 0; c < hwConfigs.size(); ++c) { const HWComposer::DisplayConfig& hwConfig = hwConfigs[c]; DisplayInfo info = DisplayInfo(); float xdpi = hwConfig.xdpi; float ydpi = hwConfig.ydpi; if (type == DisplayDevice::DISPLAY_PRIMARY) { // The density of the device is provided by a build property float density = Density::getBuildDensity() / 160.0f; if (density == 0) { // the build doesn't provide a density -- this is wrong! // use xdpi instead ALOGE("ro.sf.lcd_density must be defined as a build property"); density = xdpi / 160.0f; } if (Density::getEmuDensity()) { // if "qemu.sf.lcd_density" is specified, it overrides everything xdpi = ydpi = density = Density::getEmuDensity(); density /= 160.0f; } info.density = density; // TODO: this needs to go away (currently needed only by webkit) sp<const DisplayDevice> hw(getDefaultDisplayDevice()); info.orientation = hw->getOrientation(); } else { // TODO: where should this value come from? static const int TV_DENSITY = 213; info.density = TV_DENSITY / 160.0f; info.orientation = 0; } info.w = hwConfig.width; info.h = hwConfig.height; info.xdpi = xdpi; info.ydpi = ydpi; info.fps = float(1e9 / hwConfig.refresh); info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS; info.colorTransform = hwConfig.colorTransform; // This is how far in advance a buffer must be queued for // presentation at a given time. If you want a buffer to appear // on the screen at time N, you must submit the buffer before // (N - presentationDeadline). // // Normally it's one full refresh period (to give SF a chance to // latch the buffer), but this can be reduced by configuring a // DispSync offset. Any additional delays introduced by the hardware // composer or panel must be accounted for here. // // We add an additional 1ms to allow for processing time and // differences between the ideal and actual refresh rate. info.presentationDeadline = hwConfig.refresh - SF_VSYNC_EVENT_PHASE_OFFSET_NS + 1000000; // All non-virtual displays are currently considered secure. info.secure = true; configs->push_back(info); } return NO_ERROR; } status_t SurfaceFlinger::getDisplayStats(const sp<IBinder>& /* display */, DisplayStatInfo* stats) { if (stats == NULL) { return BAD_VALUE; } // FIXME for now we always return stats for the primary display memset(stats, 0, sizeof(*stats)); stats->vsyncTime = mPrimaryDispSync.computeNextRefresh(0); stats->vsyncPeriod = mPrimaryDispSync.getPeriod(); return NO_ERROR; } int SurfaceFlinger::getActiveConfig(const sp<IBinder>& display) { sp<DisplayDevice> device(getDisplayDevice(display)); if (device != NULL) { return device->getActiveConfig(); } return BAD_VALUE; } void SurfaceFlinger::setActiveConfigInternal(const sp<DisplayDevice>& hw, int mode) { ALOGD("Set active config mode=%d, type=%d flinger=%p", mode, hw->getDisplayType(), this); int32_t type = hw->getDisplayType(); int currentMode = hw->getActiveConfig(); if (mode == currentMode) { ALOGD("Screen type=%d is already mode=%d", hw->getDisplayType(), mode); return; } if (type >= DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) { ALOGW("Trying to set config for virtual display"); return; } status_t status = getHwComposer().setActiveConfig(type, mode); if (status == NO_ERROR) { hw->setActiveConfig(mode); } } status_t SurfaceFlinger::setActiveConfig(const sp<IBinder>& display, int mode) { class MessageSetActiveConfig: public MessageBase { SurfaceFlinger& mFlinger; sp<IBinder> mDisplay; int mMode; public: MessageSetActiveConfig(SurfaceFlinger& flinger, const sp<IBinder>& disp, int mode) : mFlinger(flinger), mDisplay(disp) { mMode = mode; } virtual bool handler() { Vector<DisplayInfo> configs; mFlinger.getDisplayConfigs(mDisplay, &configs); if (mMode < 0 || mMode >= static_cast<int>(configs.size())) { ALOGE("Attempt to set active config = %d for display with %zu configs", mMode, configs.size()); } sp<DisplayDevice> hw(mFlinger.getDisplayDevice(mDisplay)); if (hw == NULL) { ALOGE("Attempt to set active config = %d for null display %p", mMode, mDisplay.get()); } else if (hw->getDisplayType() >= DisplayDevice::DISPLAY_VIRTUAL) { ALOGW("Attempt to set active config = %d for virtual display", mMode); } else { mFlinger.setActiveConfigInternal(hw, mMode); } return true; } }; sp<MessageBase> msg = new MessageSetActiveConfig(*this, display, mode); postMessageSync(msg); return NO_ERROR; } status_t SurfaceFlinger::clearAnimationFrameStats() { Mutex::Autolock _l(mStateLock); mAnimFrameTracker.clearStats(); return NO_ERROR; } status_t SurfaceFlinger::getAnimationFrameStats(FrameStats* outStats) const { Mutex::Autolock _l(mStateLock); mAnimFrameTracker.getStats(outStats); return NO_ERROR; } // ---------------------------------------------------------------------------- sp<IDisplayEventConnection> SurfaceFlinger::createDisplayEventConnection() { return mEventThread->createEventConnection(); } // ---------------------------------------------------------------------------- void SurfaceFlinger::waitForEvent() { mEventQueue.waitMessage(); } void SurfaceFlinger::signalTransaction() { mEventQueue.invalidate(); } void SurfaceFlinger::signalLayerUpdate() { mEventQueue.invalidate(); } void SurfaceFlinger::signalRefresh() { mEventQueue.refresh(); } status_t SurfaceFlinger::postMessageAsync(const sp<MessageBase>& msg, nsecs_t reltime, uint32_t /* flags */) { return mEventQueue.postMessage(msg, reltime); } status_t SurfaceFlinger::postMessageSync(const sp<MessageBase>& msg, nsecs_t reltime, uint32_t /* flags */) { status_t res = mEventQueue.postMessage(msg, reltime); if (res == NO_ERROR) { msg->wait(); } return res; } void SurfaceFlinger::run() { do { waitForEvent(); } while (true); } void SurfaceFlinger::enableHardwareVsync() { Mutex::Autolock _l(mHWVsyncLock); if (!mPrimaryHWVsyncEnabled && mHWVsyncAvailable) { mPrimaryDispSync.beginResync(); //eventControl(HWC_DISPLAY_PRIMARY, SurfaceFlinger::EVENT_VSYNC, true); mEventControlThread->setVsyncEnabled(true); mPrimaryHWVsyncEnabled = true; } } void SurfaceFlinger::resyncToHardwareVsync(bool makeAvailable) { Mutex::Autolock _l(mHWVsyncLock); if (makeAvailable) { mHWVsyncAvailable = true; } else if (!mHWVsyncAvailable) { ALOGE("resyncToHardwareVsync called when HW vsync unavailable"); return; } const nsecs_t period = getHwComposer().getRefreshPeriod(HWC_DISPLAY_PRIMARY); mPrimaryDispSync.reset(); mPrimaryDispSync.setPeriod(period); if (!mPrimaryHWVsyncEnabled) { mPrimaryDispSync.beginResync(); //eventControl(HWC_DISPLAY_PRIMARY, SurfaceFlinger::EVENT_VSYNC, true); mEventControlThread->setVsyncEnabled(true); mPrimaryHWVsyncEnabled = true; } } void SurfaceFlinger::disableHardwareVsync(bool makeUnavailable) { Mutex::Autolock _l(mHWVsyncLock); if (mPrimaryHWVsyncEnabled) { //eventControl(HWC_DISPLAY_PRIMARY, SurfaceFlinger::EVENT_VSYNC, false); mEventControlThread->setVsyncEnabled(false); mPrimaryDispSync.endResync(); mPrimaryHWVsyncEnabled = false; } if (makeUnavailable) { mHWVsyncAvailable = false; } } void SurfaceFlinger::onVSyncReceived(int type, nsecs_t timestamp) { bool needsHwVsync = false; { // Scope for the lock Mutex::Autolock _l(mHWVsyncLock); if (type == 0 && mPrimaryHWVsyncEnabled) { needsHwVsync = mPrimaryDispSync.addResyncSample(timestamp); } } if (needsHwVsync) { enableHardwareVsync(); } else { disableHardwareVsync(false); } } void SurfaceFlinger::onHotplugReceived(int type, bool connected) { if (mEventThread == NULL) { // This is a temporary workaround for b/7145521. A non-null pointer // does not mean EventThread has finished initializing, so this // is not a correct fix. ALOGW("WARNING: EventThread not started, ignoring hotplug"); return; } if (uint32_t(type) < DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) { Mutex::Autolock _l(mStateLock); if (connected) { createBuiltinDisplayLocked((DisplayDevice::DisplayType)type); } else { mCurrentState.displays.removeItem(mBuiltinDisplays[type]); mBuiltinDisplays[type].clear(); updateVisibleRegionsDirty(); } setTransactionFlags(eDisplayTransactionNeeded); // Defer EventThread notification until SF has updated mDisplays. } } void SurfaceFlinger::eventControl(int disp, int event, int enabled) { ATRACE_CALL(); getHwComposer().eventControl(disp, event, enabled); } void SurfaceFlinger::onMessageReceived(int32_t what) { ATRACE_CALL(); switch (what) { case MessageQueue::TRANSACTION: { handleMessageTransaction(); break; } case MessageQueue::INVALIDATE: { bool refreshNeeded = handleMessageTransaction(); refreshNeeded |= handleMessageInvalidate(); refreshNeeded |= mRepaintEverything; if (refreshNeeded) { // Signal a refresh if a transaction modified the window state, // a new buffer was latched, or if HWC has requested a full // repaint signalRefresh(); } break; } case MessageQueue::REFRESH: { handleMessageRefresh(); break; } } } bool SurfaceFlinger::handleMessageTransaction() { uint32_t transactionFlags = peekTransactionFlags(eTransactionMask); if (transactionFlags) { handleTransaction(transactionFlags); return true; } return false; } bool SurfaceFlinger::handleMessageInvalidate() { ATRACE_CALL(); return handlePageFlip(); } void SurfaceFlinger::handleMessageRefresh() { ATRACE_CALL(); static nsecs_t previousExpectedPresent = 0; nsecs_t expectedPresent = mPrimaryDispSync.computeNextRefresh(0); static bool previousFrameMissed = false; bool frameMissed = (expectedPresent == previousExpectedPresent); if (frameMissed != previousFrameMissed) { ATRACE_INT("FrameMissed", static_cast<int>(frameMissed)); } previousFrameMissed = frameMissed; if (CC_UNLIKELY(mDropMissedFrames && frameMissed)) { // Latch buffers, but don't send anything to HWC, then signal another // wakeup for the next vsync preComposition(); repaintEverything(); } else { preComposition(); rebuildLayerStacks(); setUpHWComposer(); doDebugFlashRegions(); doComposition(); postComposition(); } previousExpectedPresent = mPrimaryDispSync.computeNextRefresh(0); } void SurfaceFlinger::doDebugFlashRegions() { // is debugging enabled if (CC_LIKELY(!mDebugRegion)) return; const bool repaintEverything = mRepaintEverything; for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { const sp<DisplayDevice>& hw(mDisplays[dpy]); if (hw->isDisplayOn()) { // transform the dirty region into this screen's coordinate space const Region dirtyRegion(hw->getDirtyRegion(repaintEverything)); if (!dirtyRegion.isEmpty()) { // redraw the whole screen doComposeSurfaces(hw, Region(hw->bounds())); // and draw the dirty region const int32_t height = hw->getHeight(); RenderEngine& engine(getRenderEngine()); engine.fillRegionWithColor(dirtyRegion, height, 1, 0, 1, 1); hw->compositionComplete(); hw->swapBuffers(getHwComposer()); } } } postFramebuffer(); if (mDebugRegion > 1) { usleep(mDebugRegion * 1000); } HWComposer& hwc(getHwComposer()); if (hwc.initCheck() == NO_ERROR) { status_t err = hwc.prepare(); ALOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err)); } } void SurfaceFlinger::preComposition() { bool needExtraInvalidate = false; const LayerVector& layers(mDrawingState.layersSortedByZ); const size_t count = layers.size(); for (size_t i=0 ; i<count ; i++) { if (layers[i]->onPreComposition()) { needExtraInvalidate = true; } } if (needExtraInvalidate) { signalLayerUpdate(); } } void SurfaceFlinger::postComposition() { const LayerVector& layers(mDrawingState.layersSortedByZ); const size_t count = layers.size(); for (size_t i=0 ; i<count ; i++) { layers[i]->onPostComposition(); } const HWComposer& hwc = getHwComposer(); sp<Fence> presentFence = hwc.getDisplayFence(HWC_DISPLAY_PRIMARY); if (presentFence->isValid()) { if (mPrimaryDispSync.addPresentFence(presentFence)) { enableHardwareVsync(); } else { disableHardwareVsync(false); } } const sp<const DisplayDevice> hw(getDefaultDisplayDevice()); if (mPrimaryDispSync.ignorePresentFences()) { if (hw->isDisplayOn()) { enableHardwareVsync(); } } if (mAnimCompositionPending) { mAnimCompositionPending = false; if (presentFence->isValid()) { mAnimFrameTracker.setActualPresentFence(presentFence); } else { // The HWC doesn't support present fences, so use the refresh // timestamp instead. nsecs_t presentTime = hwc.getRefreshTimestamp(HWC_DISPLAY_PRIMARY); mAnimFrameTracker.setActualPresentTime(presentTime); } mAnimFrameTracker.advanceFrame(); } dumpDrawCycle(false); if (hw->getPowerMode() == HWC_POWER_MODE_OFF) { return; } nsecs_t currentTime = systemTime(); if (mHasPoweredOff) { mHasPoweredOff = false; } else { nsecs_t period = mPrimaryDispSync.getPeriod(); nsecs_t elapsedTime = currentTime - mLastSwapTime; size_t numPeriods = static_cast<size_t>(elapsedTime / period); if (numPeriods < NUM_BUCKETS - 1) { mFrameBuckets[numPeriods] += elapsedTime; } else { mFrameBuckets[NUM_BUCKETS - 1] += elapsedTime; } mTotalTime += elapsedTime; } mLastSwapTime = currentTime; } void SurfaceFlinger::rebuildLayerStacks() { updateExtendedMode(); // rebuild the visible layer list per screen if (CC_UNLIKELY(mVisibleRegionsDirty)) { ATRACE_CALL(); mVisibleRegionsDirty = false; invalidateHwcGeometry(); const LayerVector& layers(mDrawingState.layersSortedByZ); for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { Region opaqueRegion; Region dirtyRegion; Vector< sp<Layer> > layersSortedByZ; const sp<DisplayDevice>& hw(mDisplays[dpy]); const Transform& tr(hw->getTransform()); const Rect bounds(hw->getBounds()); if (hw->isDisplayOn()) { computeVisibleRegions(hw->getHwcDisplayId(), layers, hw->getLayerStack(), dirtyRegion, opaqueRegion); const size_t count = layers.size(); for (size_t i=0 ; i<count ; i++) { const sp<Layer>& layer(layers[i]); { Region drawRegion(tr.transform( layer->visibleNonTransparentRegion)); drawRegion.andSelf(bounds); if (!drawRegion.isEmpty()) { layersSortedByZ.add(layer); } } } } hw->setVisibleLayersSortedByZ(layersSortedByZ); hw->undefinedRegion.set(bounds); hw->undefinedRegion.subtractSelf(tr.transform(opaqueRegion)); hw->dirtyRegion.orSelf(dirtyRegion); } } } void SurfaceFlinger::setUpHWComposer() { for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { bool dirty = !mDisplays[dpy]->getDirtyRegion(false).isEmpty(); bool empty = mDisplays[dpy]->getVisibleLayersSortedByZ().size() == 0; bool wasEmpty = !mDisplays[dpy]->lastCompositionHadVisibleLayers; // If nothing has changed (!dirty), don't recompose. // If something changed, but we don't currently have any visible layers, // and didn't when we last did a composition, then skip it this time. // The second rule does two things: // - When all layers are removed from a display, we'll emit one black // frame, then nothing more until we get new layers. // - When a display is created with a private layer stack, we won't // emit any black frames until a layer is added to the layer stack. bool mustRecompose = dirty && !(empty && wasEmpty); ALOGV_IF(mDisplays[dpy]->getDisplayType() == DisplayDevice::DISPLAY_VIRTUAL, "dpy[%zu]: %s composition (%sdirty %sempty %swasEmpty)", dpy, mustRecompose ? "doing" : "skipping", dirty ? "+" : "-", empty ? "+" : "-", wasEmpty ? "+" : "-"); mDisplays[dpy]->beginFrame(mustRecompose); if (mustRecompose) { mDisplays[dpy]->lastCompositionHadVisibleLayers = !empty; } } // vr : detect whether contain FBR layer needsBFRender = false;//baofeng setting bootanimation input method HWComposer& hwc(getHwComposer()); if (hwc.initCheck() == NO_ERROR) { // build the h/w work list if (CC_UNLIKELY(mHwWorkListDirty)) { mHwWorkListDirty = false; for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { sp<const DisplayDevice> hw(mDisplays[dpy]); const int32_t id = hw->getHwcDisplayId(); if (id >= 0) { const Vector< sp<Layer> >& currentLayers( hw->getVisibleLayersSortedByZ()); const size_t count = currentLayers.size(); if (hwc.createWorkList(id, count) == NO_ERROR) { HWComposer::LayerListIterator cur = hwc.begin(id); const HWComposer::LayerListIterator end = hwc.end(id); for (size_t i=0 ; cur!=end && i<count ; ++i, ++cur) { const sp<Layer>& layer(currentLayers[i]); layer->setGeometry(hw, *cur); if(layer->isBFLayer()){ needsBFRender = true; cur->setSkip(true); } if (mDebugDisableHWC || mDebugRegion || mDaltonize || mHasColorMatrix) { cur->setSkip(true); } } } } } } // set the per-frame data for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { sp<const DisplayDevice> hw(mDisplays[dpy]); const int32_t id = hw->getHwcDisplayId(); if (id >= 0) { bool freezeSurfacePresent = false; isfreezeSurfacePresent(freezeSurfacePresent, hw, id); const Vector< sp<Layer> >& currentLayers( hw->getVisibleLayersSortedByZ()); const size_t count = currentLayers.size(); HWComposer::LayerListIterator cur = hwc.begin(id); const HWComposer::LayerListIterator end = hwc.end(id); for (size_t i=0 ; cur!=end && i<count ; ++i, ++cur) { /* * update the per-frame h/w composer data for each layer * and build the transparent region of the FB */ const sp<Layer>& layer(currentLayers[i]); if(layer->isBFLayer()){ needsBFRender = true; } layer->setPerFrameData(hw, *cur); setOrientationEventControl(freezeSurfacePresent,id); } } } // If possible, attempt to use the cursor overlay on each display. for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { sp<const DisplayDevice> hw(mDisplays[dpy]); const int32_t id = hw->getHwcDisplayId(); if (id >= 0) { const Vector< sp<Layer> >& currentLayers( hw->getVisibleLayersSortedByZ()); const size_t count = currentLayers.size(); HWComposer::LayerListIterator cur = hwc.begin(id); const HWComposer::LayerListIterator end = hwc.end(id); for (size_t i=0 ; cur!=end && i<count ; ++i, ++cur) { const sp<Layer>& layer(currentLayers[i]); if (layer->isPotentialCursor()) { cur->setIsCursorLayerHint(); break; } } } } dumpDrawCycle(true); status_t err = hwc.prepare(); ALOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err)); for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { sp<const DisplayDevice> hw(mDisplays[dpy]); hw->prepareFrame(hwc); } } } void SurfaceFlinger::doComposition() { ATRACE_CALL(); const bool repaintEverything = android_atomic_and(0, &mRepaintEverything); for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { const sp<DisplayDevice>& hw(mDisplays[dpy]); if (hw->isDisplayOn()) { // transform the dirty region into this screen's coordinate space const Region dirtyRegion(hw->getDirtyRegion(repaintEverything)); // repaint the framebuffer (if needed) doDisplayComposition(hw, dirtyRegion); hw->dirtyRegion.clear(); hw->flip(hw->swapRegion); hw->swapRegion.clear(); } // inform the h/w that we're done compositing hw->compositionComplete(); } postFramebuffer(); } void SurfaceFlinger::postFramebuffer() { ATRACE_CALL(); const nsecs_t now = systemTime(); mDebugInSwapBuffers = now; HWComposer& hwc(getHwComposer()); if (hwc.initCheck() == NO_ERROR) { if (!hwc.supportsFramebufferTarget()) { // EGL spec says: // "surface must be bound to the calling thread's current context, // for the current rendering API." getDefaultDisplayDevice()->makeCurrent(mEGLDisplay, mEGLContext); } hwc.commit(); } // make the default display current because the VirtualDisplayDevice code cannot // deal with dequeueBuffer() being called outside of the composition loop; however // the code below can call glFlush() which is allowed (and does in some case) call // dequeueBuffer(). getDefaultDisplayDevice()->makeCurrent(mEGLDisplay, mEGLContext); for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { sp<const DisplayDevice> hw(mDisplays[dpy]); const Vector< sp<Layer> >& currentLayers(hw->getVisibleLayersSortedByZ()); hw->onSwapBuffersCompleted(hwc); const size_t count = currentLayers.size(); int32_t id = hw->getHwcDisplayId(); if (id >=0 && hwc.initCheck() == NO_ERROR) { HWComposer::LayerListIterator cur = hwc.begin(id); const HWComposer::LayerListIterator end = hwc.end(id); for (size_t i = 0; cur != end && i < count; ++i, ++cur) { currentLayers[i]->onLayerDisplayed(hw, &*cur); } } else { for (size_t i = 0; i < count; i++) { currentLayers[i]->onLayerDisplayed(hw, NULL); } } } mLastSwapBufferTime = systemTime() - now; mDebugInSwapBuffers = 0; uint32_t flipCount = getDefaultDisplayDevice()->getPageFlipCount(); if (flipCount % LOG_FRAME_STATS_PERIOD == 0) { logFrameStats(); } } void SurfaceFlinger::handleTransaction(uint32_t transactionFlags) { ATRACE_CALL(); // here we keep a copy of the drawing state (that is the state that's // going to be overwritten by handleTransactionLocked()) outside of // mStateLock so that the side-effects of the State assignment // don't happen with mStateLock held (which can cause deadlocks). State drawingState(mDrawingState); Mutex::Autolock _l(mStateLock); const nsecs_t now = systemTime(); mDebugInTransaction = now; // Here we're guaranteed that some transaction flags are set // so we can call handleTransactionLocked() unconditionally. // We call getTransactionFlags(), which will also clear the flags, // with mStateLock held to guarantee that mCurrentState won't change // until the transaction is committed. transactionFlags = getTransactionFlags(eTransactionMask); handleTransactionLocked(transactionFlags); mLastTransactionTime = systemTime() - now; mDebugInTransaction = 0; invalidateHwcGeometry(); // here the transaction has been committed } void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) { const LayerVector& currentLayers(mCurrentState.layersSortedByZ); const size_t count = currentLayers.size(); /* * Traversal of the children * (perform the transaction for each of them if needed) */ if (transactionFlags & eTraversalNeeded) { for (size_t i=0 ; i<count ; i++) { const sp<Layer>& layer(currentLayers[i]); uint32_t trFlags = layer->getTransactionFlags(eTransactionNeeded); if (!trFlags) continue; const uint32_t flags = layer->doTransaction(0); if (flags & Layer::eVisibleRegion) mVisibleRegionsDirty = true; } } /* * Perform display own transactions if needed */ if (transactionFlags & eDisplayTransactionNeeded) { // here we take advantage of Vector's copy-on-write semantics to // improve performance by skipping the transaction entirely when // know that the lists are identical const KeyedVector< wp<IBinder>, DisplayDeviceState>& curr(mCurrentState.displays); const KeyedVector< wp<IBinder>, DisplayDeviceState>& draw(mDrawingState.displays); if (!curr.isIdenticalTo(draw)) { mVisibleRegionsDirty = true; const size_t cc = curr.size(); size_t dc = draw.size(); // find the displays that were removed // (ie: in drawing state but not in current state) // also handle displays that changed // (ie: displays that are in both lists) for (size_t i=0 ; i<dc ; i++) { const ssize_t j = curr.indexOfKey(draw.keyAt(i)); if (j < 0) { // in drawing state but not in current state if (!draw[i].isMainDisplay()) { // Call makeCurrent() on the primary display so we can // be sure that nothing associated with this display // is current. const sp<const DisplayDevice> defaultDisplay(getDefaultDisplayDevice()); defaultDisplay->makeCurrent(mEGLDisplay, mEGLContext); sp<DisplayDevice> hw(getDisplayDevice(draw.keyAt(i))); if (hw != NULL) hw->disconnect(getHwComposer()); if (draw[i].type < DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) mEventThread->onHotplugReceived(draw[i].type, false); mDisplays.removeItem(draw.keyAt(i)); } else { ALOGW("trying to remove the main display"); } } else { // this display is in both lists. see if something changed. const DisplayDeviceState& state(curr[j]); const wp<IBinder>& display(curr.keyAt(j)); const sp<IBinder> state_binder = IInterface::asBinder(state.surface); const sp<IBinder> draw_binder = IInterface::asBinder(draw[i].surface); if (state_binder != draw_binder) { // changing the surface is like destroying and // recreating the DisplayDevice, so we just remove it // from the drawing state, so that it get re-added // below. sp<DisplayDevice> hw(getDisplayDevice(display)); if (hw != NULL) hw->disconnect(getHwComposer()); mDisplays.removeItem(display); mDrawingState.displays.removeItemsAt(i); dc--; i--; // at this point we must loop to the next item continue; } const sp<DisplayDevice> disp(getDisplayDevice(display)); if (disp != NULL) { if (state.layerStack != draw[i].layerStack) { disp->setLayerStack(state.layerStack); } if ((state.orientation != draw[i].orientation) || (state.viewport != draw[i].viewport) || (state.frame != draw[i].frame)) { disp->setProjection(state.orientation, state.viewport, state.frame); } if (state.width != draw[i].width || state.height != draw[i].height) { disp->setDisplaySize(state.width, state.height); } } } } // find displays that were added // (ie: in current state but not in drawing state) for (size_t i=0 ; i<cc ; i++) { if (draw.indexOfKey(curr.keyAt(i)) < 0) { const DisplayDeviceState& state(curr[i]); sp<DisplaySurface> dispSurface; sp<IGraphicBufferProducer> producer; sp<IGraphicBufferProducer> bqProducer; sp<IGraphicBufferConsumer> bqConsumer; BufferQueue::createBufferQueue(&bqProducer, &bqConsumer, new GraphicBufferAlloc()); int32_t hwcDisplayId = -1; if (state.isVirtualDisplay()) { // Virtual displays without a surface are dormant: // they have external state (layer stack, projection, // etc.) but no internal state (i.e. a DisplayDevice). if (state.surface != NULL) { int width = 0; DisplayUtils* displayUtils = DisplayUtils::getInstance(); int status = state.surface->query( NATIVE_WINDOW_WIDTH, &width); ALOGE_IF(status != NO_ERROR, "Unable to query width (%d)", status); int height = 0; status = state.surface->query( NATIVE_WINDOW_HEIGHT, &height); ALOGE_IF(status != NO_ERROR, "Unable to query height (%d)", status); if (MAX_VIRTUAL_DISPLAY_DIMENSION == 0 || (width <= MAX_VIRTUAL_DISPLAY_DIMENSION && height <= MAX_VIRTUAL_DISPLAY_DIMENSION)) { int usage = 0; status = state.surface->query( NATIVE_WINDOW_CONSUMER_USAGE_BITS, &usage); ALOGW_IF(status != NO_ERROR, "Unable to query usage (%d)", status); if ( (status == NO_ERROR) && displayUtils->canAllocateHwcDisplayIdForVDS(usage)) { hwcDisplayId = allocateHwcDisplayId(state.type); } } displayUtils->initVDSInstance(mHwc, hwcDisplayId, state.surface, dispSurface, producer, bqProducer, bqConsumer, state.displayName, state.isSecure, state.type); } } else { ALOGE_IF(state.surface!=NULL, "adding a supported display, but rendering " "surface is provided (%p), ignoring it", state.surface.get()); hwcDisplayId = allocateHwcDisplayId(state.type); // for supported (by hwc) displays we provide our // own rendering surface dispSurface = new FramebufferSurface(*mHwc, state.type, bqConsumer); producer = bqProducer; } const wp<IBinder>& display(curr.keyAt(i)); if (dispSurface != NULL && producer != NULL) { sp<DisplayDevice> hw = new DisplayDevice(this, state.type, hwcDisplayId, mHwc->getFormat(hwcDisplayId), state.isSecure, display, dispSurface, producer, mRenderEngine->getEGLConfig()); hw->setLayerStack(state.layerStack); hw->setProjection(state.orientation, state.viewport, state.frame); hw->setDisplayName(state.displayName); // When a new display device is added update the active // config by querying HWC otherwise the default config // (config 0) will be used. if (hwcDisplayId >= DisplayDevice::DISPLAY_PRIMARY && hwcDisplayId < DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) { int activeConfig = mHwc->getActiveConfig(hwcDisplayId); if (activeConfig >= 0) { hw->setActiveConfig(activeConfig); } } mDisplays.add(display, hw); if (state.isVirtualDisplay()) { if (hwcDisplayId >= 0) { mHwc->setVirtualDisplayProperties(hwcDisplayId, hw->getWidth(), hw->getHeight(), hw->getFormat()); } } else { mEventThread->onHotplugReceived(state.type, true); } } } } } } if (transactionFlags & (eTraversalNeeded|eDisplayTransactionNeeded)) { // The transform hint might have changed for some layers // (either because a display has changed, or because a layer // as changed). // // Walk through all the layers in currentLayers, // and update their transform hint. // // If a layer is visible only on a single display, then that // display is used to calculate the hint, otherwise we use the // default display. // // NOTE: we do this here, rather than in rebuildLayerStacks() so that // the hint is set before we acquire a buffer from the surface texture. // // NOTE: layer transactions have taken place already, so we use their // drawing state. However, SurfaceFlinger's own transaction has not // happened yet, so we must use the current state layer list // (soon to become the drawing state list). // sp<const DisplayDevice> disp; uint32_t currentlayerStack = 0; for (size_t i=0; i<count; i++) { // NOTE: we rely on the fact that layers are sorted by // layerStack first (so we don't have to traverse the list // of displays for every layer). const sp<Layer>& layer(currentLayers[i]); uint32_t layerStack = layer->getDrawingState().layerStack; if (i==0 || currentlayerStack != layerStack) { currentlayerStack = layerStack; // figure out if this layerstack is mirrored // (more than one display) if so, pick the default display, // if not, pick the only display it's on. disp.clear(); for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { sp<const DisplayDevice> hw(mDisplays[dpy]); if (hw->getLayerStack() == currentlayerStack) { if (disp == NULL) { disp = hw; } else { disp = NULL; break; } } } } if (disp == NULL) { // NOTE: TEMPORARY FIX ONLY. Real fix should cause layers to // redraw after transform hint changes. See bug 8508397. // could be null when this layer is using a layerStack // that is not visible on any display. Also can occur at // screen off/on times. disp = getDefaultDisplayDevice(); } layer->updateTransformHint(disp); } } /* * Perform our own transaction if needed */ const LayerVector& layers(mDrawingState.layersSortedByZ); if (currentLayers.size() > layers.size()) { // layers have been added mVisibleRegionsDirty = true; } // some layers might have been removed, so // we need to update the regions they're exposing. if (mLayersRemoved) { mLayersRemoved = false; mVisibleRegionsDirty = true; const size_t count = layers.size(); for (size_t i=0 ; i<count ; i++) { const sp<Layer>& layer(layers[i]); if (currentLayers.indexOf(layer) < 0) { // this layer is not visible anymore // TODO: we could traverse the tree from front to back and // compute the actual visible region // TODO: we could cache the transformed region const Layer::State& s(layer->getDrawingState()); Region visibleReg = s.transform.transform( Region(Rect(s.active.w, s.active.h))); invalidateLayerStack(s.layerStack, visibleReg); } } } commitTransaction(); updateCursorAsync(); } void SurfaceFlinger::updateCursorAsync() { HWComposer& hwc(getHwComposer()); for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { sp<const DisplayDevice> hw(mDisplays[dpy]); const int32_t id = hw->getHwcDisplayId(); if (id < 0) { continue; } const Vector< sp<Layer> >& currentLayers( hw->getVisibleLayersSortedByZ()); const size_t count = currentLayers.size(); HWComposer::LayerListIterator cur = hwc.begin(id); const HWComposer::LayerListIterator end = hwc.end(id); for (size_t i=0 ; cur!=end && i<count ; ++i, ++cur) { if (cur->getCompositionType() != HWC_CURSOR_OVERLAY) { continue; } const sp<Layer>& layer(currentLayers[i]); Rect cursorPos = layer->getPosition(hw); hwc.setCursorPositionAsync(id, cursorPos); break; } } } void SurfaceFlinger::commitTransaction() { if (!mLayersPendingRemoval.isEmpty()) { // Notify removed layers now that they can't be drawn from for (size_t i = 0; i < mLayersPendingRemoval.size(); i++) { mLayersPendingRemoval[i]->onRemoved(); } mLayersPendingRemoval.clear(); } // If this transaction is part of a window animation then the next frame // we composite should be considered an animation as well. mAnimCompositionPending = mAnimTransactionPending; mDrawingState = mCurrentState; mTransactionPending = false; mAnimTransactionPending = false; mTransactionCV.broadcast(); } void SurfaceFlinger::computeVisibleRegions(size_t dpy, const LayerVector& currentLayers, uint32_t layerStack, Region& outDirtyRegion, Region& outOpaqueRegion) { ATRACE_CALL(); Region aboveOpaqueLayers; Region aboveCoveredLayers; Region dirty; outDirtyRegion.clear(); bool bIgnoreLayers = false; int indexLOI = -1; getIndexLOI(dpy, currentLayers, bIgnoreLayers, indexLOI); size_t i = currentLayers.size(); while (i--) { const sp<Layer>& layer = currentLayers[i]; // start with the whole surface at its current location const Layer::State& s(layer->getDrawingState()); if(updateLayerVisibleNonTransparentRegion(dpy, layer, bIgnoreLayers, indexLOI, layerStack, i)) continue; /* * opaqueRegion: area of a surface that is fully opaque. */ Region opaqueRegion; /* * visibleRegion: area of a surface that is visible on screen * and not fully transparent. This is essentially the layer's * footprint minus the opaque regions above it. * Areas covered by a translucent surface are considered visible. */ Region visibleRegion; /* * coveredRegion: area of a surface that is covered by all * visible regions above it (which includes the translucent areas). */ Region coveredRegion; /* * transparentRegion: area of a surface that is hinted to be completely * transparent. This is only used to tell when the layer has no visible * non-transparent regions and can be removed from the layer list. It * does not affect the visibleRegion of this layer or any layers * beneath it. The hint may not be correct if apps don't respect the * SurfaceView restrictions (which, sadly, some don't). */ Region transparentRegion; // handle hidden surfaces by setting the visible region to empty if (CC_LIKELY(layer->isVisible())) { const bool translucent = !layer->isOpaque(s); Rect bounds(s.transform.transform(layer->computeBounds())); visibleRegion.set(bounds); if (!visibleRegion.isEmpty()) { // Remove the transparent area from the visible region if (translucent) { const Transform tr(s.transform); if (tr.transformed()) { if (tr.preserveRects()) { // transform the transparent region transparentRegion = tr.transform(s.activeTransparentRegion); } else { // transformation too complex, can't do the // transparent region optimization. transparentRegion.clear(); } } else { transparentRegion = s.activeTransparentRegion; } } // compute the opaque region const int32_t layerOrientation = s.transform.getOrientation(); if (s.alpha==255 && !translucent && ((layerOrientation & Transform::ROT_INVALID) == false)) { // the opaque region is the layer's footprint opaqueRegion = visibleRegion; } } } // Clip the covered region to the visible region coveredRegion = aboveCoveredLayers.intersect(visibleRegion); // Update aboveCoveredLayers for next (lower) layer aboveCoveredLayers.orSelf(visibleRegion); // subtract the opaque region covered by the layers above us visibleRegion.subtractSelf(aboveOpaqueLayers); // compute this layer's dirty region if (layer->contentDirty) { // we need to invalidate the whole region dirty = visibleRegion; // as well, as the old visible region dirty.orSelf(layer->visibleRegion); layer->contentDirty = false; } else { /* compute the exposed region: * the exposed region consists of two components: * 1) what's VISIBLE now and was COVERED before * 2) what's EXPOSED now less what was EXPOSED before * * note that (1) is conservative, we start with the whole * visible region but only keep what used to be covered by * something -- which mean it may have been exposed. * * (2) handles areas that were not covered by anything but got * exposed because of a resize. */ const Region newExposed = visibleRegion - coveredRegion; const Region oldVisibleRegion = layer->visibleRegion; const Region oldCoveredRegion = layer->coveredRegion; const Region oldExposed = oldVisibleRegion - oldCoveredRegion; dirty = (visibleRegion&oldCoveredRegion) | (newExposed-oldExposed); } dirty.subtractSelf(aboveOpaqueLayers); // accumulate to the screen dirty region outDirtyRegion.orSelf(dirty); // Update aboveOpaqueLayers for next (lower) layer aboveOpaqueLayers.orSelf(opaqueRegion); // Store the visible region in screen space layer->setVisibleRegion(visibleRegion); layer->setCoveredRegion(coveredRegion); layer->setVisibleNonTransparentRegion( visibleRegion.subtract(transparentRegion)); } outOpaqueRegion = aboveOpaqueLayers; } void SurfaceFlinger::invalidateLayerStack(uint32_t layerStack, const Region& dirty) { for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { const sp<DisplayDevice>& hw(mDisplays[dpy]); if (hw->getLayerStack() == layerStack) { hw->dirtyRegion.orSelf(dirty); } } } bool SurfaceFlinger::handlePageFlip() { Region dirtyRegion; bool visibleRegions = false; const LayerVector& layers(mDrawingState.layersSortedByZ); bool frameQueued = false; // Store the set of layers that need updates. This set must not change as // buffers are being latched, as this could result in a deadlock. // Example: Two producers share the same command stream and: // 1.) Layer 0 is latched // 2.) Layer 0 gets a new frame // 2.) Layer 1 gets a new frame // 3.) Layer 1 is latched. // Display is now waiting on Layer 1's frame, which is behind layer 0's // second frame. But layer 0's second frame could be waiting on display. Vector<Layer*> layersWithQueuedFrames; for (size_t i = 0, count = layers.size(); i<count ; i++) { const sp<Layer>& layer(layers[i]); if (layer->hasQueuedFrame()) { frameQueued = true; if (layer->shouldPresentNow(mPrimaryDispSync)) { layersWithQueuedFrames.push_back(layer.get()); } else { layer->useEmptyDamage(); } } else { layer->useEmptyDamage(); } } for (size_t i = 0, count = layersWithQueuedFrames.size() ; i<count ; i++) { Layer* layer = layersWithQueuedFrames[i]; const Region dirty(layer->latchBuffer(visibleRegions)); layer->useSurfaceDamage(); const Layer::State& s(layer->getDrawingState()); invalidateLayerStack(s.layerStack, dirty); } mVisibleRegionsDirty |= visibleRegions; // If we will need to wake up at some time in the future to deal with a // queued frame that shouldn't be displayed during this vsync period, wake // up during the next vsync period to check again. if (frameQueued && layersWithQueuedFrames.empty()) { signalLayerUpdate(); } // Only continue with the refresh if there is actually new work to do return !layersWithQueuedFrames.empty(); } void SurfaceFlinger::invalidateHwcGeometry() { mHwWorkListDirty = true; } void SurfaceFlinger::doDisplayComposition(const sp<const DisplayDevice>& hw, const Region& inDirtyRegion) { // We only need to actually compose the display if: // 1) It is being handled by hardware composer, which may need this to // keep its virtual display state machine in sync, or // 2) There is work to be done (the dirty region isn't empty) bool isHwcDisplay = hw->getHwcDisplayId() >= 0; if (!isHwcDisplay && inDirtyRegion.isEmpty()) { return; } Region dirtyRegion(inDirtyRegion); // compute the invalid region hw->swapRegion.orSelf(dirtyRegion); uint32_t flags = hw->getFlags(); if (flags & DisplayDevice::SWAP_RECTANGLE) { // we can redraw only what's dirty, but since SWAP_RECTANGLE only // takes a rectangle, we must make sure to update that whole // rectangle in that case dirtyRegion.set(hw->swapRegion.bounds()); } else { if (flags & DisplayDevice::PARTIAL_UPDATES) { // We need to redraw the rectangle that will be updated // (pushed to the framebuffer). // This is needed because PARTIAL_UPDATES only takes one // rectangle instead of a region (see DisplayDevice::flip()) dirtyRegion.set(hw->swapRegion.bounds()); } else { // we need to redraw everything (the whole screen) dirtyRegion.set(hw->bounds()); hw->swapRegion = dirtyRegion; } } if (CC_LIKELY(!mDaltonize && !mHasColorMatrix)) { if(needsBFRender) { needsBFRender = true; RenderEngine& engine(getRenderEngine()); engine.bindTmpFBO(); float pfViewMatrix[16]; mTrackerThread->getLastHeadView(pfViewMatrix); //mTrackerThread->getLastHeadQuarternion(&engine.mRotation.w, &engine.mRotation.x, &engine.mRotation.y, &engine.mRotation.z); engine.setViewMatrix(pfViewMatrix); mHeadTrackInputEventThread->beginTracker(); if(!doComposeSurfaces(hw, dirtyRegion)) return; mHeadTrackInputEventThread->endTracker(pfViewMatrix); //distortion for VR engine.drawDistortion(); } else{ if (!doComposeSurfaces(hw, dirtyRegion)) return; } } else { RenderEngine& engine(getRenderEngine()); mat4 colorMatrix = mColorMatrix; if (mDaltonize) { colorMatrix = colorMatrix * mDaltonizer(); } mat4 oldMatrix = engine.setupColorTransform(colorMatrix); doComposeSurfaces(hw, dirtyRegion); engine.setupColorTransform(oldMatrix); } // update the swap region and clear the dirty region hw->swapRegion.orSelf(dirtyRegion); // swap buffers (presentation) hw->swapBuffers(getHwComposer()); } bool SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const Region& dirty) { RenderEngine& engine(getRenderEngine()); const int32_t id = hw->getHwcDisplayId(); HWComposer& hwc(getHwComposer()); HWComposer::LayerListIterator cur = hwc.begin(id); const HWComposer::LayerListIterator end = hwc.end(id); bool hasGlesComposition = hwc.hasGlesComposition(id); if (hasGlesComposition) { if (!hw->makeCurrent(mEGLDisplay, mEGLContext)) { ALOGW("DisplayDevice::makeCurrent failed. Aborting surface composition for display %s", hw->getDisplayName().string()); eglMakeCurrent(mEGLDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if(!getDefaultDisplayDevice()->makeCurrent(mEGLDisplay, mEGLContext)) { ALOGE("DisplayDevice::makeCurrent on default display failed. Aborting."); } return false; } // Never touch the framebuffer if we don't have any framebuffer layers #ifdef QTI_BSP const bool hasHwcComposition = hwc.hasHwcComposition(id) | (reinterpret_cast<ExHWComposer*>(&hwc))->getS3DFlag(id); #else const bool hasHwcComposition = hwc.hasHwcComposition(id); #endif if (hasHwcComposition) { // when using overlays, we assume a fully transparent framebuffer // NOTE: we could reduce how much we need to clear, for instance // remove where there are opaque FB layers. however, on some // GPUs doing a "clean slate" clear might be more efficient. // We'll revisit later if needed. engine.clearWithColor(0, 0, 0, 0); } else { // we start with the whole screen area const Region bounds(hw->getBounds()); // we remove the scissor part // we're left with the letterbox region // (common case is that letterbox ends-up being empty) const Region letterbox(bounds.subtract(hw->getScissor())); // compute the area to clear Region region(hw->undefinedRegion.merge(letterbox)); // but limit it to the dirty region region.andSelf(dirty); // screen is already cleared here if (!region.isEmpty()) { // can happen with SurfaceView drawWormHoleIfRequired(cur, end, hw, region); } } if (hw->getDisplayType() != DisplayDevice::DISPLAY_PRIMARY) { // just to be on the safe side, we don't set the // scissor on the main display. It should never be needed // anyways (though in theory it could since the API allows it). const Rect& bounds(hw->getBounds()); const Rect& scissor(hw->getScissor()); if (scissor != bounds) { // scissor doesn't match the screen's dimensions, so we // need to clear everything outside of it and enable // the GL scissor so we don't draw anything where we shouldn't // enable scissor for this frame const uint32_t height = hw->getHeight(); engine.setScissor(scissor.left, height - scissor.bottom, scissor.getWidth(), scissor.getHeight()); } } } /* * and then, render the layers targeted at the framebuffer */ if(needsBFRender) engine.drawSkybox(); const Vector< sp<Layer> >& layers(hw->getVisibleLayersSortedByZ()); const size_t count = layers.size(); const Transform& tr = hw->getTransform(); if (cur != end) { // we're using h/w composer for (size_t i=0 ; i<count && cur!=end ; ++i, ++cur) { const sp<Layer>& layer(layers[i]); const Region clip(dirty.intersect(tr.transform(layer->visibleRegion))); if (!clip.isEmpty()) { switch (cur->getCompositionType()) { case HWC_CURSOR_OVERLAY: case HWC_OVERLAY: { const Layer::State& state(layer->getDrawingState()); if ((cur->getHints() & HWC_HINT_CLEAR_FB) && i && layer->isOpaque(state) && (state.alpha == 0xFF) && hasGlesComposition) { // never clear the very first layer since we're // guaranteed the FB is already cleared layer->clearWithOpenGL(hw, clip); } break; } case HWC_FRAMEBUFFER: { layer->draw(hw, clip); break; } case HWC_FRAMEBUFFER_TARGET: { // this should not happen as the iterator shouldn't // let us get there. ALOGW("HWC_FRAMEBUFFER_TARGET found in hwc list (index=%zu)", i); break; } } } layer->setAcquireFence(hw, *cur); } } else { // we're not using h/w composer for (size_t i=0 ; i<count ; ++i) { const sp<Layer>& layer(layers[i]); const Region clip(dirty.intersect( tr.transform(layer->visibleRegion))); if (!clip.isEmpty()) { layer->draw(hw, clip); } } } // disable scissor at the end of the frame engine.disableScissor(); return true; } void SurfaceFlinger::drawWormhole(const sp<const DisplayDevice>& hw, const Region& region) const { const int32_t height = hw->getHeight(); RenderEngine& engine(getRenderEngine()); engine.fillRegionWithColor(region, height, 0, 0, 0, 0); } status_t SurfaceFlinger::addClientLayer(const sp<Client>& client, const sp<IBinder>& handle, const sp<IGraphicBufferProducer>& gbc, const sp<Layer>& lbc) { // add this layer to the current state list { Mutex::Autolock _l(mStateLock); if (mCurrentState.layersSortedByZ.size() >= MAX_LAYERS) { return NO_MEMORY; } mCurrentState.layersSortedByZ.add(lbc); mGraphicBufferProducerList.add(IInterface::asBinder(gbc)); } // attach this layer to the client client->attachLayer(handle, lbc); return NO_ERROR; } status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer) { Mutex::Autolock _l(mStateLock); ssize_t index = mCurrentState.layersSortedByZ.remove(layer); if (index >= 0) { mLayersPendingRemoval.push(layer); mLayersRemoved = true; setTransactionFlags(eTransactionNeeded); return NO_ERROR; } return status_t(index); } uint32_t SurfaceFlinger::peekTransactionFlags(uint32_t /* flags */) { return android_atomic_release_load(&mTransactionFlags); } uint32_t SurfaceFlinger::getTransactionFlags(uint32_t flags) { return android_atomic_and(~flags, &mTransactionFlags) & flags; } uint32_t SurfaceFlinger::setTransactionFlags(uint32_t flags) { uint32_t old = android_atomic_or(flags, &mTransactionFlags); if ((old & flags)==0) { // wake the server up signalTransaction(); } return old; } void SurfaceFlinger::setTransactionState( const Vector<ComposerState>& state, const Vector<DisplayState>& displays, uint32_t flags) { ATRACE_CALL(); delayDPTransactionIfNeeded(displays); Mutex::Autolock _l(mStateLock); uint32_t transactionFlags = 0; if (flags & eAnimation) { // For window updates that are part of an animation we must wait for // previous animation "frames" to be handled. while (mAnimTransactionPending) { status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5)); if (CC_UNLIKELY(err != NO_ERROR)) { // just in case something goes wrong in SF, return to the // caller after a few seconds. ALOGW_IF(err == TIMED_OUT, "setTransactionState timed out " "waiting for previous animation frame"); mAnimTransactionPending = false; break; } } } size_t count = displays.size(); for (size_t i=0 ; i<count ; i++) { const DisplayState& s(displays[i]); transactionFlags |= setDisplayStateLocked(s); } count = state.size(); for (size_t i=0 ; i<count ; i++) { const ComposerState& s(state[i]); // Here we need to check that the interface we're given is indeed // one of our own. A malicious client could give us a NULL // IInterface, or one of its own or even one of our own but a // different type. All these situations would cause us to crash. // // NOTE: it would be better to use RTTI as we could directly check // that we have a Client*. however, RTTI is disabled in Android. if (s.client != NULL) { sp<IBinder> binder = IInterface::asBinder(s.client); if (binder != NULL) { String16 desc(binder->getInterfaceDescriptor()); if (desc == ISurfaceComposerClient::descriptor) { sp<Client> client( static_cast<Client *>(s.client.get()) ); transactionFlags |= setClientStateLocked(client, s.state); } } } } if (transactionFlags) { // this triggers the transaction setTransactionFlags(transactionFlags); // if this is a synchronous transaction, wait for it to take effect // before returning. if (flags & eSynchronous) { mTransactionPending = true; } if (flags & eAnimation) { mAnimTransactionPending = true; } while (mTransactionPending) { status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5)); if (CC_UNLIKELY(err != NO_ERROR)) { // just in case something goes wrong in SF, return to the // called after a few seconds. ALOGW_IF(err == TIMED_OUT, "setTransactionState timed out!"); mTransactionPending = false; break; } } } } uint32_t SurfaceFlinger::setDisplayStateLocked(const DisplayState& s) { ssize_t dpyIdx = mCurrentState.displays.indexOfKey(s.token); if (dpyIdx < 0) return 0; uint32_t flags = 0; DisplayDeviceState& disp(mCurrentState.displays.editValueAt(dpyIdx)); if (disp.isValid()) { const uint32_t what = s.what; if (what & DisplayState::eSurfaceChanged) { if (IInterface::asBinder(disp.surface) != IInterface::asBinder(s.surface)) { disp.surface = s.surface; flags |= eDisplayTransactionNeeded; } } if (what & DisplayState::eLayerStackChanged) { if (disp.layerStack != s.layerStack) { disp.layerStack = s.layerStack; flags |= eDisplayTransactionNeeded; } } if (what & DisplayState::eDisplayProjectionChanged) { if (disp.orientation != s.orientation) { disp.orientation = s.orientation; flags |= eDisplayTransactionNeeded; } if (disp.frame != s.frame) { disp.frame = s.frame; flags |= eDisplayTransactionNeeded; } if (disp.viewport != s.viewport) { disp.viewport = s.viewport; flags |= eDisplayTransactionNeeded; } } if (what & DisplayState::eDisplaySizeChanged) { if (disp.width != s.width) { disp.width = s.width; flags |= eDisplayTransactionNeeded; } if (disp.height != s.height) { disp.height = s.height; flags |= eDisplayTransactionNeeded; } } } return flags; } uint32_t SurfaceFlinger::setClientStateLocked( const sp<Client>& client, const layer_state_t& s) { uint32_t flags = 0; sp<Layer> layer(client->getLayerUser(s.surface)); if (layer != 0) { const uint32_t what = s.what; if (what & layer_state_t::ePositionChanged) { if (layer->setPosition(s.x, s.y)) flags |= eTraversalNeeded; } if (what & layer_state_t::eLayerChanged) { // NOTE: index needs to be calculated before we update the state ssize_t idx = mCurrentState.layersSortedByZ.indexOf(layer); if (layer->setLayer(s.z)) { mCurrentState.layersSortedByZ.removeAt(idx); mCurrentState.layersSortedByZ.add(layer); // we need traversal (state changed) // AND transaction (list changed) flags |= eTransactionNeeded|eTraversalNeeded; } } if (what & layer_state_t::eSizeChanged) { if (layer->setSize(s.w, s.h)) { flags |= eTraversalNeeded; } } if (what & layer_state_t::eAlphaChanged) { if (layer->setAlpha(uint8_t(255.0f*s.alpha+0.5f))) flags |= eTraversalNeeded; } if (what & layer_state_t::eMatrixChanged) { if (layer->setMatrix(s.matrix)) flags |= eTraversalNeeded; } if (what & layer_state_t::eTransparentRegionChanged) { if (layer->setTransparentRegionHint(s.transparentRegion)) flags |= eTraversalNeeded; } if (what & layer_state_t::eFlagsChanged) { if (layer->setFlags(s.flags, s.mask)) flags |= eTraversalNeeded; } if (what & layer_state_t::eCropChanged) { if (layer->setCrop(s.crop)) flags |= eTraversalNeeded; } if (what & layer_state_t::eLayerStackChanged) { // NOTE: index needs to be calculated before we update the state ssize_t idx = mCurrentState.layersSortedByZ.indexOf(layer); if (layer->setLayerStack(s.layerStack)) { mCurrentState.layersSortedByZ.removeAt(idx); mCurrentState.layersSortedByZ.add(layer); // we need traversal (state changed) // AND transaction (list changed) flags |= eTransactionNeeded|eTraversalNeeded; } } } return flags; } status_t SurfaceFlinger::createLayer( const String8& name, const sp<Client>& client, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp) { //ALOGD("createLayer for (%d x %d), name=%s", w, h, name.string()); if (int32_t(w|h) < 0) { ALOGE("createLayer() failed, w or h is negative (w=%d, h=%d)", int(w), int(h)); return BAD_VALUE; } status_t result = NO_ERROR; sp<Layer> layer; switch (flags & ISurfaceComposerClient::eFXSurfaceMask) { case ISurfaceComposerClient::eFXSurfaceNormal: result = createNormalLayer(client, name, w, h, flags, format, handle, gbp, &layer); break; case ISurfaceComposerClient::eFXSurfaceDim: result = createDimLayer(client, name, w, h, flags, handle, gbp, &layer); break; default: result = BAD_VALUE; break; } if (result != NO_ERROR) { return result; } result = addClientLayer(client, *handle, *gbp, layer); if (result != NO_ERROR) { return result; } setTransactionFlags(eTransactionNeeded); return result; } status_t SurfaceFlinger::createNormalLayer(const sp<Client>& client, const String8& name, uint32_t w, uint32_t h, uint32_t flags, PixelFormat& format, sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp, sp<Layer>* outLayer) { // initialize the surfaces switch (format) { case PIXEL_FORMAT_TRANSPARENT: case PIXEL_FORMAT_TRANSLUCENT: format = PIXEL_FORMAT_RGBA_8888; break; case PIXEL_FORMAT_OPAQUE: format = PIXEL_FORMAT_RGBX_8888; break; } *outLayer = DisplayUtils::getInstance()->getLayerInstance(this, client, name, w, h, flags); status_t err = (*outLayer)->setBuffers(w, h, format, flags); if (err == NO_ERROR) { *handle = (*outLayer)->getHandle(); *gbp = (*outLayer)->getProducer(); } ALOGE_IF(err, "createNormalLayer() failed (%s)", strerror(-err)); return err; } status_t SurfaceFlinger::createDimLayer(const sp<Client>& client, const String8& name, uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp, sp<Layer>* outLayer) { *outLayer = new LayerDim(this, client, name, w, h, flags); *handle = (*outLayer)->getHandle(); *gbp = (*outLayer)->getProducer(); return NO_ERROR; } status_t SurfaceFlinger::onLayerRemoved(const sp<Client>& client, const sp<IBinder>& handle) { // called by the window manager when it wants to remove a Layer status_t err = NO_ERROR; sp<Layer> l(client->getLayerUser(handle)); if (l != NULL) { err = removeLayer(l); ALOGE_IF(err<0 && err != NAME_NOT_FOUND, "error removing layer=%p (%s)", l.get(), strerror(-err)); } return err; } status_t SurfaceFlinger::onLayerDestroyed(const wp<Layer>& layer) { // called by ~LayerCleaner() when all references to the IBinder (handle) // are gone status_t err = NO_ERROR; sp<Layer> l(layer.promote()); if (l != NULL) { err = removeLayer(l); ALOGE_IF(err<0 && err != NAME_NOT_FOUND, "error removing layer=%p (%s)", l.get(), strerror(-err)); } return err; } // --------------------------------------------------------------------------- void SurfaceFlinger::onInitializeDisplays() { // reset screen orientation and use primary layer stack Vector<ComposerState> state; Vector<DisplayState> displays; DisplayState d; d.what = DisplayState::eDisplayProjectionChanged | DisplayState::eLayerStackChanged; d.token = mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY]; d.layerStack = 0; d.orientation = DisplayState::eOrientationDefault; d.frame.makeInvalid(); d.viewport.makeInvalid(); d.width = 0; d.height = 0; displays.add(d); setTransactionState(state, displays, 0); setPowerModeInternal(getDisplayDevice(d.token), HWC_POWER_MODE_NORMAL); const nsecs_t period = getHwComposer().getRefreshPeriod(HWC_DISPLAY_PRIMARY); mAnimFrameTracker.setDisplayRefreshPeriod(period); } void SurfaceFlinger::initializeDisplays() { class MessageScreenInitialized : public MessageBase { SurfaceFlinger* flinger; public: MessageScreenInitialized(SurfaceFlinger* flinger) : flinger(flinger) { } virtual bool handler() { flinger->onInitializeDisplays(); return true; } }; sp<MessageBase> msg = new MessageScreenInitialized(this); postMessageAsync(msg); // we may be called from main thread, use async message } void SurfaceFlinger::setPowerModeInternal(const sp<DisplayDevice>& hw, int mode) { ALOGD("Set power mode=%d, type=%d flinger=%p", mode, hw->getDisplayType(), this); int32_t type = hw->getDisplayType(); int currentMode = hw->getPowerMode(); if (mode == currentMode) { ALOGD("Screen type=%d is already mode=%d", hw->getDisplayType(), mode); return; } hw->setPowerMode(mode); if (type >= DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) { ALOGW("Trying to set power mode for virtual display"); return; } if (currentMode == HWC_POWER_MODE_OFF) { getHwComposer().setPowerMode(type, mode); if (type == DisplayDevice::DISPLAY_PRIMARY) { // FIXME: eventthread only knows about the main display right now mEventThread->onScreenAcquired(); resyncToHardwareVsync(true); } mVisibleRegionsDirty = true; mHasPoweredOff = true; repaintEverything(); } else if (mode == HWC_POWER_MODE_OFF) { if (type == DisplayDevice::DISPLAY_PRIMARY) { disableHardwareVsync(true); // also cancels any in-progress resync // FIXME: eventthread only knows about the main display right now mEventThread->onScreenReleased(); } getHwComposer().setPowerMode(type, mode); mVisibleRegionsDirty = true; // from this point on, SF will stop drawing on this display } else { getHwComposer().setPowerMode(type, mode); } } void SurfaceFlinger::setPowerMode(const sp<IBinder>& display, int mode) { class MessageSetPowerMode: public MessageBase { SurfaceFlinger& mFlinger; sp<IBinder> mDisplay; int mMode; public: MessageSetPowerMode(SurfaceFlinger& flinger, const sp<IBinder>& disp, int mode) : mFlinger(flinger), mDisplay(disp) { mMode = mode; } virtual bool handler() { sp<DisplayDevice> hw(mFlinger.getDisplayDevice(mDisplay)); if (hw == NULL) { ALOGE("Attempt to set power mode = %d for null display %p", mMode, mDisplay.get()); } else if (hw->getDisplayType() >= DisplayDevice::DISPLAY_VIRTUAL) { ALOGW("Attempt to set power mode = %d for virtual display", mMode); } else { mFlinger.setPowerModeInternal(hw, mMode); } return true; } }; sp<MessageBase> msg = new MessageSetPowerMode(*this, display, mode); postMessageSync(msg); } // --------------------------------------------------------------------------- status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args) { String8 result; IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); const int uid = ipc->getCallingUid(); if ((uid != AID_SHELL) && !PermissionCache::checkPermission(sDump, pid, uid)) { result.appendFormat("Permission Denial: " "can't dump SurfaceFlinger from pid=%d, uid=%d\n", pid, uid); } else { // Try to get the main lock, but give up after one second // (this would indicate SF is stuck, but we want to be able to // print something in dumpsys). status_t err = mStateLock.timedLock(s2ns(1)); bool locked = (err == NO_ERROR); if (!locked) { result.appendFormat( "SurfaceFlinger appears to be unresponsive (%s [%d]), " "dumping anyways (no locks held)\n", strerror(-err), err); } bool dumpAll = true; size_t index = 0; size_t numArgs = args.size(); if (numArgs) { if ((index < numArgs) && (args[index] == String16("--list"))) { index++; listLayersLocked(args, index, result); dumpAll = false; } if ((index < numArgs) && (args[index] == String16("--latency"))) { index++; dumpStatsLocked(args, index, result); dumpAll = false; } if ((index < numArgs) && (args[index] == String16("--latency-clear"))) { index++; clearStatsLocked(args, index, result); dumpAll = false; } if ((index < numArgs) && (args[index] == String16("--dispsync"))) { index++; mPrimaryDispSync.dump(result); dumpAll = false; } if ((index < numArgs) && (args[index] == String16("--static-screen"))) { index++; dumpStaticScreenStats(result); dumpAll = false; } } if (dumpAll) { dumpAllLocked(args, index, result); } if (locked) { mStateLock.unlock(); } } write(fd, result.string(), result.size()); return NO_ERROR; } void SurfaceFlinger::listLayersLocked(const Vector<String16>& /* args */, size_t& /* index */, String8& result) const { const LayerVector& currentLayers = mCurrentState.layersSortedByZ; const size_t count = currentLayers.size(); for (size_t i=0 ; i<count ; i++) { const sp<Layer>& layer(currentLayers[i]); result.appendFormat("%s\n", layer->getName().string()); } } void SurfaceFlinger::dumpStatsLocked(const Vector<String16>& args, size_t& index, String8& result) const { String8 name; if (index < args.size()) { name = String8(args[index]); index++; } const nsecs_t period = getHwComposer().getRefreshPeriod(HWC_DISPLAY_PRIMARY); result.appendFormat("%" PRId64 "\n", period); if (name.isEmpty()) { mAnimFrameTracker.dumpStats(result); } else { const LayerVector& currentLayers = mCurrentState.layersSortedByZ; const size_t count = currentLayers.size(); for (size_t i=0 ; i<count ; i++) { const sp<Layer>& layer(currentLayers[i]); if (name == layer->getName()) { layer->dumpFrameStats(result); } } } } void SurfaceFlinger::clearStatsLocked(const Vector<String16>& args, size_t& index, String8& /* result */) { String8 name; if (index < args.size()) { name = String8(args[index]); index++; } const LayerVector& currentLayers = mCurrentState.layersSortedByZ; const size_t count = currentLayers.size(); for (size_t i=0 ; i<count ; i++) { const sp<Layer>& layer(currentLayers[i]); if (name.isEmpty() || (name == layer->getName())) { layer->clearFrameStats(); } } mAnimFrameTracker.clearStats(); } // This should only be called from the main thread. Otherwise it would need // the lock and should use mCurrentState rather than mDrawingState. void SurfaceFlinger::logFrameStats() { const LayerVector& drawingLayers = mDrawingState.layersSortedByZ; const size_t count = drawingLayers.size(); for (size_t i=0 ; i<count ; i++) { const sp<Layer>& layer(drawingLayers[i]); layer->logFrameStats(); } mAnimFrameTracker.logAndResetStats(String8("<win-anim>")); } /*static*/ void SurfaceFlinger::appendSfConfigString(String8& result) { static const char* config = " [sf" #ifdef HAS_CONTEXT_PRIORITY " HAS_CONTEXT_PRIORITY" #endif #ifdef NEVER_DEFAULT_TO_ASYNC_MODE " NEVER_DEFAULT_TO_ASYNC_MODE" #endif #ifdef TARGET_DISABLE_TRIPLE_BUFFERING " TARGET_DISABLE_TRIPLE_BUFFERING" #endif "]"; result.append(config); } void SurfaceFlinger::dumpStaticScreenStats(String8& result) const { result.appendFormat("Static screen stats:\n"); for (size_t b = 0; b < NUM_BUCKETS - 1; ++b) { float bucketTimeSec = mFrameBuckets[b] / 1e9; float percent = 100.0f * static_cast<float>(mFrameBuckets[b]) / mTotalTime; result.appendFormat(" < %zd frames: %.3f s (%.1f%%)\n", b + 1, bucketTimeSec, percent); } float bucketTimeSec = mFrameBuckets[NUM_BUCKETS - 1] / 1e9; float percent = 100.0f * static_cast<float>(mFrameBuckets[NUM_BUCKETS - 1]) / mTotalTime; result.appendFormat(" %zd+ frames: %.3f s (%.1f%%)\n", NUM_BUCKETS - 1, bucketTimeSec, percent); } void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index, String8& result) const { bool colorize = false; if (index < args.size() && (args[index] == String16("--color"))) { colorize = true; index++; } Colorizer colorizer(colorize); // figure out if we're stuck somewhere const nsecs_t now = systemTime(); const nsecs_t inSwapBuffers(mDebugInSwapBuffers); const nsecs_t inTransaction(mDebugInTransaction); nsecs_t inSwapBuffersDuration = (inSwapBuffers) ? now-inSwapBuffers : 0; nsecs_t inTransactionDuration = (inTransaction) ? now-inTransaction : 0; /* * Dump library configuration. */ colorizer.bold(result); result.append("Build configuration:"); colorizer.reset(result); appendSfConfigString(result); appendUiConfigString(result); appendGuiConfigString(result); result.append("\n"); colorizer.bold(result); result.append("Sync configuration: "); colorizer.reset(result); result.append(SyncFeatures::getInstance().toString()); result.append("\n"); colorizer.bold(result); result.append("DispSync configuration: "); colorizer.reset(result); result.appendFormat("app phase %" PRId64 " ns, sf phase %" PRId64 " ns, " "present offset %d ns (refresh %" PRId64 " ns)", vsyncPhaseOffsetNs, sfVsyncPhaseOffsetNs, PRESENT_TIME_OFFSET_FROM_VSYNC_NS, mHwc->getRefreshPeriod(HWC_DISPLAY_PRIMARY)); result.append("\n"); // Dump static screen stats result.append("\n"); dumpStaticScreenStats(result); result.append("\n"); /* * Dump the visible layer list */ const LayerVector& currentLayers = mCurrentState.layersSortedByZ; const size_t count = currentLayers.size(); colorizer.bold(result); result.appendFormat("Visible layers (count = %zu)\n", count); colorizer.reset(result); for (size_t i=0 ; i<count ; i++) { const sp<Layer>& layer(currentLayers[i]); layer->dump(result, colorizer); } /* * Dump Display state */ colorizer.bold(result); result.appendFormat("Displays (%zu entries)\n", mDisplays.size()); colorizer.reset(result); for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) { const sp<const DisplayDevice>& hw(mDisplays[dpy]); hw->dump(result); } /* * Dump SurfaceFlinger global state */ colorizer.bold(result); result.append("SurfaceFlinger global state:\n"); colorizer.reset(result); HWComposer& hwc(getHwComposer()); sp<const DisplayDevice> hw(getDefaultDisplayDevice()); colorizer.bold(result); result.appendFormat("EGL implementation : %s\n", eglQueryStringImplementationANDROID(mEGLDisplay, EGL_VERSION)); colorizer.reset(result); result.appendFormat("%s\n", eglQueryStringImplementationANDROID(mEGLDisplay, EGL_EXTENSIONS)); mRenderEngine->dump(result); hw->undefinedRegion.dump(result, "undefinedRegion"); result.appendFormat(" orientation=%d, isDisplayOn=%d\n", hw->getOrientation(), hw->isDisplayOn()); result.appendFormat( " last eglSwapBuffers() time: %f us\n" " last transaction time : %f us\n" " transaction-flags : %08x\n" " refresh-rate : %f fps\n" " x-dpi : %f\n" " y-dpi : %f\n" " gpu_to_cpu_unsupported : %d\n" , mLastSwapBufferTime/1000.0, mLastTransactionTime/1000.0, mTransactionFlags, 1e9 / hwc.getRefreshPeriod(HWC_DISPLAY_PRIMARY), hwc.getDpiX(HWC_DISPLAY_PRIMARY), hwc.getDpiY(HWC_DISPLAY_PRIMARY), !mGpuToCpuSupported); result.appendFormat(" eglSwapBuffers time: %f us\n", inSwapBuffersDuration/1000.0); result.appendFormat(" transaction time: %f us\n", inTransactionDuration/1000.0); /* * VSYNC state */ mEventThread->dump(result); /* * Dump HWComposer state */ colorizer.bold(result); result.append("h/w composer state:\n"); colorizer.reset(result); result.appendFormat(" h/w composer %s and %s\n", hwc.initCheck()==NO_ERROR ? "present" : "not present", (mDebugDisableHWC || mDebugRegion || mDaltonize || mHasColorMatrix) ? "disabled" : "enabled"); hwc.dump(result); /* * Dump gralloc state */ const GraphicBufferAllocator& alloc(GraphicBufferAllocator::get()); alloc.dump(result); } const Vector< sp<Layer> >& SurfaceFlinger::getLayerSortedByZForHwcDisplay(int id) { // Note: mStateLock is held here wp<IBinder> dpy; for (size_t i=0 ; i<mDisplays.size() ; i++) { if (mDisplays.valueAt(i)->getHwcDisplayId() == id) { dpy = mDisplays.keyAt(i); break; } } if (dpy == NULL) { ALOGW("getLayerSortedByZForHwcDisplay: invalid hwc display id %d", id); // Just use the primary display so we have something to return dpy = getBuiltInDisplay(DisplayDevice::DISPLAY_PRIMARY); } return getDisplayDevice(dpy)->getVisibleLayersSortedByZ(); } bool SurfaceFlinger::startDdmConnection() { void* libddmconnection_dso = dlopen("libsurfaceflinger_ddmconnection.so", RTLD_NOW); if (!libddmconnection_dso) { return false; } void (*DdmConnection_start)(const char* name); DdmConnection_start = (decltype(DdmConnection_start))dlsym(libddmconnection_dso, "DdmConnection_start"); if (!DdmConnection_start) { dlclose(libddmconnection_dso); return false; } (*DdmConnection_start)(getServiceName()); return true; } status_t SurfaceFlinger::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { switch (code) { case CREATE_CONNECTION: case CREATE_DISPLAY: case SET_TRANSACTION_STATE: case BOOT_FINISHED: case CLEAR_ANIMATION_FRAME_STATS: case GET_ANIMATION_FRAME_STATS: case SET_POWER_MODE: { // codes that require permission check IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); const int uid = ipc->getCallingUid(); if ((uid != AID_GRAPHICS && uid != AID_SYSTEM) && !PermissionCache::checkPermission(sAccessSurfaceFlinger, pid, uid)) { ALOGE("Permission Denial: " "can't access SurfaceFlinger pid=%d, uid=%d", pid, uid); return PERMISSION_DENIED; } break; } case CAPTURE_SCREEN: { // codes that require permission check IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); const int uid = ipc->getCallingUid(); if ((uid != AID_GRAPHICS) && !PermissionCache::checkPermission(sReadFramebuffer, pid, uid)) { ALOGE("Permission Denial: " "can't read framebuffer pid=%d, uid=%d", pid, uid); return PERMISSION_DENIED; } break; } } status_t err = BnSurfaceComposer::onTransact(code, data, reply, flags); if (err == UNKNOWN_TRANSACTION || err == PERMISSION_DENIED) { CHECK_INTERFACE(ISurfaceComposer, data, reply); if (CC_UNLIKELY(!PermissionCache::checkCallingPermission(sHardwareTest))) { IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); const int uid = ipc->getCallingUid(); ALOGE("Permission Denial: " "can't access SurfaceFlinger pid=%d, uid=%d", pid, uid); return PERMISSION_DENIED; } int n; switch (code) { case 1000: // SHOW_CPU, NOT SUPPORTED ANYMORE case 1001: // SHOW_FPS, NOT SUPPORTED ANYMORE return NO_ERROR; case 1002: // SHOW_UPDATES n = data.readInt32(); mDebugRegion = n ? n : (mDebugRegion ? 0 : 1); invalidateHwcGeometry(); repaintEverything(); return NO_ERROR; case 1004:{ // repaint everything repaintEverything(); return NO_ERROR; } case 1005:{ // force transaction setTransactionFlags( eTransactionNeeded| eDisplayTransactionNeeded| eTraversalNeeded); return NO_ERROR; } case 1006:{ // send empty update signalRefresh(); return NO_ERROR; } case 1008: // toggle use of hw composer n = data.readInt32(); mDebugDisableHWC = n ? 1 : 0; invalidateHwcGeometry(); repaintEverything(); return NO_ERROR; case 1009: // toggle use of transform hint n = data.readInt32(); mDebugDisableTransformHint = n ? 1 : 0; invalidateHwcGeometry(); repaintEverything(); return NO_ERROR; case 1010: // interrogate. reply->writeInt32(0); reply->writeInt32(0); reply->writeInt32(mDebugRegion); reply->writeInt32(0); reply->writeInt32(mDebugDisableHWC); return NO_ERROR; case 1013: { Mutex::Autolock _l(mStateLock); sp<const DisplayDevice> hw(getDefaultDisplayDevice()); reply->writeInt32(hw->getPageFlipCount()); return NO_ERROR; } case 1014: { // daltonize n = data.readInt32(); switch (n % 10) { case 1: mDaltonizer.setType(Daltonizer::protanomaly); break; case 2: mDaltonizer.setType(Daltonizer::deuteranomaly); break; case 3: mDaltonizer.setType(Daltonizer::tritanomaly); break; } if (n >= 10) { mDaltonizer.setMode(Daltonizer::correction); } else { mDaltonizer.setMode(Daltonizer::simulation); } mDaltonize = n > 0; invalidateHwcGeometry(); repaintEverything(); return NO_ERROR; } case 1015: { // apply a color matrix n = data.readInt32(); mHasColorMatrix = n ? 1 : 0; if (n) { // color matrix is sent as mat3 matrix followed by vec3 // offset, then packed into a mat4 where the last row is // the offset and extra values are 0 for (size_t i = 0 ; i < 4; i++) { for (size_t j = 0; j < 4; j++) { mColorMatrix[i][j] = data.readFloat(); } } } else { mColorMatrix = mat4(); } invalidateHwcGeometry(); repaintEverything(); return NO_ERROR; } // This is an experimental interface // Needs to be shifted to proper binder interface when we productize case 1016: { n = data.readInt32(); mPrimaryDispSync.setRefreshSkipCount(n); return NO_ERROR; } case 1017: { n = data.readInt32(); mForceFullDamage = static_cast<bool>(n); return NO_ERROR; } case 1018: { // Modify Choreographer's phase offset n = data.readInt32(); if (mEventThread != NULL) mEventThread->setPhaseOffset(static_cast<nsecs_t>(n)); return NO_ERROR; } case 1019: { // Modify SurfaceFlinger's phase offset n = data.readInt32(); if (mSFEventThread != NULL) mSFEventThread->setPhaseOffset(static_cast<nsecs_t>(n)); return NO_ERROR; } case 9999: { // Toggle DispSync model n = data.readInt32(); mPrimaryDispSync.setIgnorePresentFences(n); return NO_ERROR; } } } return err; } void SurfaceFlinger::setViewMatrix(float sdkMatrix[]) { memcpy(mFViewMatrix, sdkMatrix,sizeof(mFViewMatrix)); invalidateHwcGeometry(); } void SurfaceFlinger::repaintEverything() { android_atomic_or(1, &mRepaintEverything); signalTransaction(); } int32_t SurfaceFlinger::getServerPort() { if(mTrackerThread!=NULL){ return mTrackerThread->getServerPort(); } return 0; } // --------------------------------------------------------------------------- // Capture screen into an IGraphiBufferProducer // --------------------------------------------------------------------------- /* The code below is here to handle b/8734824 * * We create a IGraphicBufferProducer wrapper that forwards all calls * from the surfaceflinger thread to the calling binder thread, where they * are executed. This allows the calling thread in the calling process to be * reused and not depend on having "enough" binder threads to handle the * requests. */ class GraphicProducerWrapper : public BBinder, public MessageHandler { /* Parts of GraphicProducerWrapper are run on two different threads, * communicating by sending messages via Looper but also by shared member * data. Coherence maintenance is subtle and in places implicit (ugh). * * Don't rely on Looper's sendMessage/handleMessage providing * release/acquire semantics for any data not actually in the Message. * Data going from surfaceflinger to binder threads needs to be * synchronized explicitly. * * Barrier open/wait do provide release/acquire semantics. This provides * implicit synchronization for data coming back from binder to * surfaceflinger threads. */ sp<IGraphicBufferProducer> impl; sp<Looper> looper; status_t result; bool exitPending; bool exitRequested; Barrier barrier; uint32_t code; Parcel const* data; Parcel* reply; enum { MSG_API_CALL, MSG_EXIT }; /* * Called on surfaceflinger thread. This is called by our "fake" * BpGraphicBufferProducer. We package the data and reply Parcel and * forward them to the binder thread. */ virtual status_t transact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t /* flags */) { this->code = code; this->data = &data; this->reply = reply; if (exitPending) { // if we've exited, we run the message synchronously right here. // note (JH): as far as I can tell from looking at the code, this // never actually happens. if it does, i'm not sure if it happens // on the surfaceflinger or binder thread. handleMessage(Message(MSG_API_CALL)); } else { barrier.close(); // Prevent stores to this->{code, data, reply} from being // reordered later than the construction of Message. atomic_thread_fence(memory_order_release); looper->sendMessage(this, Message(MSG_API_CALL)); barrier.wait(); } return result; } /* * here we run on the binder thread. All we've got to do is * call the real BpGraphicBufferProducer. */ virtual void handleMessage(const Message& message) { int what = message.what; // Prevent reads below from happening before the read from Message atomic_thread_fence(memory_order_acquire); if (what == MSG_API_CALL) { result = IInterface::asBinder(impl)->transact(code, data[0], reply); barrier.open(); } else if (what == MSG_EXIT) { exitRequested = true; } } public: GraphicProducerWrapper(const sp<IGraphicBufferProducer>& impl) : impl(impl), looper(new Looper(true)), exitPending(false), exitRequested(false) {} // Binder thread status_t waitForResponse() { do { looper->pollOnce(-1); } while (!exitRequested); return result; } // Client thread void exit(status_t result) { this->result = result; exitPending = true; // Ensure this->result is visible to the binder thread before it // handles the message. atomic_thread_fence(memory_order_release); looper->sendMessage(this, Message(MSG_EXIT)); } }; status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display, const sp<IGraphicBufferProducer>& producer, Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ, bool useIdentityTransform, ISurfaceComposer::Rotation rotation) { if (CC_UNLIKELY(display == 0)) return BAD_VALUE; if (CC_UNLIKELY(producer == 0)) return BAD_VALUE; // if we have secure windows on this display, never allow the screen capture // unless the producer interface is local (i.e.: we can take a screenshot for // ourselves). if (!IInterface::asBinder(producer)->localBinder()) { Mutex::Autolock _l(mStateLock); sp<const DisplayDevice> hw(getDisplayDevice(display)); if (hw->getSecureLayerVisible()) { ALOGW("FB is protected: PERMISSION_DENIED"); return PERMISSION_DENIED; } } // Convert to surfaceflinger's internal rotation type. Transform::orientation_flags rotationFlags; switch (rotation) { case ISurfaceComposer::eRotateNone: rotationFlags = Transform::ROT_0; break; case ISurfaceComposer::eRotate90: rotationFlags = Transform::ROT_90; break; case ISurfaceComposer::eRotate180: rotationFlags = Transform::ROT_180; break; case ISurfaceComposer::eRotate270: rotationFlags = Transform::ROT_270; break; default: rotationFlags = Transform::ROT_0; ALOGE("Invalid rotation passed to captureScreen(): %d\n", rotation); break; } class MessageCaptureScreen : public MessageBase { SurfaceFlinger* flinger; sp<IBinder> display; sp<IGraphicBufferProducer> producer; Rect sourceCrop; uint32_t reqWidth, reqHeight; uint32_t minLayerZ,maxLayerZ; bool useIdentityTransform; Transform::orientation_flags rotation; status_t result; public: MessageCaptureScreen(SurfaceFlinger* flinger, const sp<IBinder>& display, const sp<IGraphicBufferProducer>& producer, Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ, bool useIdentityTransform, Transform::orientation_flags rotation) : flinger(flinger), display(display), producer(producer), sourceCrop(sourceCrop), reqWidth(reqWidth), reqHeight(reqHeight), minLayerZ(minLayerZ), maxLayerZ(maxLayerZ), useIdentityTransform(useIdentityTransform), rotation(rotation), result(PERMISSION_DENIED) { } status_t getResult() const { return result; } virtual bool handler() { Mutex::Autolock _l(flinger->mStateLock); sp<const DisplayDevice> hw(flinger->getDisplayDevice(display)); result = flinger->captureScreenImplLocked(hw, producer, sourceCrop, reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform, rotation); static_cast<GraphicProducerWrapper*>(IInterface::asBinder(producer).get())->exit(result); return true; } }; // make sure to process transactions before screenshots -- a transaction // might already be pending but scheduled for VSYNC; this guarantees we // will handle it before the screenshot. When VSYNC finally arrives // the scheduled transaction will be a no-op. If no transactions are // scheduled at this time, this will end-up being a no-op as well. mEventQueue.invalidateTransactionNow(); // this creates a "fake" BBinder which will serve as a "fake" remote // binder to receive the marshaled calls and forward them to the // real remote (a BpGraphicBufferProducer) sp<GraphicProducerWrapper> wrapper = new GraphicProducerWrapper(producer); // the asInterface() call below creates our "fake" BpGraphicBufferProducer // which does the marshaling work forwards to our "fake remote" above. sp<MessageBase> msg = new MessageCaptureScreen(this, display, IGraphicBufferProducer::asInterface( wrapper ), sourceCrop, reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform, rotationFlags); status_t res = postMessageAsync(msg); if (res == NO_ERROR) { res = wrapper->waitForResponse(); } return res; } void SurfaceFlinger::renderScreenImplLocked( const sp<const DisplayDevice>& hw, Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ, bool yswap, bool useIdentityTransform, Transform::orientation_flags rotation) { ATRACE_CALL(); RenderEngine& engine(getRenderEngine()); // get screen geometry const int32_t hw_w = hw->getWidth(); const int32_t hw_h = hw->getHeight(); const bool filtering = static_cast<int32_t>(reqWidth) != hw_w || static_cast<int32_t>(reqHeight) != hw_h; // if a default or invalid sourceCrop is passed in, set reasonable values if (sourceCrop.width() == 0 || sourceCrop.height() == 0 || !sourceCrop.isValid()) { sourceCrop.setLeftTop(Point(0, 0)); sourceCrop.setRightBottom(Point(hw_w, hw_h)); } // ensure that sourceCrop is inside screen if (sourceCrop.left < 0) { ALOGE("Invalid crop rect: l = %d (< 0)", sourceCrop.left); } if (sourceCrop.right > hw_w) { ALOGE("Invalid crop rect: r = %d (> %d)", sourceCrop.right, hw_w); } if (sourceCrop.top < 0) { ALOGE("Invalid crop rect: t = %d (< 0)", sourceCrop.top); } if (sourceCrop.bottom > hw_h) { ALOGE("Invalid crop rect: b = %d (> %d)", sourceCrop.bottom, hw_h); } // make sure to clear all GL error flags engine.checkErrors(); if (DisplayDevice::DISPLAY_PRIMARY == hw->getDisplayType()) { rotation = (Transform::orientation_flags) (rotation ^ hw->getPanelMountFlip()); } // set-up our viewport engine.setViewportAndProjection( reqWidth, reqHeight, sourceCrop, hw_h, yswap, rotation); engine.disableTexturing(); // redraw the screen entirely... engine.clearWithColor(0, 0, 0, 1); const LayerVector& layers( mDrawingState.layersSortedByZ ); const size_t count = layers.size(); for (size_t i=0 ; i<count ; ++i) { const sp<Layer>& layer(layers[i]); const Layer::State& state(layer->getDrawingState()); if (state.layerStack == hw->getLayerStack()) { if (state.z >= minLayerZ && state.z <= maxLayerZ) { if (canDrawLayerinScreenShot(hw,layer)) { if (filtering) layer->setFiltering(true); layer->draw(hw, useIdentityTransform); if (filtering) layer->setFiltering(false); } } } } // compositionComplete is needed for older driver hw->compositionComplete(); hw->setViewportAndProjection(); } status_t SurfaceFlinger::captureScreenImplLocked( const sp<const DisplayDevice>& hw, const sp<IGraphicBufferProducer>& producer, Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, uint32_t minLayerZ, uint32_t maxLayerZ, bool useIdentityTransform, Transform::orientation_flags rotation) { ATRACE_CALL(); // get screen geometry uint32_t hw_w = hw->getWidth(); uint32_t hw_h = hw->getHeight(); if (rotation & Transform::ROT_90) { std::swap(hw_w, hw_h); } if ((reqWidth > hw_w) || (reqHeight > hw_h)) { ALOGE("size mismatch (%d, %d) > (%d, %d)", reqWidth, reqHeight, hw_w, hw_h); return BAD_VALUE; } reqWidth = (!reqWidth) ? hw_w : reqWidth; reqHeight = (!reqHeight) ? hw_h : reqHeight; // create a surface (because we're a producer, and we need to // dequeue/queue a buffer) sp<Surface> sur = new Surface(producer, false); ANativeWindow* window = sur.get(); status_t result = native_window_api_connect(window, NATIVE_WINDOW_API_EGL); if (result == NO_ERROR) { uint32_t usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE; int err = 0; err = native_window_set_buffers_dimensions(window, reqWidth, reqHeight); err |= native_window_set_scaling_mode(window, NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW); err |= native_window_set_buffers_format(window, HAL_PIXEL_FORMAT_RGBA_8888); err |= native_window_set_usage(window, usage); if (err == NO_ERROR) { ANativeWindowBuffer* buffer; /* TODO: Once we have the sync framework everywhere this can use * server-side waits on the fence that dequeueBuffer returns. */ result = native_window_dequeue_buffer_and_wait(window, &buffer); if (result == NO_ERROR) { int syncFd = -1; // create an EGLImage from the buffer so we can later // turn it into a texture EGLImageKHR image = eglCreateImageKHR(mEGLDisplay, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, buffer, NULL); if (image != EGL_NO_IMAGE_KHR) { // this binds the given EGLImage as a framebuffer for the // duration of this scope. RenderEngine::BindImageAsFramebuffer imageBond(getRenderEngine(), image); if (imageBond.getStatus() == NO_ERROR) { // this will in fact render into our dequeued buffer // via an FBO, which means we didn't have to create // an EGLSurface and therefore we're not // dependent on the context's EGLConfig. renderScreenImplLocked( hw, sourceCrop, reqWidth, reqHeight, minLayerZ, maxLayerZ, true, useIdentityTransform, rotation); // Attempt to create a sync khr object that can produce a sync point. If that // isn't available, create a non-dupable sync object in the fallback path and // wait on it directly. EGLSyncKHR sync; if (!DEBUG_SCREENSHOTS) { sync = eglCreateSyncKHR(mEGLDisplay, EGL_SYNC_NATIVE_FENCE_ANDROID, NULL); // native fence fd will not be populated until flush() is done. getRenderEngine().flush(); } else { sync = EGL_NO_SYNC_KHR; } if (sync != EGL_NO_SYNC_KHR) { // get the sync fd syncFd = eglDupNativeFenceFDANDROID(mEGLDisplay, sync); if (syncFd == EGL_NO_NATIVE_FENCE_FD_ANDROID) { ALOGW("captureScreen: failed to dup sync khr object"); syncFd = -1; } eglDestroySyncKHR(mEGLDisplay, sync); } else { // fallback path sync = eglCreateSyncKHR(mEGLDisplay, EGL_SYNC_FENCE_KHR, NULL); if (sync != EGL_NO_SYNC_KHR) { EGLint result = eglClientWaitSyncKHR(mEGLDisplay, sync, EGL_SYNC_FLUSH_COMMANDS_BIT_KHR, 2000000000 /*2 sec*/); EGLint eglErr = eglGetError(); if (result == EGL_TIMEOUT_EXPIRED_KHR) { ALOGW("captureScreen: fence wait timed out"); } else { ALOGW_IF(eglErr != EGL_SUCCESS, "captureScreen: error waiting on EGL fence: %#x", eglErr); } eglDestroySyncKHR(mEGLDisplay, sync); } else { ALOGW("captureScreen: error creating EGL fence: %#x", eglGetError()); } } if (DEBUG_SCREENSHOTS) { uint32_t* pixels = new uint32_t[reqWidth*reqHeight]; getRenderEngine().readPixels(0, 0, reqWidth, reqHeight, pixels); checkScreenshot(reqWidth, reqHeight, reqWidth, pixels, hw, minLayerZ, maxLayerZ); delete [] pixels; } } else { ALOGE("got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot"); result = INVALID_OPERATION; } // destroy our image eglDestroyImageKHR(mEGLDisplay, image); } else { result = BAD_VALUE; } // queueBuffer takes ownership of syncFd result = window->queueBuffer(window, buffer, syncFd); } } else { result = BAD_VALUE; } native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL); } return result; } void SurfaceFlinger::checkScreenshot(size_t w, size_t s, size_t h, void const* vaddr, const sp<const DisplayDevice>& hw, uint32_t minLayerZ, uint32_t maxLayerZ) { if (DEBUG_SCREENSHOTS) { for (size_t y=0 ; y<h ; y++) { uint32_t const * p = (uint32_t const *)vaddr + y*s; for (size_t x=0 ; x<w ; x++) { if (p[x] != 0xFF000000) return; } } ALOGE("*** we just took a black screenshot ***\n" "requested minz=%d, maxz=%d, layerStack=%d", minLayerZ, maxLayerZ, hw->getLayerStack()); const LayerVector& layers( mDrawingState.layersSortedByZ ); const size_t count = layers.size(); for (size_t i=0 ; i<count ; ++i) { const sp<Layer>& layer(layers[i]); const Layer::State& state(layer->getDrawingState()); const bool visible = (state.layerStack == hw->getLayerStack()) && (state.z >= minLayerZ && state.z <= maxLayerZ) && (layer->isVisible()); ALOGE("%c index=%zu, name=%s, layerStack=%d, z=%d, visible=%d, flags=%x, alpha=%x", visible ? '+' : '-', i, layer->getName().string(), state.layerStack, state.z, layer->isVisible(), state.flags, state.alpha); } } } /* ------------------------------------------------------------------------ * Extensions */ bool SurfaceFlinger::updateLayerVisibleNonTransparentRegion(const int& /*dpy*/, const sp<Layer>& layer, bool& /*bIgnoreLayers*/, int& /*indexLOI*/, uint32_t layerStack, const int& /*i*/) { const Layer::State& s(layer->getDrawingState()); // only consider the layers on the given layer stack if (s.layerStack != layerStack) { /* set the visible region as empty since we have removed the * layerstack check in rebuildLayerStack() function */ Region visibleNonTransRegion; visibleNonTransRegion.set(Rect(0,0)); layer->setVisibleNonTransparentRegion(visibleNonTransRegion); return true; } return false; } bool SurfaceFlinger::canDrawLayerinScreenShot( const sp<const DisplayDevice>& /*hw*/, const sp<Layer>& layer) { return layer->isVisible(); } void SurfaceFlinger::drawWormHoleIfRequired(HWComposer::LayerListIterator& /*cur*/, const HWComposer::LayerListIterator& /*end*/, const sp<const DisplayDevice>& hw, const Region& region) { drawWormhole(hw, region); } // --------------------------------------------------------------------------- SurfaceFlinger::LayerVector::LayerVector() { } SurfaceFlinger::LayerVector::LayerVector(const LayerVector& rhs) : SortedVector<sp<Layer> >(rhs) { } int SurfaceFlinger::LayerVector::do_compare(const void* lhs, const void* rhs) const { // sort layers per layer-stack, then by z-order and finally by sequence const sp<Layer>& l(*reinterpret_cast<const sp<Layer>*>(lhs)); const sp<Layer>& r(*reinterpret_cast<const sp<Layer>*>(rhs)); uint32_t ls = l->getCurrentState().layerStack; uint32_t rs = r->getCurrentState().layerStack; if (ls != rs) return ls - rs; uint32_t lz = l->getCurrentState().z; uint32_t rz = r->getCurrentState().z; if (lz != rz) return lz - rz; return l->sequence - r->sequence; } // --------------------------------------------------------------------------- SurfaceFlinger::DisplayDeviceState::DisplayDeviceState() : type(DisplayDevice::DISPLAY_ID_INVALID), width(0), height(0) { } SurfaceFlinger::DisplayDeviceState::DisplayDeviceState(DisplayDevice::DisplayType type) : type(type), layerStack(DisplayDevice::NO_LAYER_STACK), orientation(0), width(0), height(0) { viewport.makeInvalid(); frame.makeInvalid(); } // --------------------------------------------------------------------------- }; // namespace android #if defined(__gl_h_) #error "don't include gl/gl.h in this file" #endif #if defined(__gl2_h_) #error "don't include gl2/gl2.h in this file" #endif
[ "wangjianfeng@baofeng.com" ]
wangjianfeng@baofeng.com
6165a97d0b7526c33a14c6731db557c6067e3a55
ae99db8a12c4e22a6e844100144babc5f452a152
/DSA/Leetcode/13.cc
39549a31e80829bcba3b80e857cfbef4e3eafff3
[ "MIT" ]
permissive
zhmz90/Lan
6d7591344029b80e16c39b41cddce500bcf32418
d7bb1b38ecb5a082276efaafdadca8d9700fbc27
refs/heads/master
2021-01-21T12:53:58.281744
2017-07-21T11:54:45
2017-07-21T11:54:45
48,616,087
0
0
null
null
null
null
UTF-8
C++
false
false
1,384
cc
/** 13. Roman to Integer Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. */ #include <iostream> #include <unordered_map> #include <stdexcept> using namespace std; class Solution { public: int romanToInt(string s) { if (s.length()==0) return 0; if (s.length() == 1) return getInt(s.begin()); auto prev=s.begin(),curr=s.begin()+1,end=s.end(); int ret=0; int prev_num=0,curr_num=0; prev_num = getInt(prev); ret = prev_num; while (curr != end){ // cout<<ret<<"--"; curr_num = getInt(curr); if (prev_num < curr_num){ ret -= prev_num; ret += curr_num-prev_num; } else{ ret += curr_num; } prev_num = curr_num; curr++; } return ret; } int getInt(string::iterator p ){ auto got = map.find(*p); if (got != map.end()) return got->second; throw invalid_argument("string not in roman list"); return 0; } Solution():map{{{'I',1},{'V',5},{'X',10},{'L',50},{'C',100},{'D',500},{'M',1000}}}{} private: const unordered_map<char, int> map; }; int main(){ Solution solu; string str; for (auto str: {"I","V","IV","DC","MCMXCVI"}){// 1000 + 1000-100 + 100-10+5+1 int ret = solu.romanToInt(str); cout<<"str:"<<str<<"--"<<"Int:"<<ret<<endl; } return 0; }
[ "zhmz90@gmail.com" ]
zhmz90@gmail.com
0f9c123cdc889efeb88da2d980f04f6dfc977d0a
55d560fe6678a3edc9232ef14de8fafd7b7ece12
/libs/test/test/test-organization-ts/datasets-test/implicit-test.cpp
b039ab02bac16d9014543ca6cf0913153fa93d6e
[ "BSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
stardog-union/boost
ec3abeeef1b45389228df031bf25b470d3d123c5
caa4a540db892caa92e5346e0094c63dea51cbfb
refs/heads/stardog/develop
2021-06-25T02:15:10.697006
2020-11-17T19:50:35
2020-11-17T19:50:35
148,681,713
0
0
BSL-1.0
2020-11-17T19:50:36
2018-09-13T18:38:54
C++
UTF-8
C++
false
false
2,701
cpp
// (C) Copyright Gennadiy Rozental 2011-2015. // 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) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision$ // // Description : tests implicit interfaces // *************************************************************************** // Boost.Test #include <boost/test/unit_test.hpp> #include <boost/test/data/monomorphic.hpp> #include <boost/test/data/for_each_sample.hpp> namespace data=boost::unit_test::data; #include "datasets-test.hpp" //____________________________________________________________________________// BOOST_AUTO_TEST_CASE( test_implicit_for_each ) { data::for_each_sample( 2, check_arg_type<int>() ); data::for_each_sample( "ch", check_arg_type<char const*>() ); data::for_each_sample( 2., check_arg_type<double>() ); data::for_each_sample( std::vector<int>( 3 ), check_arg_type<int>() ); data::for_each_sample( std::list<double>( 2 ), check_arg_type<double>() ); invocation_count ic; ic.m_value = 0; data::for_each_sample( std::vector<int>( 3 ), ic ); BOOST_TEST( ic.m_value == 3 ); ic.m_value = 0; data::for_each_sample( std::list<double>( 2 ), ic, 1 ); BOOST_TEST( ic.m_value == 1 ); std::vector<copy_count> samples1( 2 ); copy_count::value() = 0; // we do not test the construction of the vector data::for_each_sample( samples1, check_arg_type<copy_count>() ); BOOST_TEST( copy_count::value() == 0 ); copy_count::value() = 0; copy_count samples2[] = { copy_count(), copy_count() }; data::for_each_sample( samples2, check_arg_type<copy_count>() ); BOOST_TEST( copy_count::value() == 0 ); } //____________________________________________________________________________// BOOST_AUTO_TEST_CASE( test_implicit_join ) { auto ds = data::make( 5 ); BOOST_TEST( (1 + ds).size() == 2 ); BOOST_TEST( (ds + 1).size() == 2 ); BOOST_TEST( (1 + data::make( 5 )).size() == 2 ); BOOST_TEST( (data::make( 5 ) + 1).size() == 2 ); } //____________________________________________________________________________// BOOST_AUTO_TEST_CASE( test_implicit_zip ) { auto ds = data::make( 5 ); BOOST_TEST( (1 ^ ds).size() == 1 ); BOOST_TEST( (ds ^ 1).size() == 1 ); BOOST_TEST( (1 ^ data::make( 5 )).size() == 1 ); BOOST_TEST( (data::make( 5 ) ^ 1).size() == 1 ); } //____________________________________________________________________________// // EOF
[ "james.pack@stardog.com" ]
james.pack@stardog.com
b4592c04d5b3ef007b1f2b3aa08ce6043a156128
ca8d391aeccd96865491d117fa07bf79d0bf7569
/bluetooth.ino
ba523deb5c171598369f3db140f78a82132f99c8
[]
no_license
ahad14017/bluetooth-object-finder
288f2cd300410571073f8f5275029cf1edbfd53a
248dab642e81917c97e1c0a40d32d0a426565706
refs/heads/main
2023-08-23T18:53:12.207230
2021-09-30T10:01:55
2021-09-30T10:01:55
412,011,627
0
0
null
null
null
null
UTF-8
C++
false
false
362
ino
void setup() { pinMode(4,OUTPUT); Serial.begin(9600); } void loop() { if(Serial.available()>0) { int data = Serial.read(); Serial.println(data); switch(data) { case 49: tone(4,523); break; case 50: noTone(4); break; } } }
[ "imranraz92@gmail.com" ]
imranraz92@gmail.com
015d7966f536986bd1c58c8fde1f2e9857735fe7
3af0a15b5bef3e77dd5e1955a7b14a8b0573c48d
/LeetCode/Sort List/main.cpp
057691674cf2fc7cf8a150bfb2e02e010ef7b2bc
[]
no_license
tinglai/Algorithm-Practice
7ef98585e52585d6deed92e669c3af767d3e8033
e51831e43e00e935d19e2a8ca934eede9d1f6367
refs/heads/master
2021-01-25T10:29:19.107639
2015-06-02T13:09:04
2015-06-02T13:09:04
25,283,963
0
0
null
null
null
null
UTF-8
C++
false
false
2,178
cpp
#include <iostream> using namespace std; struct ListNode{ int val; ListNode *next; ListNode(int x) : val(x), next(NULL){} }; class Solution{ public: ListNode *sortList(ListNode *head){ int size = 0; ListNode* itr = head; while(itr){ size++; itr = itr->next; } if(size <= 1) return head; head = help(head); return head; } ListNode* help(ListNode* head){ if(head == NULL) return NULL; int size = 0; ListNode* itr = head; while(itr){ size++; itr = itr->next; } if(size <= 1) return head; ListNode* second = divide(head); head = help(head); second = help(second); head = merge(head, second); return head; } ListNode* divide(ListNode* head){ if(head == NULL) return NULL; if(head->next == NULL) return head; ListNode* fast = head->next; ListNode* slow = head; while(fast && fast->next){ fast = fast->next->next; slow = slow->next; } ListNode* toReturn = slow->next; slow->next = NULL; return toReturn; } ListNode* merge(ListNode* head1, ListNode* head2){ if(head2 == NULL) return head1; ListNode* head; ListNode *itr1, *itr2; if(head1->val < head2->val){ head = head1; itr1 = head1->next; itr2 = head2; } else{ head = head2; itr1 = head1; itr2 = head2->next; } ListNode* itr = head; while(itr1 && itr2){ if(itr1->val < itr2->val){ itr->next = itr1; itr = itr->next; itr1 = itr1->next; } else{ itr->next = itr2; itr = itr->next; itr2 = itr2->next; } } while(itr1){ itr->next = itr1; itr = itr->next; itr1 = itr1->next; } while(itr2){ itr->next = itr2; itr = itr->next; itr2 = itr2->next; } return head; } }; int main(){ ListNode* n1 = new ListNode(2); ListNode* n2 = new ListNode(4); ListNode* n3 = new ListNode(5); ListNode* n4 = new ListNode(7); ListNode* n5 = new ListNode(3); ListNode* n6 = new ListNode(1); ListNode* n7 = new ListNode(6); n1->next = n2; n2->next = n3; n3->next = n4; n4->next = n5; n5->next = n6; n6->next = n7; Solution soln; ListNode* head = soln.sortList(n1); while(head){ cout << head->val << " "; head = head->next; } cout << endl; }
[ "laiting@umich.edu" ]
laiting@umich.edu
992ca09f614de8e3c1fa69eebfa6f002d962d22b
ed444c4a0ed1fe679da64b81ec6aa1ddf885a185
/Foundation/Render/3d/Shape/MultiFaceCube.cpp
fd8fdb580e0e86ad32a315eaac80c088ecc29297
[]
no_license
swaphack/CodeLib
54e07db129d38be0fd55504ef917bbe522338aa6
fff8ed54afc334e1ff5e3dd34ec5cfcf6ce7bdc9
refs/heads/master
2022-05-16T20:31:45.123321
2022-05-12T03:38:45
2022-05-12T03:38:45
58,099,874
1
0
null
2016-05-11T09:46:07
2016-05-05T02:57:24
C++
UTF-8
C++
false
false
2,552
cpp
#include "MultiFaceCube.h" #include "Common/Texture/Texture.h" #include "Common/Tool/VertexTool.h" #include "Common/DrawNode/import.h" #include "Common/Mesh/import.h" #include "Common/Material/import.h" #include "Common/DrawNode/DrawTextureCache.h" using namespace render; MultiFaceCube::MultiFaceCube() { } MultiFaceCube::~MultiFaceCube() { } bool MultiFaceCube::init() { if (!MultiMeshModel::init()) { return false; } return true; } void render::MultiFaceCube::setFaceTexture(CubeFace face, const std::string& filepath) { int i = (int)face; std::string name = CubeFaceString[i]; _textureCache->addTexture(name, filepath); } void render::MultiFaceCube::setLeftTexture(const std::string& filepath) { this->setFaceTexture(CubeFace::LEFT, filepath); } void render::MultiFaceCube::setRightTexture(const std::string& filepath) { this->setFaceTexture(CubeFace::RIGHT, filepath); } void render::MultiFaceCube::setBottomTexture(const std::string& filepath) { this->setFaceTexture(CubeFace::BOTTOM, filepath); } void render::MultiFaceCube::setTopTexture(const std::string& filepath) { this->setFaceTexture(CubeFace::TOP, filepath); } void render::MultiFaceCube::setFrontTexture(const std::string& filepath) { this->setFaceTexture(CubeFace::FRONT, filepath); } void render::MultiFaceCube::setBackTexture(const std::string& filepath) { this->setFaceTexture(CubeFace::BACK, filepath); } void render::MultiFaceCube::setAllFacesTexture(const std::string& filepath) { for (int i = 0; i < (int)CubeFace::MAX; i++) { setFaceTexture((CubeFace)i, filepath); } } void render::MultiFaceCube::initBufferObject() { for (int i = 0; i < (int)CubeFace::MAX; i++) { std::string name = CubeFaceString[i]; auto pMat = CREATE_OBJECT(sys::MaterialDetail); _materiales->addMaterial(name, pMat); auto pMesh = CREATE_OBJECT(sys::MeshDetail); _meshes->addMesh(name, pMesh); pMesh->setMaterialName(name); CubeFace face = (CubeFace)i; pMesh->setUVs(4, _localCubeVertex.getFaceVertex((CubeFace)i)->uvs, 2); pMesh->setIndices(6, _localCubeVertex.getFaceVertex((CubeFace)i)->indices, 1); pMesh->setColors(4, _localCubeVertex.getFaceVertex((CubeFace)i)->colors, 4); } } void render::MultiFaceCube::updateMultiDrawNode3DMesh() { for (int i = 0; i < (int)CubeFace::MAX; i++) { std::string name = CubeFaceString[i]; auto pMesh = _meshes->getMesh(name); if (!pMesh) { return; } CubeFace face = (CubeFace)i; pMesh->setVertices(4, _localCubeVertex.getFaceVertex(face)->vertices, 3); } this->updateMeshData(); }
[ "809406730@qq.com" ]
809406730@qq.com
25b0f0117f15549b71635d08d73011eb338b2331
7102140a692cd0a4584728f87176b9ac80538963
/src/qt/eMarkgui.h
5b3104b45a6fc24c24ef20de7612a87d64042435
[ "MIT" ]
permissive
chris2286266/eMarkTest
7bb98c5cf2acd0828048a106d347e37a764f810a
f6cad1addae0d8064a421ce34eae2a7a62289c38
refs/heads/master
2020-04-06T06:58:33.040353
2014-03-20T11:15:18
2014-03-20T11:15:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,899
h
#ifndef EMARKGUI_H #define EMARKGUI_H #include <QMainWindow> #include <QSystemTrayIcon> class TransactionTableModel; class ClientModel; class WalletModel; class TransactionView; class OverviewPage; class AddressBookPage; class SendCoinsDialog; class SignVerifyMessageDialog; class Notificator; class RPCConsole; QT_BEGIN_NAMESPACE class QLabel; class QLineEdit; class QTableView; class QAbstractItemModel; class QModelIndex; class QProgressBar; class QStackedWidget; class QUrl; QT_END_NAMESPACE /** eMark GUI main class. This class represents the main window of the eMark UI. It communicates with both the client and wallet models to give the user an up-to-date view of the current core state. */ class eMarkGUI : public QMainWindow { Q_OBJECT public: explicit eMarkGUI(QWidget *parent = 0); ~eMarkGUI(); /** Set the client model. The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic. */ void setClientModel(ClientModel *clientModel); /** Set the wallet model. The wallet model represents a eMark wallet, and offers access to the list of transactions, address book and sending functionality. */ void setWalletModel(WalletModel *walletModel); protected: void changeEvent(QEvent *e); void closeEvent(QCloseEvent *event); void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); private: ClientModel *clientModel; WalletModel *walletModel; QStackedWidget *centralWidget; OverviewPage *overviewPage; QWidget *transactionsPage; AddressBookPage *addressBookPage; AddressBookPage *receiveCoinsPage; SendCoinsDialog *sendCoinsPage; SignVerifyMessageDialog *signVerifyMessageDialog; QLabel *labelEncryptionIcon; QLabel *labelConnectionsIcon; QLabel *labelBlocksIcon; QLabel *progressBarLabel; QProgressBar *progressBar; QMenuBar *appMenuBar; QAction *overviewAction; QAction *historyAction; QAction *quitAction; QAction *sendCoinsAction; QAction *addressBookAction; QAction *signMessageAction; QAction *verifyMessageAction; QAction *aboutAction; QAction *receiveCoinsAction; QAction *optionsAction; QAction *toggleHideAction; QAction *exportAction; QAction *encryptWalletAction; QAction *backupWalletAction; QAction *changePassphraseAction; QAction *aboutQtAction; QAction *openRPCConsoleAction; QSystemTrayIcon *trayIcon; Notificator *notificator; TransactionView *transactionView; RPCConsole *rpcConsole; QMovie *syncIconMovie; /** Create the main UI actions. */ void createActions(); /** Create the menu bar and sub-menus. */ void createMenuBar(); /** Create the toolbars */ void createToolBars(); /** Create system tray (notification) icon */ void createTrayIcon(); public slots: /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set number of blocks shown in the UI */ void setNumBlocks(int count, int nTotalBlocks); /** Set the encryption status as shown in the UI. @param[in] status current encryption status @see WalletModel::EncryptionStatus */ void setEncryptionStatus(int status); /** Notify the user of an error in the network or transaction handling code. */ void error(const QString &title, const QString &message, bool modal); /** Asks the user whether to pay the transaction fee or to cancel the transaction. It is currently not possible to pass a return value to another thread through BlockingQueuedConnection, so an indirected pointer is used. https://bugreports.qt-project.org/browse/QTBUG-10440 @param[in] nFeeRequired the required fee @param[out] payFee true to pay the fee, false to not pay the fee */ void askFee(qint64 nFeeRequired, bool *payFee); void handleURI(QString strURI); private slots: /** Switch to overview (home) page */ void gotoOverviewPage(); /** Switch to history (transactions) page */ void gotoHistoryPage(); /** Switch to address book page */ void gotoAddressBookPage(); /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ void gotoSendCoinsPage(); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); /** Show Sign/Verify Message dialog and switch to verify message tab */ void gotoVerifyMessageTab(QString addr = ""); /** Show configuration dialog */ void optionsClicked(); /** Show about dialog */ void aboutClicked(); #ifndef Q_OS_MAC /** Handle tray icon clicked */ void trayIconActivated(QSystemTrayIcon::ActivationReason reason); #endif /** Show incoming transaction notification for new transactions. The new items are those between start and end inclusive, under the given parent item. */ void incomingTransaction(const QModelIndex & parent, int start, int end); /** Encrypt the wallet */ void encryptWallet(bool status); /** Backup the wallet */ void backupWallet(); /** Change encrypted wallet passphrase */ void changePassphrase(); /** Ask for passphrase to unlock wallet temporarily */ void unlockWallet(); /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */ void showNormalIfMinimized(bool fToggleHidden = false); /** simply calls showNormalIfMinimized(true) for use in SLOT() macro */ void toggleHidden(); }; #endif
[ "c2@localhost.localdomain" ]
c2@localhost.localdomain
e22001fa72c31972bd27f338b1a0917e607f364c
c51064f0e88a44339d3f4ea729bad3e2df4cd336
/cpp/tests/integration/fixtures/MockKeyStore.cpp
0d14a946c4b39c56763b706ec9457c2982dfc8ce
[]
no_license
ssp21/ssp21-cpp
219e0da72d5d9a8bf4a0cc4a25e22dcdb3a9ad81
90e111a8e369ce44276824e4abec66e6a83927e6
refs/heads/master
2021-07-17T03:47:50.888364
2020-10-09T18:14:02
2020-10-09T18:14:02
65,405,723
3
2
null
2021-04-26T18:58:41
2016-08-10T18:13:40
C++
UTF-8
C++
false
false
763
cpp
#include "MockKeyStore.h" namespace ssp21 { std::shared_ptr<const SymmetricKey> MockKeyStore::find_and_consume_key(uint64_t key_id) { if (this->current_key) { if (key_id != this->current_key->id) return nullptr; const auto key = this->current_key->key; this->current_key.reset(); return key; } else { return nullptr; } } std::shared_ptr<const KeyRecord> MockKeyStore::consume_key() { SymmetricKey key_data; { auto dest = key_data.as_wseq(); Crypto::gen_random(dest); key_data.set_length(BufferLength::length_32); } this->current_key = std::make_shared<KeyRecord>(this->key_id, key_data.as_seq()); ++(this->key_id); return this->current_key; } }
[ "jadamcrain@gmail.com" ]
jadamcrain@gmail.com
9bd82174cb6ed96853a2f9210aa735a43bbf48de
d205793571b39fe254f513f4437f37c47f4db011
/src/CubeFace.cpp
098223986d80d605f1194ec9c7e4c3be2ef3d4f7
[]
no_license
memanuel/kepler-sieve
ba996c4008edec3458ac0afbfa3bee95367467cd
9f11f377d82cb941d77159fd7b97ae2300b6ca6a
refs/heads/main
2021-11-22T19:07:13.725263
2021-08-08T20:44:47
2021-08-08T20:44:47
236,581,914
1
0
null
null
null
null
UTF-8
C++
false
false
9,516
cpp
/** @file CubeFace.cpp * @brief Implmentation of CubeFace class. * * @author Michael S. Emanuel * @date 2021-06-24 */ // ***************************************************************************** // Included files #include "CubeFace.hpp" using ks::CubeFace; // ***************************************************************************** // Instantiate exception for a bad CubeFaceID namespace ks{ //*Error condition for a bad cube face; must be in range [0, 6). range_error err_cube_face_id = range_error("CubeFace id must be between 0 and 5, inclusive.\n"); } using ks::err_cube_face_id; // ***************************************************************************** /** Initialize a CubeFace from its ID; starts from 0.*/ CubeFace::CubeFace(int8_t id_) : id {id_} { if ((id_ < 0) || (id_ > 5)) {throw err_cube_face_id;} } // ***************************************************************************** /** Default destructor for CubeFace.*/ CubeFace::~CubeFace() {} // ***************************************************************************** const string CubeFace::str() const { switch (id) { case 0: return string("Z+"); // Face Z+; trio (u, v, w) = (X, Y, Z) case 1: return string("Y+"); // Face Y+; trio (u, v, w) = (Z, X, Y) case 2: return string("X+"); // Face X+; trio (u, v, w) = (Y, Z, X) case 3: return string("X-"); // Face X-; trio (u, v, w) = (Y, Z, X) case 4: return string("Y-"); // Face Y-; trio (u, v, w) = (Z, X, Y) case 5: return string("Z-"); // Face Z-; trio (u, v, w) = (X, Y, Z) default: throw err_cube_face_id; } } // ***************************************************************************** const string CubeFace::description() const { switch (id) { case 0: return string("Face Z+; trio (u, v, w) = (X, Y, Z)"); case 1: return string("Face Y+; trio (u, v, w) = (Z, X, Y)"); case 2: return string("Face X+; trio (u, v, w) = (Y, Z, X)"); case 3: return string("Face X-; trio (u, v, w) = (Y, Z, X)"); case 4: return string("Face Y-; trio (u, v, w) = (Z, X, Y)"); case 5: return string("Face Z-; trio (u, v, w) = (X, Y, Z)"); default: throw err_cube_face_id; } } // ***************************************************************************** const int CubeFace::k1() const { switch (id) { case 0: return 1; // Face Z+; (X, Y, Z); alpha=X case 1: return 3; // Face Y+; (Z, X, Y); alpha=Z case 2: return 2; // Face X+; (Y, Z, X); alpha=Y case 3: return 2; // Face X-; (Y, Z, X); alpha=Y case 4: return 3; // Face Y-; (Z, X, Y); alpha=Z case 5: return 1; // Face Z-; (X, Y, Z); alpha=X default: throw err_cube_face_id; } } // ***************************************************************************** const int CubeFace::k2() const { switch (id) { case 0: return 2; // Face Z+; (X, Y, Z); beta=Y case 1: return 1; // Face Y+; (Z, X, Y); beta=X case 2: return 3; // Face X+; (Y, Z, X); beta=Z case 3: return 3; // Face X-; (Y, Z, X); beta=Z case 4: return 1; // Face Y-; (Z, X, Y); beta=X case 5: return 2; // Face Z-; (X, Y, Z); beta=X default: throw err_cube_face_id; } } // ***************************************************************************** const int CubeFace::k3() const { switch (id) { case 0: return 3; // Face Z+; (X, Y, Z); gamma=Z case 1: return 2; // Face Y+; (Z, X, Y); gamma=Y case 2: return 1; // Face X+; (Y, Z, X); gamma=X case 3: return 1; // Face X-; (Y, Z, X); gamma=X case 4: return 2; // Face Y-; (Z, X, Y); gamma=Y case 5: return 3; // Face Z-; (X, Y, Z); gamma=Z default: throw err_cube_face_id; } } // ***************************************************************************** // Get a string label from an integer index by adding the index to the letter before (X, Y, Z), i.e. 'W' constexpr int label_base = static_cast<int>('W'); // ***************************************************************************** const char CubeFace::alpha() const { return static_cast<const char>(label_base + k1()); } // ***************************************************************************** const char CubeFace::beta() const { return static_cast<const char>(label_base + k2()); } // ***************************************************************************** const char CubeFace::gamma() const { return static_cast<const char>(label_base + k3()); } // ***************************************************************************** const int CubeFace::index_x() const { switch (id) { case 0: return 1; // Face Z+; (X, Y, Z); case 1: return 2; // Face Y+; (Z, X, Y); case 2: return 3; // Face X+; (Y, Z, X); case 3: return 3; // Face X-; (Y, Z, X); case 4: return 2; // Face Y-; (Z, X, Y); case 5: return 1; // Face Z-; (X, Y, Z); default: throw err_cube_face_id; } } // ***************************************************************************** const int CubeFace::index_y() const { switch (id) { case 0: return 2; // Face Z+; (X, Y, Z); case 1: return 3; // Face Y+; (Z, X, Y); case 2: return 1; // Face X+; (Y, Z, X); case 3: return 1; // Face X-; (Y, Z, X); case 4: return 3; // Face Y-; (Z, X, Y); case 5: return 2; // Face Z-; (X, Y, Z); default: throw err_cube_face_id; } } // ***************************************************************************** const int CubeFace::index_z() const { switch (id) { case 0: return 3; // Face Z+; (X, Y, Z); case 1: return 1; // Face Y+; (Z, X, Y); case 2: return 2; // Face X+; (Y, Z, X); case 3: return 2; // Face X-; (Y, Z, X); case 4: return 1; // Face Y-; (Z, X, Y); case 5: return 3; // Face Z-; (X, Y, Z); default: throw err_cube_face_id; } } // ***************************************************************************** const double CubeFace::c() const { switch (id) { case 0: return 1.0; // Face Z+ case 1: return 1.0; // Face Y+ case 2: return 1.0; // Face X+ case 3: return -1.0; // Face X- case 4: return -1.0; // Face Y_ case 5: return -1.0; // Face Z_ default: throw err_cube_face_id; } } // ***************************************************************************** const CubeFace CubeFace::neighbor_i0() const { switch (id) { case 0: return 3; // Z+; (X, Y, Z); neighbor X- case 1: return 5; // Y+; (Z, X, Y); neighbor Z- case 2: return 4; // X+; (Y, Z, X); neighbor Y- case 3: return 4; // X-; (Y, Z, X); neighbor Y- case 4: return 5; // Y-; (Z, X, Y); neighbor Z- case 5: return 3; // Z-; (X, Y, Z); neighbor X- default: throw err_cube_face_id; } } // ***************************************************************************** const CubeFace CubeFace::neighbor_i1() const { switch (id) { case 0: return 2; // Z+; (X, Y, Z); neighbor X+ case 1: return 0; // Y+; (Z, X, Y); neighbor Z+ case 2: return 1; // X+; (Y, Z, X); neighbor Y+ case 3: return 1; // X-; (Y, Z, X); neighbor Y+ case 4: return 0; // Y-; (Z, X, Y); neighbor Z+ case 5: return 2; // Z-; (X, Y, Z); neighbor X+ default: throw err_cube_face_id; } } // ***************************************************************************** const CubeFace CubeFace::neighbor_j0() const { switch (id) { case 0: return 4; // Z+; (X, Y, Z); neighbor Y- case 1: return 3; // Y+; (Z, X, Y); neighbor X- case 2: return 5; // X+; (Y, Z, X); neighbor Z- case 3: return 5; // X-; (Y, Z, X); neighbor Z- case 4: return 3; // Y-; (Z, X, Y); neighbor X- case 5: return 4; // Z-; (X, Y, Z); neighbor Y- default: throw err_cube_face_id; } } // ***************************************************************************** const CubeFace CubeFace::neighbor_j1() const { switch (id) { case 0: return 1; // Z+; (X, Y, Z); neighbor Y+ case 1: return 2; // Y+; (Z, X, Y); neighbor X+ case 2: return 0; // X+; (Y, Z, X); neighbor Z+ case 3: return 0; // X-; (Y, Z, X); neighbor Z+ case 4: return 2; // Y-; (Z, X, Y); neighbor X+ case 5: return 1; // Z-; (X, Y, Z); neighbor Y+ default: throw err_cube_face_id; } } // ***************************************************************************** const CubeFace CubeFace::opposite() const { // IDs are chosen to that each matched pair adds up to 5 // This is just like a standard 6 sided die except IDs are shifted down by 1. // Opposite faces on a standard die add up to 7; here they add to 5. return CubeFace(5 - id); }
[ "michael.s.emanuel@gmail.com" ]
michael.s.emanuel@gmail.com
79cff3488096aea2c1e064accf2241bab01af291
9195c9c3b81126b2d8eb73728746cac1647fc1a2
/send-video.cpp
8c19c0bed78a5005aca94a817519e828cabe24ec
[]
no_license
4ndr3w/scopevision
88c8e4272cb36199a5109ab3d644a164a8eb9e32
7212c9e4c5f84f7e21fc5e503f3f47c6e5d77e17
refs/heads/master
2021-05-07T14:32:08.281685
2017-11-08T16:53:22
2017-11-08T16:53:22
109,897,506
0
0
null
null
null
null
UTF-8
C++
false
false
2,088
cpp
#include <iostream> #include <opencv2/opencv.hpp> #include "SerialPort.h" #include <sys/time.h> #include <mpv/client.h> using namespace std; using namespace cv; struct ArduinoData { char s; char x; char y; }; ArduinoData* sendBuf; int sendLen = 0; int bufSize = 500; void addPointToBuf(ArduinoData d) { if ( sendLen == bufSize-1 ) { bufSize *= 2; sendBuf = (ArduinoData*)realloc(sendBuf, bufSize * sizeof(ArduinoData)); } sendBuf[sendLen++] = d; } int compare(const void *a, const void *b) { ArduinoData* p1 = (ArduinoData*) a; ArduinoData* p2 = (ArduinoData*) b; int d1 = p1->x * p1->x + p1->y * p1->y; int d2 = p2->x * p2->x + p2->y * p2->y; return d1-d2; } int main() { mpv_handle *mpvctx = mpv_create(); mpv_initialize(mpvctx); // mpv_set_option_string(mpvctx, "video", "no"); sendBuf = (ArduinoData*)malloc(bufSize*sizeof(ArduinoData)); double period = 1.0/30.0; int usDelay = period*1000000.0; SerialPort<ArduinoData, ArduinoData> serial("/dev/ttyUSB0", B115200); cout << "ready" << endl; ArduinoData point = {0,0, 0}; serial.sendMessage(point); struct timeval timeStart; struct timeval timeEnd; fstream file("badapple.scope", fstream::in); const char* cmd[] = { "loadfile", "/home/andrew/badapple.avi", NULL }; mpv_command(mpvctx, cmd); while ( !file.eof() ) { gettimeofday(&timeStart, NULL); sendLen = 0; while ( true ) { file.get(point.x); if ( point.x == '\n' ) break; file.get(point.y); point.y = 255 - point.y; addPointToBuf(point); } // qsort(sendBuf, sendLen, sizeof(ArduinoData), compare); write(serial.fd(), sendBuf, sendLen*sizeof(ArduinoData)); gettimeofday(&timeEnd, NULL); long elapsed = (timeEnd.tv_sec-timeStart.tv_sec)*1000000+ timeEnd.tv_usec-timeStart.tv_usec; int realDelay = usDelay-elapsed; if ( realDelay > 1 ) usleep(realDelay); } cout << "exit" << endl; }
[ "andrew@lobos.me" ]
andrew@lobos.me
69d4e822593d95d70156eaa5cc153327d566556d
75964ad1e5c0b1e37580ab87a5653df5e894faf1
/lib/mexopencv-2.4.11/src/+cv/getRotationMatrix2D.cpp
75ee708c725f8359cea87a258185da64005addea
[ "BSD-3-Clause" ]
permissive
bittnt/paperdoll
c254beadc0622875832aa4d0af80b0ba6dc13469
ebab66d4d6cfcc984c2df342104846769538fb79
refs/heads/master
2021-06-10T07:13:41.605486
2018-11-01T20:13:50
2018-11-01T20:13:50
96,577,914
0
0
NOASSERTION
2018-11-01T20:13:51
2017-07-07T21:29:20
C
UTF-8
C++
false
false
1,207
cpp
/** * @file getRotationMatrix2D.cpp * @brief mex interface for getRotationMatrix2D * @author Kota Yamaguchi * @date 2012 */ #include "mexopencv.hpp" using namespace std; using namespace cv; /** * Main entry called from Matlab * @param nlhs number of left-hand-side arguments * @param plhs pointers to mxArrays in the left-hand-side * @param nrhs number of right-hand-side arguments * @param prhs pointers to mxArrays in the right-hand-side */ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { // Check the number of arguments if (nrhs!=3 || nlhs>1) mexErrMsgIdAndTxt("mexopencv:error","Wrong number of arguments"); // Argument vector vector<MxArray> rhs(prhs,prhs+nrhs); if (!rhs[0].isNumeric() || rhs[0].numel()!=2 || !rhs[1].isNumeric() || rhs[1].numel()!=1 || !rhs[2].isNumeric() || rhs[2].numel()!=1) mexErrMsgIdAndTxt("mexopencv:error","Invalid arguments"); // Process Point2f center = rhs[0].toPoint_<float>(); double angle = rhs[1].toDouble(); double scale = rhs[2].toDouble(); Mat t = getRotationMatrix2D(center, angle, scale); plhs[0] = MxArray(t); }
[ "KotaYamaguchi1984@gmail.com" ]
KotaYamaguchi1984@gmail.com
26299daec85caea2d941f441b45b6168d8de0ec9
cd0dab83377c1486516fb4f2d603b42913fd18b3
/chrome/browser/optimization_guide/optimization_guide_keyed_service.h
aed9b0332d67e44fe1d46c326c009351c60b96ff
[ "BSD-3-Clause" ]
permissive
XifeiNi/chromium
44edfd049b3c0702fad852d9286ce48ff50f926e
c2b3ac899f45c86a4ab19152fe161974020bcc46
refs/heads/master
2023-01-14T13:14:38.428430
2019-07-30T12:13:47
2019-07-30T12:13:47
199,645,684
2
0
null
2019-07-30T12:17:18
2019-07-30T12:17:18
null
UTF-8
C++
false
false
1,817
h
// Copyright 2019 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. #ifndef CHROME_BROWSER_OPTIMIZATION_GUIDE_OPTIMIZATION_GUIDE_KEYED_SERVICE_H_ #define CHROME_BROWSER_OPTIMIZATION_GUIDE_OPTIMIZATION_GUIDE_KEYED_SERVICE_H_ #include <memory> #include "base/macros.h" #include "components/keyed_service/core/keyed_service.h" namespace base { class FilePath; } // namespace base namespace content { class BrowserContext; } // namespace content namespace leveldb_proto { class ProtoDatabaseProvider; } // namespace leveldb_proto namespace optimization_guide { class OptimizationGuideService; } // namespace optimization_guide class OptimizationGuideHintsManager; class OptimizationGuideKeyedService : public KeyedService { public: explicit OptimizationGuideKeyedService( content::BrowserContext* browser_context); ~OptimizationGuideKeyedService() override; // Initializes the service. |optimization_guide_service| is the // Optimization Guide Service that is being listened to and is guaranteed to // outlive |this|. |profile_path| is the path to user data on disk. void Initialize( optimization_guide::OptimizationGuideService* optimization_guide_service, leveldb_proto::ProtoDatabaseProvider* database_provider, const base::FilePath& profile_path); OptimizationGuideHintsManager* GetHintsManager() { return hints_manager_.get(); } // KeyedService implementation. void Shutdown() override; private: std::unique_ptr<OptimizationGuideHintsManager> hints_manager_; content::BrowserContext* browser_context_; DISALLOW_COPY_AND_ASSIGN(OptimizationGuideKeyedService); }; #endif // CHROME_BROWSER_OPTIMIZATION_GUIDE_OPTIMIZATION_GUIDE_KEYED_SERVICE_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
924479fe8d950f918298c4331ca133e56fd5e059
43c0e6c59df4a320e19863b4e1df6e8c8ef90471
/cyclic_sort/find_missing_numer.cpp
a9db4446b99d45d3fa27c69dfefce044f89e5436
[]
no_license
NimaMan/coding_interview
7130c8da04f78fdbdaa6b5d7d12271edc016e07a
117b8a34db97385ce06d6bb161cb19c54a905059
refs/heads/main
2023-09-01T21:28:48.634157
2021-10-24T11:34:05
2021-10-24T11:34:05
398,330,852
0
0
null
null
null
null
UTF-8
C++
false
false
781
cpp
using namespace std; #include <iostream> #include <vector> void swap(vector<int>& arr, int i, int j) { int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } int findMissingNumber(vector<int>& nums) { int i = 0; int numSwaps = 0; int n = nums.size(); while (numSwaps <= n - i) { int j = nums[i]; if (j == i) { i++; numSwaps = 0; } else if (j == n){ swap(nums, i, j-1); } else { swap(nums, i, j); } if (numSwaps == n-i){ return i; } numSwaps++; } } int main(int argc, char *argv[]) { vector<int> v1 = {4, 0, 3, 1}; cout << findMissingNumber(v1) << endl; v1 = {8, 3, 5, 2, 4, 6, 0, 1}; cout << findMissingNumber(v1) << endl; }
[ "ndizbin14@ku.edu.tr" ]
ndizbin14@ku.edu.tr
8d212d03a9f7a84826a45fb94634c4bcaba3df63
81464366d3d2ab91a6600be8646d0856d413d8be
/Union_of_two_sorted_arrays.cpp
768186cc113688cf6c4fcdc5e1a6f5761ee3393f
[]
no_license
SunnyJaiswal5297/Basic_c_programs
08f289d04817f81222ceaacd7362e47fbae2935e
a2fd6168ce4ff075be6488c172200da21058dd93
refs/heads/master
2022-12-03T09:53:35.189234
2020-07-28T17:17:17
2020-07-28T17:17:17
283,201,986
1
0
null
null
null
null
UTF-8
C++
false
false
1,375
cpp
#include <bits/stdc++.h> using namespace std; void findUnion(int arr1[], int arr2[], int n, int m) { int i=0,j=0; int arr3[n+m]={0},k=0; while(i<n && j<m) { if(arr1[i]==arr2[j]) { if(k==0) arr3[k++]=arr1[i]; else if(k>=1 && arr3[k-1]!=arr1[i]) arr3[k++]=arr1[i]; i++; j++; } else if(arr1[i]>arr2[j]) { if(k==0) arr3[k++]=arr2[j]; else if(k>=1 && arr3[k-1]!=arr2[j]) arr3[k++]=arr2[j]; j++; } else { if(k==0) arr3[k++]=arr1[i]; else if(k>=1 && arr3[k-1]!=arr1[i]) arr3[k++]=arr1[i]; i++; } } while(i<n) { arr3[k++]=arr1[i]; i++; } while(j<m) { if(k>=1 && arr3[k-1]!=arr2[j]) arr3[k++]=arr2[j]; j++; } for(i=0;i<n+m;i++) if(arr3[i]) cout<<arr3[i]<<" "; } int main() { int T; cin >> T; while(T--) { int N, M; cin >>N >> M; int arr1[N]; int arr2[M]; for(int i = 0;i<N;i++){ cin >> arr1[i]; } for(int i = 0;i<M;i++){ cin >> arr2[i]; } findUnion(arr1,arr2, N, M); cout<<endl; } return 0; }
[ "s2jaiswal.sj@gmail.com" ]
s2jaiswal.sj@gmail.com
b394692ee2acd1e704cc2a6fb0199c208ab35523
0cd925175e12f423ce8790f5b482806f52cda3ed
/sample/tutorial2.cpp
a09518a9a8d1d2210af90e2cdf85f3856cdf5768
[ "MIT" ]
permissive
veblush/CppAuParser
b08e40847621629053443efcaf453385679b8a60
1aa0254fd9012cc07e619a5bbeb32dcd96fb9bd1
refs/heads/master
2020-04-08T09:09:10.155266
2012-12-19T06:11:35
2012-12-19T06:11:35
7,078,538
6
1
null
null
null
null
UTF-8
C++
false
false
1,250
cpp
// Copyright 2012 Esun Kim #include <cppauparser/all.h> #include <stdio.h> int main(int argc, char* argv[]) { // load grammar cppauparser::Grammar grammar; if (grammar.LoadFile(PATHSTR("data\\operator.egt")) == false) { printf("fail to open a grammar file\n"); return 1; } // parse a string with a ProductionHandler cppauparser::ProductionHandler ph(grammar); PH_ON(ph, "<E> ::= <E> + <M>", return (void*)((int)c[0].data + (int)c[2].data);); PH_ON(ph, "<E> ::= <E> - <M>", return (void*)((int)c[0].data - (int)c[2].data);); PH_ON(ph, "<E> ::= <M>", return c[0].data;); PH_ON(ph, "<M> ::= <M> * <N>", return (void*)((int)c[0].data * (int)c[2].data);); PH_ON(ph, "<M> ::= <M> / <N>", return (void*)((int)c[0].data / (int)c[2].data);); PH_ON(ph, "<M> ::= <N>", return c[0].data;); PH_ON(ph, "<N> ::= - <V>", return (void*)-(int)c[1].data; ); PH_ON(ph, "<N> ::= <V>", return c[0].data;); PH_ON(ph, "<V> ::= Num", return (void*)atoi((char*)c[0].token.lexeme.c_str());); PH_ON(ph, "<V> ::= ( <E> )", return c[1].data;); cppauparser::Parser parser(grammar); parser.LoadString("-2*(3+4)-5"); parser.ParseAll(ph); printf("Result = %d\n", (int)ph.GetResult()); return 0; }
[ "veblush+git@gmail.com" ]
veblush+git@gmail.com